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