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 (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 23# 24 25include ../../Makefile.cmd 26 27COMMON = ../common 28 29RCM_SRC = \ 30 $(COMMON)/rcm_event.c \ 31 $(COMMON)/rcm_main.c \ 32 $(COMMON)/rcm_impl.c \ 33 $(COMMON)/rcm_subr.c \ 34 $(COMMON)/rcm_lock.c \ 35 $(COMMON)/rcm_script.c 36 37RCM_OBJ = \ 38 rcm_event.o \ 39 rcm_main.o \ 40 rcm_impl.o \ 41 rcm_subr.o \ 42 rcm_lock.o \ 43 rcm_script.o 44 45COMMON_MOD_SRC = \ 46 $(COMMON)/filesys_rcm.c \ 47 $(COMMON)/dump_rcm.c \ 48 $(COMMON)/swap_rcm.c \ 49 $(COMMON)/network_rcm.c \ 50 $(COMMON)/vlan_rcm.c \ 51 $(COMMON)/vnic_rcm.c \ 52 $(COMMON)/ibpart_rcm.c \ 53 $(COMMON)/aggr_rcm.c \ 54 $(COMMON)/ip_rcm.c \ 55 $(COMMON)/cluster_rcm.c \ 56 $(COMMON)/pool_rcm.c \ 57 $(COMMON)/mpxio_rcm.c \ 58 $(COMMON)/ip_anon_rcm.c \ 59 $(COMMON)/svm_rcm.c \ 60 $(COMMON)/bridge_rcm.c 61 62sparc_MOD_SRC = $(COMMON)/ttymux_rcm.c 63 64COMMON_PERL_SCRIPT_SRC = 65 66sparc_PERL_SCRIPT_SRC = SUNW,vdevices.pl 67 68COMMON_SHELL_SCRIPT_SRC = SUNW,ibsdpu.sh 69 70COMMON_MOD_OBJ = \ 71 filesys_rcm.o \ 72 dump_rcm.o \ 73 swap_rcm.o \ 74 network_rcm.o \ 75 vlan_rcm.o \ 76 vnic_rcm.o \ 77 ibpart_rcm.o \ 78 aggr_rcm.o \ 79 ip_rcm.o \ 80 cluster_rcm.o \ 81 pool_rcm.o \ 82 mpxio_rcm.o \ 83 ip_anon_rcm.o \ 84 svm_rcm.o \ 85 bridge_rcm.o 86 87sparc_MOD_OBJ = ttymux_rcm.o 88 89RCM_DAEMON = rcm_daemon 90 91COMMON_RCM_MODS = \ 92 SUNW_filesys_rcm.so \ 93 SUNW_dump_rcm.so \ 94 SUNW_swap_rcm.so \ 95 SUNW_network_rcm.so \ 96 SUNW_vlan_rcm.so \ 97 SUNW_vnic_rcm.so \ 98 SUNW_ibpart_rcm.so \ 99 SUNW_aggr_rcm.so \ 100 SUNW_ip_rcm.so \ 101 SUNW_cluster_rcm.so \ 102 SUNW_pool_rcm.so \ 103 SUNW_mpxio_rcm.so \ 104 SUNW_ip_anon_rcm.so \ 105 SUNW_svm_rcm.so \ 106 SUNW_bridge_rcm.so 107 108sparc_RCM_MODS = SUNW_ttymux_rcm.so 109 110RCM_DIR = rcm 111MOD_DIR = modules 112SCRIPT_DIR = scripts 113 114CLOBBERFILES = $(COMMON_RCM_MODS) $($(MACH)_RCM_MODS) $(RCM_DAEMON) 115 116LINT_MODULES = $(COMMON_MOD_SRC:.c=.ln) $($(MACH)_MOD_SRC:.c=.ln) 117 118CPPFLAGS += -I.. 119CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT 120CFLAGS += $(CCVERBOSE) $(C_PICFLAGS) 121 122MAPFILES = ../common/mapfile-intf $(MAPFILE.NGB) 123rcm_daemon := LDFLAGS += $(MAPFILES:%=-M%) 124 125LINTFLAGS += -u -erroff=E_FUNC_ARG_UNUSED 126 127LDLIBS_MODULES = 128SUNW_pool_rcm.so := LDLIBS_MODULES += -L$(ROOT)/usr/lib -lpool 129SUNW_svm_rcm.so := LDLIBS_MODULES += -L$(ROOT)/usr/lib -lmeta 130SUNW_network_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm 131SUNW_vlan_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm 132SUNW_vnic_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm 133SUNW_ibpart_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm 134SUNW_aggr_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm 135SUNW_ip_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -linetutil -ldladm -lipmp -lipadm 136SUNW_ip_anon_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -linetutil 137SUNW_bridge_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm 138 139LDLIBS += -lgen -lelf -lrcm -lnvpair -ldevinfo -lnsl -lsocket 140 141SRCS = $(RCM_SRC) $(COMMON_MOD_SRC) 142 143POFILES = $(SRCS:.c=.po) 144POFILE = prcm_daemon.po 145 146PERL_SCRIPTS = $(COMMON_PERL_SRC) $($(MACH)_PERL_SCRIPT_SRC) 147SHELL_SCRIPTS = $(COMMON_SHELL_SCRIPT_SRC) 148RCM_SCRIPTS = $(PERL_SCRIPTS) $(SHELL_SCRIPTS) 149 150# install specifics 151 152ROOTLIB_RCM = $(ROOTLIB)/$(RCM_DIR) 153ROOTLIB_RCM_MOD = $(ROOTLIB_RCM)/$(MOD_DIR) 154ROOTLIB_RCM_DAEMON = $(RCM_DAEMON:%=$(ROOTLIB_RCM)/%) 155ROOTLIB_RCM_MODULES = $(COMMON_RCM_MODS:%=$(ROOTLIB_RCM_MOD)/%) \ 156 $($(MACH)_RCM_MODS:%=$(ROOTLIB_RCM_MOD)/%) 157ROOTLIB_RCM_SCRIPT = $(ROOTLIB_RCM)/$(SCRIPT_DIR) 158ROOTLIB_RCM_SCRIPTS = $(RCM_SCRIPTS:%=$(ROOTLIB_RCM_SCRIPT)/%) 159ROOTETC_RCM = $(ROOTETC)/$(RCM_DIR) 160ROOTETC_RCM_SCRIPT = $(ROOTETC_RCM)/$(SCRIPT_DIR) 161 162all := TARGET= all 163install := TARGET= install 164clean := TARGET= clean 165clobber := TARGET= clobber 166lint := TARGET= lint 167 168$(ROOTLIB_RCM_SCRIPTS) := FILEMODE = 555 169 170.KEEP_STATE: 171 172all: $(RCM_DAEMON) $(COMMON_RCM_MODS) $($(MACH)_RCM_MODS) 173 174install: all \ 175 $(ROOTLIB_RCM) \ 176 $(ROOTLIB_RCM_DAEMON) \ 177 $(ROOTLIB_RCM_MOD) \ 178 $(ROOTLIB_RCM_MODULES) \ 179 $(ROOTLIB_RCM_SCRIPT) \ 180 $(ROOTETC_RCM) \ 181 $(ROOTETC_RCM_SCRIPT) \ 182 $(ROOTLIB_RCM_SCRIPTS) 183 184clean: 185 $(RM) $(RCM_OBJ) $(COMMON_MOD_OBJ) $($(MACH)_MOD_OBJ) $(POFILES) 186 187lint: $(RCM_DAEMON).ln $(LINT_MODULES) 188 189$(RCM_DAEMON).ln: FRC 190 $(LINT.c) $(RCM_SRC) $(LDLIBS) 191 192%.ln: FRC 193 $(LINT.c) $(RCM_SRC) $(@:.ln=.c) $(LDLIBS) 194 195FRC: 196 197include ../../Makefile.targ 198 199$(POFILE): $(POFILES) 200 $(RM) $@; cat $(POFILES) > $@ 201 202$(RCM_DAEMON): $(RCM_OBJ) $(MAPFILES) 203 $(LINK.c) -o $@ $< $(RCM_OBJ) $(LDLIBS) 204 $(POST_PROCESS) 205 206SUNW_%.so: %.o 207 $(LINK.c) -o $@ $(GSHARED) -h $@ $< $(LDLIBS_MODULES) 208 209%.o: $(COMMON)/%.c 210 $(COMPILE.c) -o $@ $< 211 212$(ROOTLIB_RCM): 213 $(INS.dir) 214 215$(ROOTLIB_RCM)/%: % 216 $(INS.file) 217 218$(ROOTLIB_RCM_MOD): 219 $(INS.dir) 220 221$(ROOTLIB_RCM_MOD)/%: % 222 $(INS.file) 223 224$(ROOTLIB_RCM_SCRIPT): 225 $(INS.dir) 226 227$(ROOTETC_RCM): 228 $(INS.dir) 229 230$(ROOTETC_RCM_SCRIPT): 231 $(INS.dir) 232 233$(ROOTLIB_RCM_SCRIPT)/%: $(COMMON)/% 234 $(INS.file) 235