xref: /titanic_52/usr/src/cmd/rcm_daemon/Makefile.com (revision f595a68a3b8953a12aa778c2abd7642df8da8c3a)
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#
22*f595a68aSyz147064# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate# Use is subject to license terms.
247c478bd9Sstevel@tonic-gate#
257c478bd9Sstevel@tonic-gate# ident	"%Z%%M%	%I%	%E% SMI"
267c478bd9Sstevel@tonic-gate#
277c478bd9Sstevel@tonic-gate
287c478bd9Sstevel@tonic-gateinclude ../../Makefile.cmd
297c478bd9Sstevel@tonic-gate
307c478bd9Sstevel@tonic-gateCOMMON = ../common
317c478bd9Sstevel@tonic-gate
327c478bd9Sstevel@tonic-gateRCM_SRC = \
337c478bd9Sstevel@tonic-gate	$(COMMON)/rcm_event.c \
347c478bd9Sstevel@tonic-gate	$(COMMON)/rcm_main.c \
357c478bd9Sstevel@tonic-gate	$(COMMON)/rcm_impl.c \
367c478bd9Sstevel@tonic-gate	$(COMMON)/rcm_subr.c \
377c478bd9Sstevel@tonic-gate	$(COMMON)/rcm_lock.c \
387c478bd9Sstevel@tonic-gate	$(COMMON)/rcm_script.c
397c478bd9Sstevel@tonic-gate
407c478bd9Sstevel@tonic-gateRCM_OBJ = \
417c478bd9Sstevel@tonic-gate	rcm_event.o \
427c478bd9Sstevel@tonic-gate	rcm_main.o \
437c478bd9Sstevel@tonic-gate	rcm_impl.o \
447c478bd9Sstevel@tonic-gate	rcm_subr.o \
457c478bd9Sstevel@tonic-gate	rcm_lock.o \
467c478bd9Sstevel@tonic-gate	rcm_script.o
477c478bd9Sstevel@tonic-gate
487c478bd9Sstevel@tonic-gateCOMMON_MOD_SRC = \
497c478bd9Sstevel@tonic-gate	$(COMMON)/filesys_rcm.c \
507c478bd9Sstevel@tonic-gate	$(COMMON)/dump_rcm.c \
517c478bd9Sstevel@tonic-gate	$(COMMON)/swap_rcm.c \
527c478bd9Sstevel@tonic-gate	$(COMMON)/network_rcm.c \
537c478bd9Sstevel@tonic-gate	$(COMMON)/ip_rcm.c \
547c478bd9Sstevel@tonic-gate	$(COMMON)/cluster_rcm.c \
557c478bd9Sstevel@tonic-gate	$(COMMON)/pool_rcm.c \
567c478bd9Sstevel@tonic-gate	$(COMMON)/mpxio_rcm.c \
577c478bd9Sstevel@tonic-gate	$(COMMON)/ip_anon_rcm.c \
58210db224Sericheng	$(COMMON)/svm_rcm.c
597c478bd9Sstevel@tonic-gate
607c478bd9Sstevel@tonic-gatesparc_MOD_SRC = $(COMMON)/ttymux_rcm.c
617c478bd9Sstevel@tonic-gate
627c478bd9Sstevel@tonic-gateCOMMON_MOD_OBJ = \
637c478bd9Sstevel@tonic-gate	filesys_rcm.o \
647c478bd9Sstevel@tonic-gate	dump_rcm.o \
657c478bd9Sstevel@tonic-gate	swap_rcm.o \
667c478bd9Sstevel@tonic-gate	network_rcm.o \
677c478bd9Sstevel@tonic-gate	ip_rcm.o \
687c478bd9Sstevel@tonic-gate	cluster_rcm.o \
697c478bd9Sstevel@tonic-gate	pool_rcm.o \
707c478bd9Sstevel@tonic-gate	mpxio_rcm.o \
717c478bd9Sstevel@tonic-gate	ip_anon_rcm.o \
72210db224Sericheng	svm_rcm.o
737c478bd9Sstevel@tonic-gate
747c478bd9Sstevel@tonic-gatesparc_MOD_OBJ = ttymux_rcm.o
757c478bd9Sstevel@tonic-gate
767c478bd9Sstevel@tonic-gateRCM_DAEMON = rcm_daemon
777c478bd9Sstevel@tonic-gate
787c478bd9Sstevel@tonic-gateCOMMON_RCM_MODS = \
797c478bd9Sstevel@tonic-gate	SUNW_filesys_rcm.so \
807c478bd9Sstevel@tonic-gate	SUNW_dump_rcm.so \
817c478bd9Sstevel@tonic-gate	SUNW_swap_rcm.so \
827c478bd9Sstevel@tonic-gate	SUNW_network_rcm.so \
837c478bd9Sstevel@tonic-gate	SUNW_ip_rcm.so \
847c478bd9Sstevel@tonic-gate	SUNW_cluster_rcm.so \
857c478bd9Sstevel@tonic-gate	SUNW_pool_rcm.so \
867c478bd9Sstevel@tonic-gate	SUNW_mpxio_rcm.so \
877c478bd9Sstevel@tonic-gate	SUNW_ip_anon_rcm.so \
88210db224Sericheng	SUNW_svm_rcm.so
897c478bd9Sstevel@tonic-gate
907c478bd9Sstevel@tonic-gatesparc_RCM_MODS = SUNW_ttymux_rcm.so
917c478bd9Sstevel@tonic-gate
927c478bd9Sstevel@tonic-gateRCM_DIR = rcm
937c478bd9Sstevel@tonic-gateMOD_DIR = modules
947c478bd9Sstevel@tonic-gateSCRIPT_DIR = scripts
957c478bd9Sstevel@tonic-gate
967c478bd9Sstevel@tonic-gateCLOBBERFILES = $(COMMON_RCM_MODS) $($(MACH)_RCM_MODS) $(RCM_DAEMON)
977c478bd9Sstevel@tonic-gate
987c478bd9Sstevel@tonic-gateLINT_MODULES = $(COMMON_MOD_SRC:.c=.ln) $($(MACH)_MOD_SRC:.c=.ln)
997c478bd9Sstevel@tonic-gate
1000406ceaaSmeemCPPFLAGS += -I..
1017c478bd9Sstevel@tonic-gateCPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
1027c478bd9Sstevel@tonic-gateCFLAGS += $(CCVERBOSE) $(C_PICFLAGS)
1037c478bd9Sstevel@tonic-gate
1047c478bd9Sstevel@tonic-gateLINTFLAGS += -u -erroff=E_FUNC_ARG_UNUSED
1057c478bd9Sstevel@tonic-gate
1067c478bd9Sstevel@tonic-gateLDLIBS_MODULES =
1077c478bd9Sstevel@tonic-gateSUNW_pool_rcm.so := LDLIBS_MODULES += -L$(ROOT)/usr/lib -lpool
1087c478bd9Sstevel@tonic-gateSUNW_svm_rcm.so	:= LDLIBS_MODULES += -L$(ROOT)/usr/lib -lmeta
109*f595a68aSyz147064SUNW_network_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm
110595aa6e4SmeemSUNW_ip_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -linetutil
1110406ceaaSmeemSUNW_ip_anon_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -linetutil
1127c478bd9Sstevel@tonic-gate
11306e1a714SrafLDLIBS += -lgen -lelf -lrcm -lnvpair -ldevinfo -lnsl -lsocket
1147c478bd9Sstevel@tonic-gate
1157c478bd9Sstevel@tonic-gateSRCS = $(RCM_SRC) $(COMMON_MOD_SRC)
1167c478bd9Sstevel@tonic-gate
1177c478bd9Sstevel@tonic-gatePOFILES = $(SRCS:.c=.po)
1187c478bd9Sstevel@tonic-gatePOFILE = prcm_daemon.po
1197c478bd9Sstevel@tonic-gate
1207c478bd9Sstevel@tonic-gate# install specifics
1217c478bd9Sstevel@tonic-gate
1227c478bd9Sstevel@tonic-gateROOTLIB_RCM = $(ROOTLIB)/$(RCM_DIR)
1237c478bd9Sstevel@tonic-gateROOTLIB_RCM_MOD = $(ROOTLIB_RCM)/$(MOD_DIR)
1247c478bd9Sstevel@tonic-gateROOTLIB_RCM_DAEMON = $(RCM_DAEMON:%=$(ROOTLIB_RCM)/%)
1257c478bd9Sstevel@tonic-gateROOTLIB_RCM_MODULES = $(COMMON_RCM_MODS:%=$(ROOTLIB_RCM_MOD)/%) \
1267c478bd9Sstevel@tonic-gate			$($(MACH)_RCM_MODS:%=$(ROOTLIB_RCM_MOD)/%)
1277c478bd9Sstevel@tonic-gateROOTLIB_RCM_SCRIPT = $(ROOTLIB_RCM)/$(SCRIPT_DIR)
1287c478bd9Sstevel@tonic-gateROOTETC_RCM = $(ROOTETC)/$(RCM_DIR)
1297c478bd9Sstevel@tonic-gateROOTETC_RCM_SCRIPT = $(ROOTETC_RCM)/$(SCRIPT_DIR)
1307c478bd9Sstevel@tonic-gate
1317c478bd9Sstevel@tonic-gateall :=		TARGET= all
1327c478bd9Sstevel@tonic-gateinstall :=	TARGET= install
1337c478bd9Sstevel@tonic-gateclean :=	TARGET= clean
1347c478bd9Sstevel@tonic-gateclobber :=	TARGET= clobber
1357c478bd9Sstevel@tonic-gatelint :=		TARGET= lint
1367c478bd9Sstevel@tonic-gate
1377c478bd9Sstevel@tonic-gate$(ROOTETC_RCM) :=		GROUP = sys
1387c478bd9Sstevel@tonic-gate$(ROOTETC_RCM_SCRIPT) :=	GROUP = sys
1397c478bd9Sstevel@tonic-gate
1407c478bd9Sstevel@tonic-gate.KEEP_STATE:
1417c478bd9Sstevel@tonic-gate
1427c478bd9Sstevel@tonic-gateall: $(RCM_DAEMON) $(COMMON_RCM_MODS) $($(MACH)_RCM_MODS)
1437c478bd9Sstevel@tonic-gate
1447c478bd9Sstevel@tonic-gateinstall: all			\
1457c478bd9Sstevel@tonic-gate	$(ROOTLIB_RCM)		\
1467c478bd9Sstevel@tonic-gate	$(ROOTLIB_RCM_DAEMON)	\
1477c478bd9Sstevel@tonic-gate	$(ROOTLIB_RCM_MOD)	\
1487c478bd9Sstevel@tonic-gate	$(ROOTLIB_RCM_MODULES)	\
1497c478bd9Sstevel@tonic-gate	$(ROOTLIB_RCM_SCRIPT)	\
1507c478bd9Sstevel@tonic-gate	$(ROOTETC_RCM)		\
1517c478bd9Sstevel@tonic-gate	$(ROOTETC_RCM_SCRIPT)
1527c478bd9Sstevel@tonic-gate
1537c478bd9Sstevel@tonic-gateclean:
1547c478bd9Sstevel@tonic-gate	$(RM) $(RCM_OBJ) $(COMMON_MOD_OBJ) $($(MACH)_MOD_OBJ) $(POFILES)
1557c478bd9Sstevel@tonic-gate
1567c478bd9Sstevel@tonic-gatelint: $(RCM_DAEMON).ln $(LINT_MODULES)
1577c478bd9Sstevel@tonic-gate
1587c478bd9Sstevel@tonic-gate$(RCM_DAEMON).ln: FRC
1597c478bd9Sstevel@tonic-gate	$(LINT.c) $(RCM_SRC) $(LDLIBS)
1607c478bd9Sstevel@tonic-gate
1617c478bd9Sstevel@tonic-gate%.ln: FRC
1627c478bd9Sstevel@tonic-gate	$(LINT.c) $(RCM_SRC) $(@:.ln=.c) $(LDLIBS)
1637c478bd9Sstevel@tonic-gate
1647c478bd9Sstevel@tonic-gateFRC:
1657c478bd9Sstevel@tonic-gate
1667c478bd9Sstevel@tonic-gateinclude ../../Makefile.targ
1677c478bd9Sstevel@tonic-gate
1687c478bd9Sstevel@tonic-gate$(POFILE):      $(POFILES)
1697c478bd9Sstevel@tonic-gate	$(RM) $@; cat $(POFILES) > $@
1707c478bd9Sstevel@tonic-gate
1717c478bd9Sstevel@tonic-gate$(RCM_DAEMON): $(RCM_OBJ)
1727c478bd9Sstevel@tonic-gate	$(LINK.c) -o $@ $< $(RCM_OBJ) $(LDLIBS)
1737c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1747c478bd9Sstevel@tonic-gate
1757c478bd9Sstevel@tonic-gateSUNW_%.so: %.o
1767c478bd9Sstevel@tonic-gate	$(LINK.c) -o $@ $(GSHARED) -h $@ $< $(LDLIBS_MODULES)
1777c478bd9Sstevel@tonic-gate
1787c478bd9Sstevel@tonic-gate%.o: $(COMMON)/%.c
1797c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
1807c478bd9Sstevel@tonic-gate
1817c478bd9Sstevel@tonic-gate$(ROOTLIB_RCM):
1827c478bd9Sstevel@tonic-gate	$(INS.dir)
1837c478bd9Sstevel@tonic-gate
1847c478bd9Sstevel@tonic-gate$(ROOTLIB_RCM)/%: %
1857c478bd9Sstevel@tonic-gate	$(INS.file)
1867c478bd9Sstevel@tonic-gate
1877c478bd9Sstevel@tonic-gate$(ROOTLIB_RCM_MOD):
1887c478bd9Sstevel@tonic-gate	$(INS.dir)
1897c478bd9Sstevel@tonic-gate
1907c478bd9Sstevel@tonic-gate$(ROOTLIB_RCM_MOD)/%: %
1917c478bd9Sstevel@tonic-gate	$(INS.file)
1927c478bd9Sstevel@tonic-gate
1937c478bd9Sstevel@tonic-gate$(ROOTLIB_RCM_SCRIPT):
1947c478bd9Sstevel@tonic-gate	$(INS.dir)
1957c478bd9Sstevel@tonic-gate
1967c478bd9Sstevel@tonic-gate$(ROOTETC_RCM):
1977c478bd9Sstevel@tonic-gate	$(INS.dir)
1987c478bd9Sstevel@tonic-gate
1997c478bd9Sstevel@tonic-gate$(ROOTETC_RCM_SCRIPT):
2007c478bd9Sstevel@tonic-gate	$(INS.dir)
201