1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
22# Use is subject to license terms.
23#
24# Copyright 2020 Joyent, Inc.
25#
26include $(SRC)/lib/Makefile.lib
27
28SES_LIB=	ses.so
29TAVOR_LIB=	tavor.so
30HERMON_LIB=	hermon.so
31SD_LIB=		sd.so
32
33PLUGINS=	$(SES_LIB) $(TAVOR_LIB) $(HERMON_LIB) $(SD_LIB)
34
35OBJECTS= $(PLUGINS:%.so=%.o)
36DYNLIB=	$(PLUGINS:%=%)
37POFILES= $(PLUGINS:%.so=%.po)
38LINTFILE= $(PLUGINS:%.so=%.ln)
39
40SLINKS=		sgen.so
41POFILE=	fwflash_transport_identify_ses.po
42SRCDIR= ../common
43
44include $(SRC)/cmd/fwflash/Makefile.com
45
46CLEANFILES=	$(PLUGINS) $(POFILES) $(POFILE) $(LINTFILE) $(SLINKS)
47
48LIBS= $(DYNLIB)
49CFLAGS += $(C_PICFLAGS)
50ROOTLIBDIR= $(ROOTUSRLIBFWFLASHIDF)
51LDLIBS		+= -ldevinfo
52MAPFILES= ../common/mapfile-vers
53FILEMODE= 0755
54
55$(SES_LIB):=	PICS= pics/$(SES_LIB:%.so=%.o)
56$(TAVOR_LIB):=	PICS= pics/$(TAVOR_LIB:%.so=%.o)
57$(HERMON_LIB):=	PICS= pics/$(HERMON_LIB:%.so=%.o)
58$(SD_LIB):=	PICS= pics/$(SD_LIB:%.so=%.o)
59
60$(SES_LIB):=    SONAME = $(SES_LIB)
61$(TAVOR_LIB):=  SONAME = $(TAVOR_LIB)
62$(HERMON_LIB):= SONAME = $(HERMON_LIB)
63$(SD_LIB):=     SONAME = $(SD_LIB)
64
65$(HERMON_LIB):=	MAPFILES += ../common/mapfile-vers-hermon
66$(SD_LIB):=	MAPFILES += ../common/mapfile-vers-plus
67
68$(HERMON_LIB):=	LDLIBS += -lc
69$(TAVOR_LIB):=	LDLIBS += -lc
70$(SES_LIB):=	LDLIBS += -L$(ROOT)/usr/lib/scsi -lscsi -lses -lnvpair -lc
71$(SD_LIB):=	LDLIBS += -L$(ROOT)/usr/lib/scsi -lscsi -lumem -lc
72
73$(SES_LIB):=	DYNFLAGS += -R/usr/lib/scsi
74$(SD_LIB):=	DYNFLAGS += -R/usr/lib/scsi
75
76.KEEP STATE:
77
78$(ROOTUSRLIBFWFLASHIDF)/$(SLINKS) : $(ROOTUSRLIBFWFLASHIDF)/$(SES_LIB)
79	@$(RM) $@
80	$(SYMLINK) $(SES_LIB) $@
81
82all: $(LIBS)
83
84install: all  $(ROOTLIBS) \
85	$(ROOTUSRLIBFWFLASHIDF)/$(SLINKS)
86
87lint: $(LINTFILE)
88
89_msg msg: $(POFILE)
90
91include $(SRC)/lib/Makefile.targ
92
93
94