xref: /titanic_52/usr/src/cmd/rcm_daemon/Makefile.com (revision c0dd49bdd68c0d758a67d56f07826f3b45cfc664)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
5f841f6adSraf# Common Development and Distribution License (the "License").
6f841f6adSraf# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
217c478bd9Sstevel@tonic-gate#
221cfa752fSRamaswamy Tummala# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
237c478bd9Sstevel@tonic-gate#
247c478bd9Sstevel@tonic-gate
257c478bd9Sstevel@tonic-gateinclude ../../Makefile.cmd
267c478bd9Sstevel@tonic-gate
277c478bd9Sstevel@tonic-gateCOMMON = ../common
287c478bd9Sstevel@tonic-gate
297c478bd9Sstevel@tonic-gateRCM_SRC = \
307c478bd9Sstevel@tonic-gate	$(COMMON)/rcm_event.c \
317c478bd9Sstevel@tonic-gate	$(COMMON)/rcm_main.c \
327c478bd9Sstevel@tonic-gate	$(COMMON)/rcm_impl.c \
337c478bd9Sstevel@tonic-gate	$(COMMON)/rcm_subr.c \
347c478bd9Sstevel@tonic-gate	$(COMMON)/rcm_lock.c \
357c478bd9Sstevel@tonic-gate	$(COMMON)/rcm_script.c
367c478bd9Sstevel@tonic-gate
377c478bd9Sstevel@tonic-gateRCM_OBJ = \
387c478bd9Sstevel@tonic-gate	rcm_event.o \
397c478bd9Sstevel@tonic-gate	rcm_main.o \
407c478bd9Sstevel@tonic-gate	rcm_impl.o \
417c478bd9Sstevel@tonic-gate	rcm_subr.o \
427c478bd9Sstevel@tonic-gate	rcm_lock.o \
437c478bd9Sstevel@tonic-gate	rcm_script.o
447c478bd9Sstevel@tonic-gate
457c478bd9Sstevel@tonic-gateCOMMON_MOD_SRC = \
467c478bd9Sstevel@tonic-gate	$(COMMON)/filesys_rcm.c \
477c478bd9Sstevel@tonic-gate	$(COMMON)/dump_rcm.c \
487c478bd9Sstevel@tonic-gate	$(COMMON)/swap_rcm.c \
497c478bd9Sstevel@tonic-gate	$(COMMON)/network_rcm.c \
50d62bc4baSyz147064	$(COMMON)/vlan_rcm.c \
51da14cebeSEric Cheng	$(COMMON)/vnic_rcm.c \
521cfa752fSRamaswamy Tummala	$(COMMON)/ibpart_rcm.c \
53d62bc4baSyz147064	$(COMMON)/aggr_rcm.c \
547c478bd9Sstevel@tonic-gate	$(COMMON)/ip_rcm.c \
557c478bd9Sstevel@tonic-gate	$(COMMON)/cluster_rcm.c \
567c478bd9Sstevel@tonic-gate	$(COMMON)/pool_rcm.c \
577c478bd9Sstevel@tonic-gate	$(COMMON)/mpxio_rcm.c \
587c478bd9Sstevel@tonic-gate	$(COMMON)/ip_anon_rcm.c \
594eaa4710SRishi Srivatsavai	$(COMMON)/svm_rcm.c \
604eaa4710SRishi Srivatsavai	$(COMMON)/bridge_rcm.c
617c478bd9Sstevel@tonic-gate
627c478bd9Sstevel@tonic-gatesparc_MOD_SRC = $(COMMON)/ttymux_rcm.c
637c478bd9Sstevel@tonic-gate
64045b72beSjm22469COMMON_PERL_SCRIPT_SRC =
65045b72beSjm22469
66045b72beSjm22469sparc_PERL_SCRIPT_SRC = SUNW,vdevices.pl
67045b72beSjm22469
68*c0dd49bdSEiji OtaCOMMON_SHELL_SCRIPT_SRC = SUNW,ibsdpu.sh	\
69*c0dd49bdSEiji Ota			SUNW,rdsv3u.sh
7051f34d4bSRajkumar Sivaprakasam
717c478bd9Sstevel@tonic-gateCOMMON_MOD_OBJ = \
727c478bd9Sstevel@tonic-gate	filesys_rcm.o \
737c478bd9Sstevel@tonic-gate	dump_rcm.o \
747c478bd9Sstevel@tonic-gate	swap_rcm.o \
757c478bd9Sstevel@tonic-gate	network_rcm.o \
76d62bc4baSyz147064	vlan_rcm.o \
77da14cebeSEric Cheng	vnic_rcm.o \
781cfa752fSRamaswamy Tummala	ibpart_rcm.o \
79d62bc4baSyz147064	aggr_rcm.o \
807c478bd9Sstevel@tonic-gate	ip_rcm.o \
817c478bd9Sstevel@tonic-gate	cluster_rcm.o \
827c478bd9Sstevel@tonic-gate	pool_rcm.o \
837c478bd9Sstevel@tonic-gate	mpxio_rcm.o \
847c478bd9Sstevel@tonic-gate	ip_anon_rcm.o \
854eaa4710SRishi Srivatsavai	svm_rcm.o \
864eaa4710SRishi Srivatsavai	bridge_rcm.o
877c478bd9Sstevel@tonic-gate
887c478bd9Sstevel@tonic-gatesparc_MOD_OBJ = ttymux_rcm.o
897c478bd9Sstevel@tonic-gate
907c478bd9Sstevel@tonic-gateRCM_DAEMON = rcm_daemon
917c478bd9Sstevel@tonic-gate
927c478bd9Sstevel@tonic-gateCOMMON_RCM_MODS = \
937c478bd9Sstevel@tonic-gate	SUNW_filesys_rcm.so \
947c478bd9Sstevel@tonic-gate	SUNW_dump_rcm.so \
957c478bd9Sstevel@tonic-gate	SUNW_swap_rcm.so \
967c478bd9Sstevel@tonic-gate	SUNW_network_rcm.so \
97d62bc4baSyz147064	SUNW_vlan_rcm.so \
98da14cebeSEric Cheng	SUNW_vnic_rcm.so \
991cfa752fSRamaswamy Tummala	SUNW_ibpart_rcm.so \
100d62bc4baSyz147064	SUNW_aggr_rcm.so \
1017c478bd9Sstevel@tonic-gate	SUNW_ip_rcm.so \
1027c478bd9Sstevel@tonic-gate	SUNW_cluster_rcm.so \
1037c478bd9Sstevel@tonic-gate	SUNW_pool_rcm.so \
1047c478bd9Sstevel@tonic-gate	SUNW_mpxio_rcm.so \
1057c478bd9Sstevel@tonic-gate	SUNW_ip_anon_rcm.so \
1064eaa4710SRishi Srivatsavai	SUNW_svm_rcm.so \
1074eaa4710SRishi Srivatsavai	SUNW_bridge_rcm.so
1087c478bd9Sstevel@tonic-gate
1097c478bd9Sstevel@tonic-gatesparc_RCM_MODS = SUNW_ttymux_rcm.so
1107c478bd9Sstevel@tonic-gate
1117c478bd9Sstevel@tonic-gateRCM_DIR = rcm
1127c478bd9Sstevel@tonic-gateMOD_DIR = modules
1137c478bd9Sstevel@tonic-gateSCRIPT_DIR = scripts
1147c478bd9Sstevel@tonic-gate
1157c478bd9Sstevel@tonic-gateCLOBBERFILES = $(COMMON_RCM_MODS) $($(MACH)_RCM_MODS) $(RCM_DAEMON)
1167c478bd9Sstevel@tonic-gate
1177c478bd9Sstevel@tonic-gateLINT_MODULES = $(COMMON_MOD_SRC:.c=.ln) $($(MACH)_MOD_SRC:.c=.ln)
1187c478bd9Sstevel@tonic-gate
1190406ceaaSmeemCPPFLAGS += -I..
1207c478bd9Sstevel@tonic-gateCPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
1217c478bd9Sstevel@tonic-gateCFLAGS += $(CCVERBOSE) $(C_PICFLAGS)
1227c478bd9Sstevel@tonic-gate
12324da5b34SrieMAPFILES = ../common/mapfile-intf $(MAPFILE.NGB)
12424da5b34Sriercm_daemon := LDFLAGS += $(MAPFILES:%=-M%)
12524da5b34Srie
1267c478bd9Sstevel@tonic-gateLINTFLAGS += -u -erroff=E_FUNC_ARG_UNUSED
1277c478bd9Sstevel@tonic-gate
1287c478bd9Sstevel@tonic-gateLDLIBS_MODULES =
1297c478bd9Sstevel@tonic-gateSUNW_pool_rcm.so := LDLIBS_MODULES += -L$(ROOT)/usr/lib -lpool
1307c478bd9Sstevel@tonic-gateSUNW_svm_rcm.so	:= LDLIBS_MODULES += -L$(ROOT)/usr/lib -lmeta
131f595a68aSyz147064SUNW_network_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm
132d62bc4baSyz147064SUNW_vlan_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm
133da14cebeSEric ChengSUNW_vnic_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm
1341cfa752fSRamaswamy TummalaSUNW_ibpart_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm
135d62bc4baSyz147064SUNW_aggr_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm
1366e91bba0SGirish MoodalbailSUNW_ip_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -linetutil -ldladm -lipmp -lipadm
1370406ceaaSmeemSUNW_ip_anon_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -linetutil
1384eaa4710SRishi SrivatsavaiSUNW_bridge_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm
1397c478bd9Sstevel@tonic-gate
14006e1a714SrafLDLIBS += -lgen -lelf -lrcm -lnvpair -ldevinfo -lnsl -lsocket
1417c478bd9Sstevel@tonic-gate
1427c478bd9Sstevel@tonic-gateSRCS = $(RCM_SRC) $(COMMON_MOD_SRC)
1437c478bd9Sstevel@tonic-gate
1447c478bd9Sstevel@tonic-gatePOFILES = $(SRCS:.c=.po)
1457c478bd9Sstevel@tonic-gatePOFILE = prcm_daemon.po
1467c478bd9Sstevel@tonic-gate
147045b72beSjm22469PERL_SCRIPTS = $(COMMON_PERL_SRC) $($(MACH)_PERL_SCRIPT_SRC)
14851f34d4bSRajkumar SivaprakasamSHELL_SCRIPTS = $(COMMON_SHELL_SCRIPT_SRC)
14951f34d4bSRajkumar SivaprakasamRCM_SCRIPTS = $(PERL_SCRIPTS) $(SHELL_SCRIPTS)
150045b72beSjm22469
1517c478bd9Sstevel@tonic-gate# install specifics
1527c478bd9Sstevel@tonic-gate
1537c478bd9Sstevel@tonic-gateROOTLIB_RCM = $(ROOTLIB)/$(RCM_DIR)
1547c478bd9Sstevel@tonic-gateROOTLIB_RCM_MOD = $(ROOTLIB_RCM)/$(MOD_DIR)
1557c478bd9Sstevel@tonic-gateROOTLIB_RCM_DAEMON = $(RCM_DAEMON:%=$(ROOTLIB_RCM)/%)
1567c478bd9Sstevel@tonic-gateROOTLIB_RCM_MODULES = $(COMMON_RCM_MODS:%=$(ROOTLIB_RCM_MOD)/%) \
1577c478bd9Sstevel@tonic-gate			$($(MACH)_RCM_MODS:%=$(ROOTLIB_RCM_MOD)/%)
1587c478bd9Sstevel@tonic-gateROOTLIB_RCM_SCRIPT = $(ROOTLIB_RCM)/$(SCRIPT_DIR)
159045b72beSjm22469ROOTLIB_RCM_SCRIPTS = $(RCM_SCRIPTS:%=$(ROOTLIB_RCM_SCRIPT)/%)
1607c478bd9Sstevel@tonic-gateROOTETC_RCM = $(ROOTETC)/$(RCM_DIR)
1617c478bd9Sstevel@tonic-gateROOTETC_RCM_SCRIPT = $(ROOTETC_RCM)/$(SCRIPT_DIR)
1627c478bd9Sstevel@tonic-gate
1637c478bd9Sstevel@tonic-gateall :=		TARGET= all
1647c478bd9Sstevel@tonic-gateinstall :=	TARGET= install
1657c478bd9Sstevel@tonic-gateclean :=	TARGET= clean
1667c478bd9Sstevel@tonic-gateclobber :=	TARGET= clobber
1677c478bd9Sstevel@tonic-gatelint :=		TARGET= lint
1687c478bd9Sstevel@tonic-gate
169045b72beSjm22469$(ROOTLIB_RCM_SCRIPTS) :=	FILEMODE = 555
1707c478bd9Sstevel@tonic-gate
1717c478bd9Sstevel@tonic-gate.KEEP_STATE:
1727c478bd9Sstevel@tonic-gate
1737c478bd9Sstevel@tonic-gateall: $(RCM_DAEMON) $(COMMON_RCM_MODS) $($(MACH)_RCM_MODS)
1747c478bd9Sstevel@tonic-gate
1757c478bd9Sstevel@tonic-gateinstall: all			\
1767c478bd9Sstevel@tonic-gate	$(ROOTLIB_RCM)		\
1777c478bd9Sstevel@tonic-gate	$(ROOTLIB_RCM_DAEMON)	\
1787c478bd9Sstevel@tonic-gate	$(ROOTLIB_RCM_MOD)	\
1797c478bd9Sstevel@tonic-gate	$(ROOTLIB_RCM_MODULES)	\
1807c478bd9Sstevel@tonic-gate	$(ROOTLIB_RCM_SCRIPT)	\
1817c478bd9Sstevel@tonic-gate	$(ROOTETC_RCM)		\
182045b72beSjm22469	$(ROOTETC_RCM_SCRIPT)	\
183045b72beSjm22469	$(ROOTLIB_RCM_SCRIPTS)
1847c478bd9Sstevel@tonic-gate
1857c478bd9Sstevel@tonic-gateclean:
1867c478bd9Sstevel@tonic-gate	$(RM) $(RCM_OBJ) $(COMMON_MOD_OBJ) $($(MACH)_MOD_OBJ) $(POFILES)
1877c478bd9Sstevel@tonic-gate
1887c478bd9Sstevel@tonic-gatelint: $(RCM_DAEMON).ln $(LINT_MODULES)
1897c478bd9Sstevel@tonic-gate
1907c478bd9Sstevel@tonic-gate$(RCM_DAEMON).ln: FRC
1917c478bd9Sstevel@tonic-gate	$(LINT.c) $(RCM_SRC) $(LDLIBS)
1927c478bd9Sstevel@tonic-gate
1937c478bd9Sstevel@tonic-gate%.ln: FRC
1947c478bd9Sstevel@tonic-gate	$(LINT.c) $(RCM_SRC) $(@:.ln=.c) $(LDLIBS)
1957c478bd9Sstevel@tonic-gate
1967c478bd9Sstevel@tonic-gateFRC:
1977c478bd9Sstevel@tonic-gate
1987c478bd9Sstevel@tonic-gateinclude ../../Makefile.targ
1997c478bd9Sstevel@tonic-gate
2007c478bd9Sstevel@tonic-gate$(POFILE):      $(POFILES)
2017c478bd9Sstevel@tonic-gate	$(RM) $@; cat $(POFILES) > $@
2027c478bd9Sstevel@tonic-gate
20324da5b34Srie$(RCM_DAEMON): $(RCM_OBJ) $(MAPFILES)
2047c478bd9Sstevel@tonic-gate	$(LINK.c) -o $@ $< $(RCM_OBJ) $(LDLIBS)
2057c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
2067c478bd9Sstevel@tonic-gate
2077c478bd9Sstevel@tonic-gateSUNW_%.so: %.o
2087c478bd9Sstevel@tonic-gate	$(LINK.c) -o $@ $(GSHARED) -h $@ $< $(LDLIBS_MODULES)
2097c478bd9Sstevel@tonic-gate
2107c478bd9Sstevel@tonic-gate%.o: $(COMMON)/%.c
2117c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
2127c478bd9Sstevel@tonic-gate
2137c478bd9Sstevel@tonic-gate$(ROOTLIB_RCM):
2147c478bd9Sstevel@tonic-gate	$(INS.dir)
2157c478bd9Sstevel@tonic-gate
2167c478bd9Sstevel@tonic-gate$(ROOTLIB_RCM)/%: %
2177c478bd9Sstevel@tonic-gate	$(INS.file)
2187c478bd9Sstevel@tonic-gate
2197c478bd9Sstevel@tonic-gate$(ROOTLIB_RCM_MOD):
2207c478bd9Sstevel@tonic-gate	$(INS.dir)
2217c478bd9Sstevel@tonic-gate
2227c478bd9Sstevel@tonic-gate$(ROOTLIB_RCM_MOD)/%: %
2237c478bd9Sstevel@tonic-gate	$(INS.file)
2247c478bd9Sstevel@tonic-gate
2257c478bd9Sstevel@tonic-gate$(ROOTLIB_RCM_SCRIPT):
2267c478bd9Sstevel@tonic-gate	$(INS.dir)
2277c478bd9Sstevel@tonic-gate
2287c478bd9Sstevel@tonic-gate$(ROOTETC_RCM):
2297c478bd9Sstevel@tonic-gate	$(INS.dir)
2307c478bd9Sstevel@tonic-gate
2317c478bd9Sstevel@tonic-gate$(ROOTETC_RCM_SCRIPT):
2327c478bd9Sstevel@tonic-gate	$(INS.dir)
233045b72beSjm22469
234045b72beSjm22469$(ROOTLIB_RCM_SCRIPT)/%: $(COMMON)/%
235045b72beSjm22469	$(INS.file)
236