xref: /illumos-gate/usr/src/cmd/fwflash/plugins/transport/Makefile.targ (revision d48be21240dfd051b689384ce2b23479d757f2d8)
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# Copyright 2020 Oxide Computer Company
26#
27include $(SRC)/lib/Makefile.lib
28
29SES_LIB=	ses.so
30TAVOR_LIB=	tavor.so
31HERMON_LIB=	hermon.so
32SD_LIB=		sd.so
33UFM_LIB=	ufm.so
34
35PLUGINS=	$(SES_LIB) $(TAVOR_LIB) $(HERMON_LIB) $(SD_LIB) $(UFM_LIB)
36
37OBJECTS= $(PLUGINS:%.so=%.o)
38DYNLIB=	$(PLUGINS:%=%)
39POFILES= $(PLUGINS:%.so=%.po)
40
41SLINKS=		sgen.so
42POFILE=	fwflash_transport_identify_ses.po
43SRCDIR= ../common
44
45include $(SRC)/cmd/fwflash/Makefile.com
46
47CLEANFILES=	$(PLUGINS) $(POFILES) $(POFILE) $(SLINKS)
48
49LIBS= $(DYNLIB)
50CFLAGS += $(C_PICFLAGS)
51ROOTLIBDIR= $(ROOTUSRLIBFWFLASHIDF)
52LDLIBS		+= -ldevinfo
53MAPFILES= ../common/mapfile-vers
54FILEMODE= 0755
55
56$(SES_LIB):=	PICS= pics/$(SES_LIB:%.so=%.o)
57$(TAVOR_LIB):=	PICS= pics/$(TAVOR_LIB:%.so=%.o)
58$(HERMON_LIB):=	PICS= pics/$(HERMON_LIB:%.so=%.o)
59$(SD_LIB):=	PICS= pics/$(SD_LIB:%.so=%.o)
60$(UFM_LIB):=	PICS= pics/$(UFM_LIB:%.so=%.o)
61
62$(SES_LIB):=    SONAME = $(SES_LIB)
63$(TAVOR_LIB):=  SONAME = $(TAVOR_LIB)
64$(HERMON_LIB):= SONAME = $(HERMON_LIB)
65$(SD_LIB):=     SONAME = $(SD_LIB)
66$(UFM_LIB):=     SONAME = $(UFM_LIB)
67
68$(HERMON_LIB):=	MAPFILES += ../common/mapfile-vers-hermon
69$(SD_LIB):=	MAPFILES += ../common/mapfile-vers-plus
70$(UFM_LIB):=	MAPFILES += ../common/mapfile-vers-plus
71
72$(HERMON_LIB):=	LDLIBS += -lc
73$(TAVOR_LIB):=	LDLIBS += -lc
74$(SES_LIB):=	LDLIBS += -L$(ROOT)/usr/lib/scsi -lscsi -lses -lnvpair -lc
75$(SD_LIB):=	LDLIBS += -L$(ROOT)/usr/lib/scsi -lscsi -lumem -lc
76$(UFM_LIB):=	LDLIBS += -lpcidb -lnvpair -lc
77
78$(SES_LIB):=	DYNFLAGS += -R/usr/lib/scsi
79$(SD_LIB):=	DYNFLAGS += -R/usr/lib/scsi
80
81# Size assertions are non-constant and not useful here
82ZGUIDANCE=-Wl,-zguidance=noasserts
83
84.KEEP_STATE:
85
86$(ROOTUSRLIBFWFLASHIDF)/$(SLINKS) : $(ROOTUSRLIBFWFLASHIDF)/$(SES_LIB)
87	@$(RM) $@
88	$(SYMLINK) $(SES_LIB) $@
89
90all: $(LIBS)
91
92install: all  $(ROOTLIBS) \
93	$(ROOTUSRLIBFWFLASHIDF)/$(SLINKS)
94
95_msg: $(POFILE)
96
97include $(SRC)/lib/Makefile.targ
98