xref: /titanic_51/usr/src/cmd/rcm_daemon/Makefile.com (revision a776e90690d98f629ab57f6493ff5949af9d65bd)
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_MOD_OBJ = \
65	filesys_rcm.o \
66	dump_rcm.o \
67	swap_rcm.o \
68	network_rcm.o \
69	vlan_rcm.o \
70	aggr_rcm.o \
71	ip_rcm.o \
72	cluster_rcm.o \
73	pool_rcm.o \
74	mpxio_rcm.o \
75	ip_anon_rcm.o \
76	svm_rcm.o
77
78sparc_MOD_OBJ = ttymux_rcm.o
79
80RCM_DAEMON = rcm_daemon
81
82COMMON_RCM_MODS = \
83	SUNW_filesys_rcm.so \
84	SUNW_dump_rcm.so \
85	SUNW_swap_rcm.so \
86	SUNW_network_rcm.so \
87	SUNW_vlan_rcm.so \
88	SUNW_aggr_rcm.so \
89	SUNW_ip_rcm.so \
90	SUNW_cluster_rcm.so \
91	SUNW_pool_rcm.so \
92	SUNW_mpxio_rcm.so \
93	SUNW_ip_anon_rcm.so \
94	SUNW_svm_rcm.so
95
96sparc_RCM_MODS = SUNW_ttymux_rcm.so
97
98RCM_DIR = rcm
99MOD_DIR = modules
100SCRIPT_DIR = scripts
101
102CLOBBERFILES = $(COMMON_RCM_MODS) $($(MACH)_RCM_MODS) $(RCM_DAEMON)
103
104LINT_MODULES = $(COMMON_MOD_SRC:.c=.ln) $($(MACH)_MOD_SRC:.c=.ln)
105
106CPPFLAGS += -I..
107CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
108CFLAGS += $(CCVERBOSE) $(C_PICFLAGS)
109
110MAPFILES = ../common/mapfile-intf $(MAPFILE.NGB)
111rcm_daemon := LDFLAGS += $(MAPFILES:%=-M%)
112
113LINTFLAGS += -u -erroff=E_FUNC_ARG_UNUSED
114
115LDLIBS_MODULES =
116SUNW_pool_rcm.so := LDLIBS_MODULES += -L$(ROOT)/usr/lib -lpool
117SUNW_svm_rcm.so	:= LDLIBS_MODULES += -L$(ROOT)/usr/lib -lmeta
118SUNW_network_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm
119SUNW_vlan_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm
120SUNW_aggr_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm
121SUNW_ip_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -linetutil -ldladm
122SUNW_ip_anon_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -linetutil
123
124LDLIBS += -lgen -lelf -lrcm -lnvpair -ldevinfo -lnsl -lsocket
125
126SRCS = $(RCM_SRC) $(COMMON_MOD_SRC)
127
128POFILES = $(SRCS:.c=.po)
129POFILE = prcm_daemon.po
130
131# install specifics
132
133ROOTLIB_RCM = $(ROOTLIB)/$(RCM_DIR)
134ROOTLIB_RCM_MOD = $(ROOTLIB_RCM)/$(MOD_DIR)
135ROOTLIB_RCM_DAEMON = $(RCM_DAEMON:%=$(ROOTLIB_RCM)/%)
136ROOTLIB_RCM_MODULES = $(COMMON_RCM_MODS:%=$(ROOTLIB_RCM_MOD)/%) \
137			$($(MACH)_RCM_MODS:%=$(ROOTLIB_RCM_MOD)/%)
138ROOTLIB_RCM_SCRIPT = $(ROOTLIB_RCM)/$(SCRIPT_DIR)
139ROOTETC_RCM = $(ROOTETC)/$(RCM_DIR)
140ROOTETC_RCM_SCRIPT = $(ROOTETC_RCM)/$(SCRIPT_DIR)
141
142all :=		TARGET= all
143install :=	TARGET= install
144clean :=	TARGET= clean
145clobber :=	TARGET= clobber
146lint :=		TARGET= lint
147
148$(ROOTETC_RCM) :=		GROUP = sys
149$(ROOTETC_RCM_SCRIPT) :=	GROUP = sys
150
151.KEEP_STATE:
152
153all: $(RCM_DAEMON) $(COMMON_RCM_MODS) $($(MACH)_RCM_MODS)
154
155install: all			\
156	$(ROOTLIB_RCM)		\
157	$(ROOTLIB_RCM_DAEMON)	\
158	$(ROOTLIB_RCM_MOD)	\
159	$(ROOTLIB_RCM_MODULES)	\
160	$(ROOTLIB_RCM_SCRIPT)	\
161	$(ROOTETC_RCM)		\
162	$(ROOTETC_RCM_SCRIPT)
163
164clean:
165	$(RM) $(RCM_OBJ) $(COMMON_MOD_OBJ) $($(MACH)_MOD_OBJ) $(POFILES)
166
167lint: $(RCM_DAEMON).ln $(LINT_MODULES)
168
169$(RCM_DAEMON).ln: FRC
170	$(LINT.c) $(RCM_SRC) $(LDLIBS)
171
172%.ln: FRC
173	$(LINT.c) $(RCM_SRC) $(@:.ln=.c) $(LDLIBS)
174
175FRC:
176
177include ../../Makefile.targ
178
179$(POFILE):      $(POFILES)
180	$(RM) $@; cat $(POFILES) > $@
181
182$(RCM_DAEMON): $(RCM_OBJ) $(MAPFILES)
183	$(LINK.c) -o $@ $< $(RCM_OBJ) $(LDLIBS)
184	$(POST_PROCESS)
185
186SUNW_%.so: %.o
187	$(LINK.c) -o $@ $(GSHARED) -h $@ $< $(LDLIBS_MODULES)
188
189%.o: $(COMMON)/%.c
190	$(COMPILE.c) -o $@ $<
191
192$(ROOTLIB_RCM):
193	$(INS.dir)
194
195$(ROOTLIB_RCM)/%: %
196	$(INS.file)
197
198$(ROOTLIB_RCM_MOD):
199	$(INS.dir)
200
201$(ROOTLIB_RCM_MOD)/%: %
202	$(INS.file)
203
204$(ROOTLIB_RCM_SCRIPT):
205	$(INS.dir)
206
207$(ROOTETC_RCM):
208	$(INS.dir)
209
210$(ROOTETC_RCM_SCRIPT):
211	$(INS.dir)
212