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# 21*e373b6e4SYuri Pankov 227c478bd9Sstevel@tonic-gate# 231cfa752fSRamaswamy Tummala# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 24*e373b6e4SYuri Pankov# Copyright 2016 Nexenta Systems, Inc. 257c478bd9Sstevel@tonic-gate# 267c478bd9Sstevel@tonic-gate 277c478bd9Sstevel@tonic-gateinclude ../../Makefile.cmd 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gateCOMMON = ../common 307c478bd9Sstevel@tonic-gate 317c478bd9Sstevel@tonic-gateRCM_SRC = \ 327c478bd9Sstevel@tonic-gate $(COMMON)/rcm_event.c \ 337c478bd9Sstevel@tonic-gate $(COMMON)/rcm_main.c \ 347c478bd9Sstevel@tonic-gate $(COMMON)/rcm_impl.c \ 357c478bd9Sstevel@tonic-gate $(COMMON)/rcm_subr.c \ 367c478bd9Sstevel@tonic-gate $(COMMON)/rcm_lock.c \ 377c478bd9Sstevel@tonic-gate $(COMMON)/rcm_script.c 387c478bd9Sstevel@tonic-gate 397c478bd9Sstevel@tonic-gateRCM_OBJ = \ 407c478bd9Sstevel@tonic-gate rcm_event.o \ 417c478bd9Sstevel@tonic-gate rcm_main.o \ 427c478bd9Sstevel@tonic-gate rcm_impl.o \ 437c478bd9Sstevel@tonic-gate rcm_subr.o \ 447c478bd9Sstevel@tonic-gate rcm_lock.o \ 457c478bd9Sstevel@tonic-gate rcm_script.o 467c478bd9Sstevel@tonic-gate 477c478bd9Sstevel@tonic-gateCOMMON_MOD_SRC = \ 487c478bd9Sstevel@tonic-gate $(COMMON)/filesys_rcm.c \ 497c478bd9Sstevel@tonic-gate $(COMMON)/dump_rcm.c \ 507c478bd9Sstevel@tonic-gate $(COMMON)/swap_rcm.c \ 517c478bd9Sstevel@tonic-gate $(COMMON)/network_rcm.c \ 52d62bc4baSyz147064 $(COMMON)/vlan_rcm.c \ 53da14cebeSEric Cheng $(COMMON)/vnic_rcm.c \ 541cfa752fSRamaswamy Tummala $(COMMON)/ibpart_rcm.c \ 55d62bc4baSyz147064 $(COMMON)/aggr_rcm.c \ 567c478bd9Sstevel@tonic-gate $(COMMON)/ip_rcm.c \ 577c478bd9Sstevel@tonic-gate $(COMMON)/cluster_rcm.c \ 587c478bd9Sstevel@tonic-gate $(COMMON)/pool_rcm.c \ 597c478bd9Sstevel@tonic-gate $(COMMON)/mpxio_rcm.c \ 607c478bd9Sstevel@tonic-gate $(COMMON)/ip_anon_rcm.c \ 614eaa4710SRishi Srivatsavai $(COMMON)/bridge_rcm.c 627c478bd9Sstevel@tonic-gate 637c478bd9Sstevel@tonic-gatesparc_MOD_SRC = $(COMMON)/ttymux_rcm.c 647c478bd9Sstevel@tonic-gate 65045b72beSjm22469COMMON_PERL_SCRIPT_SRC = 66045b72beSjm22469 67045b72beSjm22469sparc_PERL_SCRIPT_SRC = SUNW,vdevices.pl 68045b72beSjm22469 69c0dd49bdSEiji OtaCOMMON_SHELL_SCRIPT_SRC = SUNW,ibsdpu.sh \ 70c0dd49bdSEiji Ota SUNW,rdsv3u.sh 7151f34d4bSRajkumar Sivaprakasam 727c478bd9Sstevel@tonic-gateCOMMON_MOD_OBJ = \ 737c478bd9Sstevel@tonic-gate filesys_rcm.o \ 747c478bd9Sstevel@tonic-gate dump_rcm.o \ 757c478bd9Sstevel@tonic-gate swap_rcm.o \ 767c478bd9Sstevel@tonic-gate network_rcm.o \ 77d62bc4baSyz147064 vlan_rcm.o \ 78da14cebeSEric Cheng vnic_rcm.o \ 791cfa752fSRamaswamy Tummala ibpart_rcm.o \ 80d62bc4baSyz147064 aggr_rcm.o \ 817c478bd9Sstevel@tonic-gate ip_rcm.o \ 827c478bd9Sstevel@tonic-gate cluster_rcm.o \ 837c478bd9Sstevel@tonic-gate pool_rcm.o \ 847c478bd9Sstevel@tonic-gate mpxio_rcm.o \ 857c478bd9Sstevel@tonic-gate ip_anon_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_bridge_rcm.so 1077c478bd9Sstevel@tonic-gate 1087c478bd9Sstevel@tonic-gatesparc_RCM_MODS = SUNW_ttymux_rcm.so 1097c478bd9Sstevel@tonic-gate 1107c478bd9Sstevel@tonic-gateRCM_DIR = rcm 1117c478bd9Sstevel@tonic-gateMOD_DIR = modules 1127c478bd9Sstevel@tonic-gateSCRIPT_DIR = scripts 1137c478bd9Sstevel@tonic-gate 114b6805bf7SGordon RossCLOBBERFILES += $(COMMON_RCM_MODS) $($(MACH)_RCM_MODS) $(RCM_DAEMON) 1157c478bd9Sstevel@tonic-gate 1167c478bd9Sstevel@tonic-gateLINT_MODULES = $(COMMON_MOD_SRC:.c=.ln) $($(MACH)_MOD_SRC:.c=.ln) 1177c478bd9Sstevel@tonic-gate 1180406ceaaSmeemCPPFLAGS += -I.. 1197c478bd9Sstevel@tonic-gateCPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT 1207c478bd9Sstevel@tonic-gateCFLAGS += $(CCVERBOSE) $(C_PICFLAGS) 1217c478bd9Sstevel@tonic-gate 1227014882cSRichard LoweCERRWARN += -_gcc=-Wno-parentheses 1237014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-label 1247014882cSRichard LoweCERRWARN += -_gcc=-Wno-uninitialized 1257014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-function 1267014882cSRichard Lowe 12724da5b34SrieMAPFILES = ../common/mapfile-intf $(MAPFILE.NGB) 12824da5b34Sriercm_daemon := LDFLAGS += $(MAPFILES:%=-M%) 12924da5b34Srie 1307c478bd9Sstevel@tonic-gateLINTFLAGS += -u -erroff=E_FUNC_ARG_UNUSED 1317c478bd9Sstevel@tonic-gate 1327c478bd9Sstevel@tonic-gateLDLIBS_MODULES = 1337c478bd9Sstevel@tonic-gateSUNW_pool_rcm.so := LDLIBS_MODULES += -L$(ROOT)/usr/lib -lpool 134f595a68aSyz147064SUNW_network_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm 135d62bc4baSyz147064SUNW_vlan_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm 136da14cebeSEric ChengSUNW_vnic_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm 1371cfa752fSRamaswamy TummalaSUNW_ibpart_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm 138d62bc4baSyz147064SUNW_aggr_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm 1396e91bba0SGirish MoodalbailSUNW_ip_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -linetutil -ldladm -lipmp -lipadm 1400406ceaaSmeemSUNW_ip_anon_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -linetutil 1414eaa4710SRishi SrivatsavaiSUNW_bridge_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm 1427c478bd9Sstevel@tonic-gate 14306e1a714SrafLDLIBS += -lgen -lelf -lrcm -lnvpair -ldevinfo -lnsl -lsocket 1447c478bd9Sstevel@tonic-gate 1457c478bd9Sstevel@tonic-gateSRCS = $(RCM_SRC) $(COMMON_MOD_SRC) 1467c478bd9Sstevel@tonic-gate 1477c478bd9Sstevel@tonic-gatePOFILES = $(SRCS:.c=.po) 1487c478bd9Sstevel@tonic-gatePOFILE = prcm_daemon.po 1497c478bd9Sstevel@tonic-gate 150045b72beSjm22469PERL_SCRIPTS = $(COMMON_PERL_SRC) $($(MACH)_PERL_SCRIPT_SRC) 15151f34d4bSRajkumar SivaprakasamSHELL_SCRIPTS = $(COMMON_SHELL_SCRIPT_SRC) 15251f34d4bSRajkumar SivaprakasamRCM_SCRIPTS = $(PERL_SCRIPTS) $(SHELL_SCRIPTS) 153045b72beSjm22469 1547c478bd9Sstevel@tonic-gate# install specifics 1557c478bd9Sstevel@tonic-gate 1567c478bd9Sstevel@tonic-gateROOTLIB_RCM = $(ROOTLIB)/$(RCM_DIR) 1577c478bd9Sstevel@tonic-gateROOTLIB_RCM_MOD = $(ROOTLIB_RCM)/$(MOD_DIR) 1587c478bd9Sstevel@tonic-gateROOTLIB_RCM_DAEMON = $(RCM_DAEMON:%=$(ROOTLIB_RCM)/%) 1597c478bd9Sstevel@tonic-gateROOTLIB_RCM_MODULES = $(COMMON_RCM_MODS:%=$(ROOTLIB_RCM_MOD)/%) \ 1607c478bd9Sstevel@tonic-gate $($(MACH)_RCM_MODS:%=$(ROOTLIB_RCM_MOD)/%) 1617c478bd9Sstevel@tonic-gateROOTLIB_RCM_SCRIPT = $(ROOTLIB_RCM)/$(SCRIPT_DIR) 162045b72beSjm22469ROOTLIB_RCM_SCRIPTS = $(RCM_SCRIPTS:%=$(ROOTLIB_RCM_SCRIPT)/%) 1637c478bd9Sstevel@tonic-gateROOTETC_RCM = $(ROOTETC)/$(RCM_DIR) 1647c478bd9Sstevel@tonic-gateROOTETC_RCM_SCRIPT = $(ROOTETC_RCM)/$(SCRIPT_DIR) 1657c478bd9Sstevel@tonic-gate 1667c478bd9Sstevel@tonic-gateall := TARGET= all 1677c478bd9Sstevel@tonic-gateinstall := TARGET= install 1687c478bd9Sstevel@tonic-gateclean := TARGET= clean 1697c478bd9Sstevel@tonic-gateclobber := TARGET= clobber 1707c478bd9Sstevel@tonic-gatelint := TARGET= lint 1717c478bd9Sstevel@tonic-gate 172045b72beSjm22469$(ROOTLIB_RCM_SCRIPTS) := FILEMODE = 555 1737c478bd9Sstevel@tonic-gate 1747c478bd9Sstevel@tonic-gate.KEEP_STATE: 1757c478bd9Sstevel@tonic-gate 1767c478bd9Sstevel@tonic-gateall: $(RCM_DAEMON) $(COMMON_RCM_MODS) $($(MACH)_RCM_MODS) 1777c478bd9Sstevel@tonic-gate 1787c478bd9Sstevel@tonic-gateinstall: all \ 1797c478bd9Sstevel@tonic-gate $(ROOTLIB_RCM) \ 1807c478bd9Sstevel@tonic-gate $(ROOTLIB_RCM_DAEMON) \ 1817c478bd9Sstevel@tonic-gate $(ROOTLIB_RCM_MOD) \ 1827c478bd9Sstevel@tonic-gate $(ROOTLIB_RCM_MODULES) \ 1837c478bd9Sstevel@tonic-gate $(ROOTLIB_RCM_SCRIPT) \ 1847c478bd9Sstevel@tonic-gate $(ROOTETC_RCM) \ 185045b72beSjm22469 $(ROOTETC_RCM_SCRIPT) \ 186045b72beSjm22469 $(ROOTLIB_RCM_SCRIPTS) 1877c478bd9Sstevel@tonic-gate 1887c478bd9Sstevel@tonic-gateclean: 1897c478bd9Sstevel@tonic-gate $(RM) $(RCM_OBJ) $(COMMON_MOD_OBJ) $($(MACH)_MOD_OBJ) $(POFILES) 1907c478bd9Sstevel@tonic-gate 1917c478bd9Sstevel@tonic-gatelint: $(RCM_DAEMON).ln $(LINT_MODULES) 1927c478bd9Sstevel@tonic-gate 1937c478bd9Sstevel@tonic-gate$(RCM_DAEMON).ln: FRC 1947c478bd9Sstevel@tonic-gate $(LINT.c) $(RCM_SRC) $(LDLIBS) 1957c478bd9Sstevel@tonic-gate 1967c478bd9Sstevel@tonic-gate%.ln: FRC 1977c478bd9Sstevel@tonic-gate $(LINT.c) $(RCM_SRC) $(@:.ln=.c) $(LDLIBS) 1987c478bd9Sstevel@tonic-gate 1997c478bd9Sstevel@tonic-gateFRC: 2007c478bd9Sstevel@tonic-gate 2017c478bd9Sstevel@tonic-gateinclude ../../Makefile.targ 2027c478bd9Sstevel@tonic-gate 2037c478bd9Sstevel@tonic-gate$(POFILE): $(POFILES) 2047c478bd9Sstevel@tonic-gate $(RM) $@; cat $(POFILES) > $@ 2057c478bd9Sstevel@tonic-gate 20624da5b34Srie$(RCM_DAEMON): $(RCM_OBJ) $(MAPFILES) 2077c478bd9Sstevel@tonic-gate $(LINK.c) -o $@ $< $(RCM_OBJ) $(LDLIBS) 2087c478bd9Sstevel@tonic-gate $(POST_PROCESS) 2097c478bd9Sstevel@tonic-gate 2107c478bd9Sstevel@tonic-gateSUNW_%.so: %.o 2117c478bd9Sstevel@tonic-gate $(LINK.c) -o $@ $(GSHARED) -h $@ $< $(LDLIBS_MODULES) 2127c478bd9Sstevel@tonic-gate 2137c478bd9Sstevel@tonic-gate%.o: $(COMMON)/%.c 2147c478bd9Sstevel@tonic-gate $(COMPILE.c) -o $@ $< 2157c478bd9Sstevel@tonic-gate 2167c478bd9Sstevel@tonic-gate$(ROOTLIB_RCM): 2177c478bd9Sstevel@tonic-gate $(INS.dir) 2187c478bd9Sstevel@tonic-gate 2197c478bd9Sstevel@tonic-gate$(ROOTLIB_RCM)/%: % 2207c478bd9Sstevel@tonic-gate $(INS.file) 2217c478bd9Sstevel@tonic-gate 2227c478bd9Sstevel@tonic-gate$(ROOTLIB_RCM_MOD): 2237c478bd9Sstevel@tonic-gate $(INS.dir) 2247c478bd9Sstevel@tonic-gate 2257c478bd9Sstevel@tonic-gate$(ROOTLIB_RCM_MOD)/%: % 2267c478bd9Sstevel@tonic-gate $(INS.file) 2277c478bd9Sstevel@tonic-gate 2287c478bd9Sstevel@tonic-gate$(ROOTLIB_RCM_SCRIPT): 2297c478bd9Sstevel@tonic-gate $(INS.dir) 2307c478bd9Sstevel@tonic-gate 2317c478bd9Sstevel@tonic-gate$(ROOTETC_RCM): 2327c478bd9Sstevel@tonic-gate $(INS.dir) 2337c478bd9Sstevel@tonic-gate 2347c478bd9Sstevel@tonic-gate$(ROOTETC_RCM_SCRIPT): 2357c478bd9Sstevel@tonic-gate $(INS.dir) 236045b72beSjm22469 237045b72beSjm22469$(ROOTLIB_RCM_SCRIPT)/%: $(COMMON)/% 238045b72beSjm22469 $(INS.file) 239