xref: /illumos-gate/usr/src/cmd/fwflash/plugins/transport/Makefile.targ (revision a92282e44f968185a6bba094d1e5fece2da819cf)
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)
40LINTFILE= $(PLUGINS:%.so=%.ln)
41
42SLINKS=		sgen.so
43POFILE=	fwflash_transport_identify_ses.po
44SRCDIR= ../common
45
46include $(SRC)/cmd/fwflash/Makefile.com
47
48CLEANFILES=	$(PLUGINS) $(POFILES) $(POFILE) $(LINTFILE) $(SLINKS)
49
50LIBS= $(DYNLIB)
51CFLAGS += $(C_PICFLAGS)
52ROOTLIBDIR= $(ROOTUSRLIBFWFLASHIDF)
53LDLIBS		+= -ldevinfo
54MAPFILES= ../common/mapfile-vers
55FILEMODE= 0755
56
57$(SES_LIB):=	PICS= pics/$(SES_LIB:%.so=%.o)
58$(TAVOR_LIB):=	PICS= pics/$(TAVOR_LIB:%.so=%.o)
59$(HERMON_LIB):=	PICS= pics/$(HERMON_LIB:%.so=%.o)
60$(SD_LIB):=	PICS= pics/$(SD_LIB:%.so=%.o)
61$(UFM_LIB):=	PICS= pics/$(UFM_LIB:%.so=%.o)
62
63$(SES_LIB):=    SONAME = $(SES_LIB)
64$(TAVOR_LIB):=  SONAME = $(TAVOR_LIB)
65$(HERMON_LIB):= SONAME = $(HERMON_LIB)
66$(SD_LIB):=     SONAME = $(SD_LIB)
67$(UFM_LIB):=     SONAME = $(UFM_LIB)
68
69$(HERMON_LIB):=	MAPFILES += ../common/mapfile-vers-hermon
70$(SD_LIB):=	MAPFILES += ../common/mapfile-vers-plus
71$(UFM_LIB):=	MAPFILES += ../common/mapfile-vers-plus
72
73$(HERMON_LIB):=	LDLIBS += -lc
74$(TAVOR_LIB):=	LDLIBS += -lc
75$(SES_LIB):=	LDLIBS += -L$(ROOT)/usr/lib/scsi -lscsi -lses -lnvpair -lc
76$(SD_LIB):=	LDLIBS += -L$(ROOT)/usr/lib/scsi -lscsi -lumem -lc
77$(UFM_LIB):=	LDLIBS += -lpcidb -lnvpair -lc
78
79$(SES_LIB):=	DYNFLAGS += -R/usr/lib/scsi
80$(SD_LIB):=	DYNFLAGS += -R/usr/lib/scsi
81
82.KEEP STATE:
83
84$(ROOTUSRLIBFWFLASHIDF)/$(SLINKS) : $(ROOTUSRLIBFWFLASHIDF)/$(SES_LIB)
85	@$(RM) $@
86	$(SYMLINK) $(SES_LIB) $@
87
88all: $(LIBS)
89
90install: all  $(ROOTLIBS) \
91	$(ROOTUSRLIBFWFLASHIDF)/$(SLINKS)
92
93lint: $(LINTFILE)
94
95_msg msg: $(POFILE)
96
97include $(SRC)/lib/Makefile.targ
98