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