1a799b1e7Speihong huang#
2a799b1e7Speihong huang# CDDL HEADER START
3a799b1e7Speihong huang#
4a799b1e7Speihong huang# The contents of this file are subject to the terms of the
5a799b1e7Speihong huang# Common Development and Distribution License (the "License").
6a799b1e7Speihong huang# You may not use this file except in compliance with the License.
7a799b1e7Speihong huang#
8a799b1e7Speihong huang# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9a799b1e7Speihong huang# or http://www.opensolaris.org/os/licensing.
10a799b1e7Speihong huang# See the License for the specific language governing permissions
11a799b1e7Speihong huang# and limitations under the License.
12a799b1e7Speihong huang#
13a799b1e7Speihong huang# When distributing Covered Code, include this CDDL HEADER in each
14a799b1e7Speihong huang# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15a799b1e7Speihong huang# If applicable, add the following below this CDDL HEADER, with the
16a799b1e7Speihong huang# fields enclosed by brackets "[]" replaced with your own identifying
17a799b1e7Speihong huang# information: Portions Copyright [yyyy] [name of copyright owner]
18a799b1e7Speihong huang#
19a799b1e7Speihong huang# CDDL HEADER END
20a799b1e7Speihong huang#
21a799b1e7Speihong huang# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
22a799b1e7Speihong huang# Use is subject to license terms.
23a799b1e7Speihong huang#
24f3655454SJohn Levon# Copyright 2020 Joyent, Inc.
258d55b806SRobert Mustacchi# Copyright 2020 Oxide Computer Company
26a799b1e7Speihong huang#
27a799b1e7Speihong huanginclude $(SRC)/lib/Makefile.lib
28a799b1e7Speihong huang
29a799b1e7Speihong huangSES_LIB=	ses.so
30a799b1e7Speihong huangTAVOR_LIB=	tavor.so
31a799b1e7Speihong huangHERMON_LIB=	hermon.so
32a799b1e7Speihong huangSD_LIB=		sd.so
338d55b806SRobert MustacchiUFM_LIB=	ufm.so
34a799b1e7Speihong huang
358d55b806SRobert MustacchiPLUGINS=	$(SES_LIB) $(TAVOR_LIB) $(HERMON_LIB) $(SD_LIB) $(UFM_LIB)
36a799b1e7Speihong huang
37a799b1e7Speihong huangOBJECTS= $(PLUGINS:%.so=%.o)
38a799b1e7Speihong huangDYNLIB=	$(PLUGINS:%=%)
39a799b1e7Speihong huangPOFILES= $(PLUGINS:%.so=%.po)
40a799b1e7Speihong huang
41a799b1e7Speihong huangSLINKS=		sgen.so
42a799b1e7Speihong huangPOFILE=	fwflash_transport_identify_ses.po
43a799b1e7Speihong huangSRCDIR= ../common
44a799b1e7Speihong huang
45a799b1e7Speihong huanginclude $(SRC)/cmd/fwflash/Makefile.com
46a799b1e7Speihong huang
473aa6c130SRichard LoweCLEANFILES=	$(PLUGINS) $(POFILES) $(POFILE) $(SLINKS)
48a799b1e7Speihong huang
49a799b1e7Speihong huangLIBS= $(DYNLIB)
508d55b806SRobert MustacchiCFLAGS += $(C_PICFLAGS)
51a799b1e7Speihong huangROOTLIBDIR= $(ROOTUSRLIBFWFLASHIDF)
52f3655454SJohn LevonLDLIBS		+= -ldevinfo
53a799b1e7Speihong huangMAPFILES= ../common/mapfile-vers
54a799b1e7Speihong huangFILEMODE= 0755
55a799b1e7Speihong huang
56a799b1e7Speihong huang$(SES_LIB):=	PICS= pics/$(SES_LIB:%.so=%.o)
57a799b1e7Speihong huang$(TAVOR_LIB):=	PICS= pics/$(TAVOR_LIB:%.so=%.o)
58a799b1e7Speihong huang$(HERMON_LIB):=	PICS= pics/$(HERMON_LIB:%.so=%.o)
59a799b1e7Speihong huang$(SD_LIB):=	PICS= pics/$(SD_LIB:%.so=%.o)
608d55b806SRobert Mustacchi$(UFM_LIB):=	PICS= pics/$(UFM_LIB:%.so=%.o)
61a799b1e7Speihong huang
62a799b1e7Speihong huang$(SES_LIB):=    SONAME = $(SES_LIB)
63a799b1e7Speihong huang$(TAVOR_LIB):=  SONAME = $(TAVOR_LIB)
64a799b1e7Speihong huang$(HERMON_LIB):= SONAME = $(HERMON_LIB)
65a799b1e7Speihong huang$(SD_LIB):=     SONAME = $(SD_LIB)
668d55b806SRobert Mustacchi$(UFM_LIB):=     SONAME = $(UFM_LIB)
67a799b1e7Speihong huang
68a799b1e7Speihong huang$(HERMON_LIB):=	MAPFILES += ../common/mapfile-vers-hermon
69a799b1e7Speihong huang$(SD_LIB):=	MAPFILES += ../common/mapfile-vers-plus
708d55b806SRobert Mustacchi$(UFM_LIB):=	MAPFILES += ../common/mapfile-vers-plus
71a799b1e7Speihong huang
72f3655454SJohn Levon$(HERMON_LIB):=	LDLIBS += -lc
73f3655454SJohn Levon$(TAVOR_LIB):=	LDLIBS += -lc
74f3655454SJohn Levon$(SES_LIB):=	LDLIBS += -L$(ROOT)/usr/lib/scsi -lscsi -lses -lnvpair -lc
75f3655454SJohn Levon$(SD_LIB):=	LDLIBS += -L$(ROOT)/usr/lib/scsi -lscsi -lumem -lc
768d55b806SRobert Mustacchi$(UFM_LIB):=	LDLIBS += -lpcidb -lnvpair -lc
77a799b1e7Speihong huang
788d55b806SRobert Mustacchi$(SES_LIB):=	DYNFLAGS += -R/usr/lib/scsi
798d55b806SRobert Mustacchi$(SD_LIB):=	DYNFLAGS += -R/usr/lib/scsi
80a799b1e7Speihong huang
818222814eSRichard Lowe# Size assertions are non-constant and not useful here
828222814eSRichard LoweZGUIDANCE=-Wl,-zguidance=noasserts
838222814eSRichard Lowe
84*f413b00bSRichard Lowe.KEEP_STATE:
85a799b1e7Speihong huang
86a799b1e7Speihong huang$(ROOTUSRLIBFWFLASHIDF)/$(SLINKS) : $(ROOTUSRLIBFWFLASHIDF)/$(SES_LIB)
87a799b1e7Speihong huang	@$(RM) $@
88a799b1e7Speihong huang	$(SYMLINK) $(SES_LIB) $@
89a799b1e7Speihong huang
90a799b1e7Speihong huangall: $(LIBS)
91a799b1e7Speihong huang
92a799b1e7Speihong huanginstall: all  $(ROOTLIBS) \
93a799b1e7Speihong huang	$(ROOTUSRLIBFWFLASHIDF)/$(SLINKS)
94a799b1e7Speihong huang
953aa6c130SRichard Lowe_msg: $(POFILE)
96a799b1e7Speihong huang
97a799b1e7Speihong huanginclude $(SRC)/lib/Makefile.targ
98