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.
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.
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]
23 # Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
24 # Copyright 2016 Nexenta Systems, Inc.
27 include ../../Makefile.cmd
32 $(COMMON)/rcm_event.c \
33 $(COMMON)/rcm_main.c \
34 $(COMMON)/rcm_impl.c \
35 $(COMMON)/rcm_subr.c \
36 $(COMMON)/rcm_lock.c \
37 $(COMMON)/rcm_script.c
48 $(COMMON)/filesys_rcm.c \
49 $(COMMON)/dump_rcm.c \
50 $(COMMON)/swap_rcm.c \
51 $(COMMON)/network_rcm.c \
52 $(COMMON)/vlan_rcm.c \
53 $(COMMON)/vnic_rcm.c \
54 $(COMMON)/ibpart_rcm.c \
55 $(COMMON)/aggr_rcm.c \
57 $(COMMON)/cluster_rcm.c \
58 $(COMMON)/pool_rcm.c \
59 $(COMMON)/mpxio_rcm.c \
60 $(COMMON)/ip_anon_rcm.c \
61 $(COMMON)/bridge_rcm.c
63 sparc_MOD_SRC = $(COMMON)/ttymux_rcm.c
65 COMMON_PERL_SCRIPT_SRC =
67 sparc_PERL_SCRIPT_SRC = SUNW,vdevices.pl
69 COMMON_SHELL_SCRIPT_SRC = SUNW,ibsdpu.sh \
88 sparc_MOD_OBJ = ttymux_rcm.o
90 RCM_DAEMON = rcm_daemon
102 SUNW_cluster_rcm.so \
105 SUNW_ip_anon_rcm.so \
108 sparc_RCM_MODS = SUNW_ttymux_rcm.so
114 CLOBBERFILES += $(COMMON_RCM_MODS) $($(MACH)_RCM_MODS) $(RCM_DAEMON)
116 LINT_MODULES = $(COMMON_MOD_SRC:.c=.ln) $($(MACH)_MOD_SRC:.c=.ln)
119 CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
120 CFLAGS += $(CCVERBOSE) $(C_PICFLAGS)
122 CERRWARN += -_gcc=-Wno-parentheses
123 CERRWARN += -_gcc=-Wno-unused-label
124 CERRWARN += -_gcc=-Wno-uninitialized
125 CERRWARN += -_gcc=-Wno-unused-function
127 MAPFILES = ../common/mapfile-intf $(MAPFILE.NGB)
128 rcm_daemon := LDFLAGS += $(MAPFILES:%=-M%)
130 LINTFLAGS += -u -erroff=E_FUNC_ARG_UNUSED
133 SUNW_pool_rcm.so := LDLIBS_MODULES += -L$(ROOT)/usr/lib -lpool
134 SUNW_network_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm
135 SUNW_vlan_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm
136 SUNW_vnic_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm
137 SUNW_ibpart_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm
138 SUNW_aggr_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm
139 SUNW_ip_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -linetutil -ldladm -lipmp -lipadm
140 SUNW_ip_anon_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -linetutil
141 SUNW_bridge_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm
143 LDLIBS += -lgen -lelf -lrcm -lnvpair -ldevinfo -lnsl -lsocket
145 SRCS = $(RCM_SRC) $(COMMON_MOD_SRC)
147 POFILES = $(SRCS:.c=.po)
148 POFILE = prcm_daemon.po
150 PERL_SCRIPTS = $(COMMON_PERL_SRC) $($(MACH)_PERL_SCRIPT_SRC)
151 SHELL_SCRIPTS = $(COMMON_SHELL_SCRIPT_SRC)
152 RCM_SCRIPTS = $(PERL_SCRIPTS) $(SHELL_SCRIPTS)
156 ROOTLIB_RCM = $(ROOTLIB)/$(RCM_DIR)
157 ROOTLIB_RCM_MOD = $(ROOTLIB_RCM)/$(MOD_DIR)
158 ROOTLIB_RCM_DAEMON = $(RCM_DAEMON:%=$(ROOTLIB_RCM)/%)
159 ROOTLIB_RCM_MODULES = $(COMMON_RCM_MODS:%=$(ROOTLIB_RCM_MOD)/%) \
160 $($(MACH)_RCM_MODS:%=$(ROOTLIB_RCM_MOD)/%)
161 ROOTLIB_RCM_SCRIPT = $(ROOTLIB_RCM)/$(SCRIPT_DIR)
162 ROOTLIB_RCM_SCRIPTS = $(RCM_SCRIPTS:%=$(ROOTLIB_RCM_SCRIPT)/%)
163 ROOTETC_RCM = $(ROOTETC)/$(RCM_DIR)
164 ROOTETC_RCM_SCRIPT = $(ROOTETC_RCM)/$(SCRIPT_DIR)
167 install := TARGET= install
168 clean := TARGET= clean
169 clobber := TARGET= clobber
172 $(ROOTLIB_RCM_SCRIPTS) := FILEMODE = 555
176 all: $(RCM_DAEMON) $(COMMON_RCM_MODS) $($(MACH)_RCM_MODS)
180 $(ROOTLIB_RCM_DAEMON) \
182 $(ROOTLIB_RCM_MODULES) \
183 $(ROOTLIB_RCM_SCRIPT) \
185 $(ROOTETC_RCM_SCRIPT) \
186 $(ROOTLIB_RCM_SCRIPTS)
189 $(RM) $(RCM_OBJ) $(COMMON_MOD_OBJ) $($(MACH)_MOD_OBJ) $(POFILES)
191 lint: $(RCM_DAEMON).ln $(LINT_MODULES)
193 $(RCM_DAEMON).ln: FRC
194 $(LINT.c) $(RCM_SRC) $(LDLIBS)
197 $(LINT.c) $(RCM_SRC) $(@:.ln=.c) $(LDLIBS)
201 include ../../Makefile.targ
203 $(POFILE): $(POFILES)
204 $(RM) $@; cat $(POFILES) > $@
206 $(RCM_DAEMON): $(RCM_OBJ) $(MAPFILES)
207 $(LINK.c) -o $@ $< $(RCM_OBJ) $(LDLIBS)
211 $(LINK.c) -o $@ $(GSHARED) -h $@ $< $(LDLIBS_MODULES)
214 $(COMPILE.c) -o $@ $<
225 $(ROOTLIB_RCM_MOD)/%: %
228 $(ROOTLIB_RCM_SCRIPT):
234 $(ROOTETC_RCM_SCRIPT):
237 $(ROOTLIB_RCM_SCRIPT)/%: $(COMMON)/%