xref: /illumos-gate/usr/src/cmd/fwflash/plugins/transport/i386/Makefile (revision 581cede61ac9c14d8d4ea452562a567189eead78)
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# cmd/fwflash/plugins/transport/i386
25#
26
27SRCS=		ses.c tavor.c hermon.c sd.c
28
29OBJECTS= 	$(SRCS:%.c=%.o)
30PLUGINS= 	$(SRCS:%.c=%.so)
31POFILES=	$(SRCS:%.c=%.po)
32IDENTPOFILE= 	fwflash_transport_identify_ses.po
33LINTFILE=	$(SRCS:%.c=%.ln)
34SLINKS=		sgen.so
35
36CLEANFILES=	$(OBJECTS)
37CLOBBERFILES=	$(PLUGINS) $(POFILES) $(IDENTPOFILE) $(LINTFILE) $(SLINKS)
38
39
40
41all:		$(PLUGINS)
42_msg msg:	$(IDENTPOFILE)
43
44
45include $(SRC)/Makefile.master
46include $(SRC)/cmd/fwflash/Makefile.com
47
48CFLAGS  += -g -D_POSIX_PTHREAD_SEMANTICS
49DYNFLAGS += -Bdynamic
50LDLIBS	+= -L$(ROOT)/usr/lib/scsi -ldevinfo -lumem -lc -lscsi -lses
51LDFLAGS += -R/usr/lib/scsi
52
53BUILD.SO=	$(LD) -o $@ -G $(DYNFLAGS) $(LDFLAGS) $(LDLIBS)
54
55$(PLUGINS) :=	FILEMODE = 0555
56
57
58$(ROOTLIBFWFLASHPLUGINS)/$(SLINKS) : $(ROOTLIBFWFLASHPLUGINS)/ses.so
59	@$(RM) $@
60	$(SYMLINK) ses.so $@
61
62install: all $(ROOTLIBFWFLASHPLUGINS) \
63	$(ROOTLIBFWFLASHPLUGINS)/ses.so \
64	$(ROOTLIBFWFLASHPLUGINS)/tavor.so \
65	$(ROOTLIBFWFLASHPLUGINS)/hermon.so \
66	$(ROOTLIBFWFLASHPLUGINS)/sd.so \
67	$(ROOTLIBFWFLASHPLUGINS)/$(SLINKS)
68
69clobber clean:
70	$(RM) $(CLEANFILES) $(CLOBBERFILES)
71
72lint_SRCS: $(LINTFILE)
73lint:	lint_SRCS
74
75%.o: ../common/%.c
76	$(COMPILE.c) $<
77	$(POST_PROCESS_O)
78
79%.so: %.o
80	$(BUILD.SO) $<
81
82%.ln: ../common/%.c
83	$(LINT.c) $(LINTFLAGS) -c $<
84
85
86#
87# Message catalog
88#
89%.po: ../common/%.c
90	$(RM) messages.po
91	$(XGETTEXT) $(XGETFLAGS) \
92	    `($(GREP) -l gettext $< || echo /dev/null)`
93	$(SED) "/^domain/d" messages.po > $@
94	$(RM) messages.po
95
96$(IDENTPOFILE): $(POFILES)
97	$(RM) $@
98	cat $(POFILES) > $@
99
100