xref: /titanic_52/usr/src/cmd/luxadm/Makefile (revision 7535ae1914017b0e648abd7a139aca709fa82be3)
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#
22# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25
26PROG = luxadm
27
28COBJS = adm.o fchba.o lux_util.o fabric_conf.o
29OBJS_sparc= g_adm.o diag.o fcalupdate.o hotplug.o qlgcupdate.o setboot.o
30OBJS_i386 = x86_adm.o errormsgs.o
31OBJS = $(OBJS_$(MACH)) $(COBJS)
32
33SRCS = $(OBJS:%.o=%.c)
34
35POFILES = $(OBJS:%.o=%.po)
36POFILE = luxadm.po
37
38include ../Makefile.cmd
39
40CERRWARN +=	-_gcc=-Wno-parentheses
41CERRWARN +=	-_gcc=-Wno-uninitialized
42CERRWARN +=	-_gcc=-Wno-unused-label
43CERRWARN +=	-_gcc=-Wno-address
44
45sparc_LDLIBS = -la5k -lg_fc -ldevid -lkstat -ldevinfo
46i386_LDLIBS =
47LDLIBS += $($(MACH)_LDLIBS)
48LDLIBS += -lnvpair
49LDLIBS += -ldevice
50LDLIBS += -lHBAAPI
51
52INCS += -I$(SRC)/lib/sun_fc/common
53
54CPPFLAGS += -D_LARGEFILE64_SOURCE=1 -D_REENTRANT $(INCS)
55
56LINTFLAGS += -erroff=E_FUNC_RET_MAYBE_IGNORED2
57LINTFLAGS += -erroff=E_SEC_PRINTF_VAR_FMT
58LINTFLAGS += -erroff=E_SEC_SPRINTF_UNBOUNDED_COPY
59LINTFLAGS += -erroff=E_NAME_USED_NOT_DEF2
60LINTFLAGS += -erroff=E_BAD_FORMAT_ARG_TYPE2
61LINTFLAGS += -erroff=E_SEC_FORBIDDEN_WARN_GETS
62LINTFLAGS += -erroff=E_SEC_SCANF_UNBOUNDED_COPY
63
64ROOTUSRSBINLINKS = $(PROG:%=$(ROOTUSRSBIN)/%)
65
66.KEEP_STATE:
67
68all: $(PROG)
69
70$(PROG): $(OBJS)
71	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
72	$(POST_PROCESS)
73
74GENCAT_PROG=a5k_g_fc_i18n_cat
75GENMSG_LUX=	$(PROG).msg
76LUXFIRMWARED=   $(ROOTLIB)/locale/C/LC_MESSAGES
77LUXIBFIRMWARE_sparc=  $(LUXFIRMWARED)/ibfirmware
78LUXIBFIRMWARE=  $(LUXIBFIRMWARE_$(MACH))
79LUXGENCAT_PROG_sparc= $(LUXFIRMWARED)/$(GENCAT_PROG)
80LUXGENCAT_PROG= $(LUXGENCAT_PROG_$(MACH))
81$(LUXIBFIRMWARE):= FILEMODE= 0644
82$(LUXGENCAT_PROG):= FILEMODE= 0644
83
84$(LUXFIRMWARED):
85	$(INS.dir)
86
87$(LUXIBFIRMWARE):       $(LUXFIRMWARED) ibfirmware
88	$(INS.file) ibfirmware
89
90$(GENMSG_LUX):		$(SRCS)
91	/usr/bin/genmsg -d -p '$(COMPILE.cpp)' -o $@ $(SRCS)
92
93$(GENCAT_PROG):		$(GENMSG_LUX)
94	/usr/bin/gencat $@ $(GENMSG_LUX)
95
96$(LUXGENCAT_PROG):      $(LUXFIRMWARED) $(GENCAT_PROG)
97	$(INS.file) $(GENCAT_PROG)
98
99install: all $(ROOTUSRSBINPROG) $(LUXIBFIRMWARE) $(LUXGENCAT_PROG)
100
101$(POFILE): $(POFILES)
102	$(RM) $@
103	$(CAT) $(POFILES) > $@
104
105clean:
106	$(RM) $(OBJS) $(PROG) $(GENCAT_PROG) $(GENMSG_LUX)
107
108lint:	lint_SRCS
109
110include ../Makefile.targ
111