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