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# 22e11c3f44Smeem# Copyright 2009 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate# Use is subject to license terms. 247c478bd9Sstevel@tonic-gate# 257c478bd9Sstevel@tonic-gate 267c478bd9Sstevel@tonic-gateinclude ../../Makefile.cmd 277c478bd9Sstevel@tonic-gate 287c478bd9Sstevel@tonic-gateCOMMON = ../common 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gateRCM_SRC = \ 317c478bd9Sstevel@tonic-gate $(COMMON)/rcm_event.c \ 327c478bd9Sstevel@tonic-gate $(COMMON)/rcm_main.c \ 337c478bd9Sstevel@tonic-gate $(COMMON)/rcm_impl.c \ 347c478bd9Sstevel@tonic-gate $(COMMON)/rcm_subr.c \ 357c478bd9Sstevel@tonic-gate $(COMMON)/rcm_lock.c \ 367c478bd9Sstevel@tonic-gate $(COMMON)/rcm_script.c 377c478bd9Sstevel@tonic-gate 387c478bd9Sstevel@tonic-gateRCM_OBJ = \ 397c478bd9Sstevel@tonic-gate rcm_event.o \ 407c478bd9Sstevel@tonic-gate rcm_main.o \ 417c478bd9Sstevel@tonic-gate rcm_impl.o \ 427c478bd9Sstevel@tonic-gate rcm_subr.o \ 437c478bd9Sstevel@tonic-gate rcm_lock.o \ 447c478bd9Sstevel@tonic-gate rcm_script.o 457c478bd9Sstevel@tonic-gate 467c478bd9Sstevel@tonic-gateCOMMON_MOD_SRC = \ 477c478bd9Sstevel@tonic-gate $(COMMON)/filesys_rcm.c \ 487c478bd9Sstevel@tonic-gate $(COMMON)/dump_rcm.c \ 497c478bd9Sstevel@tonic-gate $(COMMON)/swap_rcm.c \ 507c478bd9Sstevel@tonic-gate $(COMMON)/network_rcm.c \ 51d62bc4baSyz147064 $(COMMON)/vlan_rcm.c \ 52da14cebeSEric Cheng $(COMMON)/vnic_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 \ 59210db224Sericheng $(COMMON)/svm_rcm.c 607c478bd9Sstevel@tonic-gate 617c478bd9Sstevel@tonic-gatesparc_MOD_SRC = $(COMMON)/ttymux_rcm.c 627c478bd9Sstevel@tonic-gate 63045b72beSjm22469COMMON_PERL_SCRIPT_SRC = 64045b72beSjm22469 65045b72beSjm22469sparc_PERL_SCRIPT_SRC = SUNW,vdevices.pl 66045b72beSjm22469 67*51f34d4bSRajkumar SivaprakasamCOMMON_SHELL_SCRIPT_SRC = SUNW,ibsdpu.sh 68*51f34d4bSRajkumar Sivaprakasam 697c478bd9Sstevel@tonic-gateCOMMON_MOD_OBJ = \ 707c478bd9Sstevel@tonic-gate filesys_rcm.o \ 717c478bd9Sstevel@tonic-gate dump_rcm.o \ 727c478bd9Sstevel@tonic-gate swap_rcm.o \ 737c478bd9Sstevel@tonic-gate network_rcm.o \ 74d62bc4baSyz147064 vlan_rcm.o \ 75da14cebeSEric Cheng vnic_rcm.o \ 76d62bc4baSyz147064 aggr_rcm.o \ 777c478bd9Sstevel@tonic-gate ip_rcm.o \ 787c478bd9Sstevel@tonic-gate cluster_rcm.o \ 797c478bd9Sstevel@tonic-gate pool_rcm.o \ 807c478bd9Sstevel@tonic-gate mpxio_rcm.o \ 817c478bd9Sstevel@tonic-gate ip_anon_rcm.o \ 82210db224Sericheng svm_rcm.o 837c478bd9Sstevel@tonic-gate 847c478bd9Sstevel@tonic-gatesparc_MOD_OBJ = ttymux_rcm.o 857c478bd9Sstevel@tonic-gate 867c478bd9Sstevel@tonic-gateRCM_DAEMON = rcm_daemon 877c478bd9Sstevel@tonic-gate 887c478bd9Sstevel@tonic-gateCOMMON_RCM_MODS = \ 897c478bd9Sstevel@tonic-gate SUNW_filesys_rcm.so \ 907c478bd9Sstevel@tonic-gate SUNW_dump_rcm.so \ 917c478bd9Sstevel@tonic-gate SUNW_swap_rcm.so \ 927c478bd9Sstevel@tonic-gate SUNW_network_rcm.so \ 93d62bc4baSyz147064 SUNW_vlan_rcm.so \ 94da14cebeSEric Cheng SUNW_vnic_rcm.so \ 95d62bc4baSyz147064 SUNW_aggr_rcm.so \ 967c478bd9Sstevel@tonic-gate SUNW_ip_rcm.so \ 977c478bd9Sstevel@tonic-gate SUNW_cluster_rcm.so \ 987c478bd9Sstevel@tonic-gate SUNW_pool_rcm.so \ 997c478bd9Sstevel@tonic-gate SUNW_mpxio_rcm.so \ 1007c478bd9Sstevel@tonic-gate SUNW_ip_anon_rcm.so \ 101210db224Sericheng SUNW_svm_rcm.so 1027c478bd9Sstevel@tonic-gate 1037c478bd9Sstevel@tonic-gatesparc_RCM_MODS = SUNW_ttymux_rcm.so 1047c478bd9Sstevel@tonic-gate 1057c478bd9Sstevel@tonic-gateRCM_DIR = rcm 1067c478bd9Sstevel@tonic-gateMOD_DIR = modules 1077c478bd9Sstevel@tonic-gateSCRIPT_DIR = scripts 1087c478bd9Sstevel@tonic-gate 1097c478bd9Sstevel@tonic-gateCLOBBERFILES = $(COMMON_RCM_MODS) $($(MACH)_RCM_MODS) $(RCM_DAEMON) 1107c478bd9Sstevel@tonic-gate 1117c478bd9Sstevel@tonic-gateLINT_MODULES = $(COMMON_MOD_SRC:.c=.ln) $($(MACH)_MOD_SRC:.c=.ln) 1127c478bd9Sstevel@tonic-gate 1130406ceaaSmeemCPPFLAGS += -I.. 1147c478bd9Sstevel@tonic-gateCPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT 1157c478bd9Sstevel@tonic-gateCFLAGS += $(CCVERBOSE) $(C_PICFLAGS) 1167c478bd9Sstevel@tonic-gate 11724da5b34SrieMAPFILES = ../common/mapfile-intf $(MAPFILE.NGB) 11824da5b34Sriercm_daemon := LDFLAGS += $(MAPFILES:%=-M%) 11924da5b34Srie 1207c478bd9Sstevel@tonic-gateLINTFLAGS += -u -erroff=E_FUNC_ARG_UNUSED 1217c478bd9Sstevel@tonic-gate 1227c478bd9Sstevel@tonic-gateLDLIBS_MODULES = 1237c478bd9Sstevel@tonic-gateSUNW_pool_rcm.so := LDLIBS_MODULES += -L$(ROOT)/usr/lib -lpool 1247c478bd9Sstevel@tonic-gateSUNW_svm_rcm.so := LDLIBS_MODULES += -L$(ROOT)/usr/lib -lmeta 125f595a68aSyz147064SUNW_network_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm 126d62bc4baSyz147064SUNW_vlan_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm 127da14cebeSEric ChengSUNW_vnic_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm 128d62bc4baSyz147064SUNW_aggr_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm 129e11c3f44SmeemSUNW_ip_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -linetutil -ldladm -lipmp 1300406ceaaSmeemSUNW_ip_anon_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -linetutil 1317c478bd9Sstevel@tonic-gate 13206e1a714SrafLDLIBS += -lgen -lelf -lrcm -lnvpair -ldevinfo -lnsl -lsocket 1337c478bd9Sstevel@tonic-gate 1347c478bd9Sstevel@tonic-gateSRCS = $(RCM_SRC) $(COMMON_MOD_SRC) 1357c478bd9Sstevel@tonic-gate 1367c478bd9Sstevel@tonic-gatePOFILES = $(SRCS:.c=.po) 1377c478bd9Sstevel@tonic-gatePOFILE = prcm_daemon.po 1387c478bd9Sstevel@tonic-gate 139045b72beSjm22469PERL_SCRIPTS = $(COMMON_PERL_SRC) $($(MACH)_PERL_SCRIPT_SRC) 140*51f34d4bSRajkumar SivaprakasamSHELL_SCRIPTS = $(COMMON_SHELL_SCRIPT_SRC) 141*51f34d4bSRajkumar SivaprakasamRCM_SCRIPTS = $(PERL_SCRIPTS) $(SHELL_SCRIPTS) 142045b72beSjm22469 1437c478bd9Sstevel@tonic-gate# install specifics 1447c478bd9Sstevel@tonic-gate 1457c478bd9Sstevel@tonic-gateROOTLIB_RCM = $(ROOTLIB)/$(RCM_DIR) 1467c478bd9Sstevel@tonic-gateROOTLIB_RCM_MOD = $(ROOTLIB_RCM)/$(MOD_DIR) 1477c478bd9Sstevel@tonic-gateROOTLIB_RCM_DAEMON = $(RCM_DAEMON:%=$(ROOTLIB_RCM)/%) 1487c478bd9Sstevel@tonic-gateROOTLIB_RCM_MODULES = $(COMMON_RCM_MODS:%=$(ROOTLIB_RCM_MOD)/%) \ 1497c478bd9Sstevel@tonic-gate $($(MACH)_RCM_MODS:%=$(ROOTLIB_RCM_MOD)/%) 1507c478bd9Sstevel@tonic-gateROOTLIB_RCM_SCRIPT = $(ROOTLIB_RCM)/$(SCRIPT_DIR) 151045b72beSjm22469ROOTLIB_RCM_SCRIPTS = $(RCM_SCRIPTS:%=$(ROOTLIB_RCM_SCRIPT)/%) 1527c478bd9Sstevel@tonic-gateROOTETC_RCM = $(ROOTETC)/$(RCM_DIR) 1537c478bd9Sstevel@tonic-gateROOTETC_RCM_SCRIPT = $(ROOTETC_RCM)/$(SCRIPT_DIR) 1547c478bd9Sstevel@tonic-gate 1557c478bd9Sstevel@tonic-gateall := TARGET= all 1567c478bd9Sstevel@tonic-gateinstall := TARGET= install 1577c478bd9Sstevel@tonic-gateclean := TARGET= clean 1587c478bd9Sstevel@tonic-gateclobber := TARGET= clobber 1597c478bd9Sstevel@tonic-gatelint := TARGET= lint 1607c478bd9Sstevel@tonic-gate 1617c478bd9Sstevel@tonic-gate$(ROOTETC_RCM) := GROUP = sys 1627c478bd9Sstevel@tonic-gate$(ROOTETC_RCM_SCRIPT) := GROUP = sys 163045b72beSjm22469$(ROOTLIB_RCM_SCRIPTS) := FILEMODE = 555 1647c478bd9Sstevel@tonic-gate 1657c478bd9Sstevel@tonic-gate.KEEP_STATE: 1667c478bd9Sstevel@tonic-gate 1677c478bd9Sstevel@tonic-gateall: $(RCM_DAEMON) $(COMMON_RCM_MODS) $($(MACH)_RCM_MODS) 1687c478bd9Sstevel@tonic-gate 1697c478bd9Sstevel@tonic-gateinstall: all \ 1707c478bd9Sstevel@tonic-gate $(ROOTLIB_RCM) \ 1717c478bd9Sstevel@tonic-gate $(ROOTLIB_RCM_DAEMON) \ 1727c478bd9Sstevel@tonic-gate $(ROOTLIB_RCM_MOD) \ 1737c478bd9Sstevel@tonic-gate $(ROOTLIB_RCM_MODULES) \ 1747c478bd9Sstevel@tonic-gate $(ROOTLIB_RCM_SCRIPT) \ 1757c478bd9Sstevel@tonic-gate $(ROOTETC_RCM) \ 176045b72beSjm22469 $(ROOTETC_RCM_SCRIPT) \ 177045b72beSjm22469 $(ROOTLIB_RCM_SCRIPTS) 1787c478bd9Sstevel@tonic-gate 1797c478bd9Sstevel@tonic-gateclean: 1807c478bd9Sstevel@tonic-gate $(RM) $(RCM_OBJ) $(COMMON_MOD_OBJ) $($(MACH)_MOD_OBJ) $(POFILES) 1817c478bd9Sstevel@tonic-gate 1827c478bd9Sstevel@tonic-gatelint: $(RCM_DAEMON).ln $(LINT_MODULES) 1837c478bd9Sstevel@tonic-gate 1847c478bd9Sstevel@tonic-gate$(RCM_DAEMON).ln: FRC 1857c478bd9Sstevel@tonic-gate $(LINT.c) $(RCM_SRC) $(LDLIBS) 1867c478bd9Sstevel@tonic-gate 1877c478bd9Sstevel@tonic-gate%.ln: FRC 1887c478bd9Sstevel@tonic-gate $(LINT.c) $(RCM_SRC) $(@:.ln=.c) $(LDLIBS) 1897c478bd9Sstevel@tonic-gate 1907c478bd9Sstevel@tonic-gateFRC: 1917c478bd9Sstevel@tonic-gate 1927c478bd9Sstevel@tonic-gateinclude ../../Makefile.targ 1937c478bd9Sstevel@tonic-gate 1947c478bd9Sstevel@tonic-gate$(POFILE): $(POFILES) 1957c478bd9Sstevel@tonic-gate $(RM) $@; cat $(POFILES) > $@ 1967c478bd9Sstevel@tonic-gate 19724da5b34Srie$(RCM_DAEMON): $(RCM_OBJ) $(MAPFILES) 1987c478bd9Sstevel@tonic-gate $(LINK.c) -o $@ $< $(RCM_OBJ) $(LDLIBS) 1997c478bd9Sstevel@tonic-gate $(POST_PROCESS) 2007c478bd9Sstevel@tonic-gate 2017c478bd9Sstevel@tonic-gateSUNW_%.so: %.o 2027c478bd9Sstevel@tonic-gate $(LINK.c) -o $@ $(GSHARED) -h $@ $< $(LDLIBS_MODULES) 2037c478bd9Sstevel@tonic-gate 2047c478bd9Sstevel@tonic-gate%.o: $(COMMON)/%.c 2057c478bd9Sstevel@tonic-gate $(COMPILE.c) -o $@ $< 2067c478bd9Sstevel@tonic-gate 2077c478bd9Sstevel@tonic-gate$(ROOTLIB_RCM): 2087c478bd9Sstevel@tonic-gate $(INS.dir) 2097c478bd9Sstevel@tonic-gate 2107c478bd9Sstevel@tonic-gate$(ROOTLIB_RCM)/%: % 2117c478bd9Sstevel@tonic-gate $(INS.file) 2127c478bd9Sstevel@tonic-gate 2137c478bd9Sstevel@tonic-gate$(ROOTLIB_RCM_MOD): 2147c478bd9Sstevel@tonic-gate $(INS.dir) 2157c478bd9Sstevel@tonic-gate 2167c478bd9Sstevel@tonic-gate$(ROOTLIB_RCM_MOD)/%: % 2177c478bd9Sstevel@tonic-gate $(INS.file) 2187c478bd9Sstevel@tonic-gate 2197c478bd9Sstevel@tonic-gate$(ROOTLIB_RCM_SCRIPT): 2207c478bd9Sstevel@tonic-gate $(INS.dir) 2217c478bd9Sstevel@tonic-gate 2227c478bd9Sstevel@tonic-gate$(ROOTETC_RCM): 2237c478bd9Sstevel@tonic-gate $(INS.dir) 2247c478bd9Sstevel@tonic-gate 2257c478bd9Sstevel@tonic-gate$(ROOTETC_RCM_SCRIPT): 2267c478bd9Sstevel@tonic-gate $(INS.dir) 227045b72beSjm22469 228045b72beSjm22469$(ROOTLIB_RCM_SCRIPT)/%: $(COMMON)/% 229045b72beSjm22469 $(INS.file) 230