xref: /titanic_44/usr/src/cmd/rcm_daemon/Makefile.com (revision 8eea8e29cc4374d1ee24c25a07f45af132db3499)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28
29include ../../Makefile.cmd
30
31COMMON = ../common
32CMDINETCOMMON = $(SRC)/cmd/cmd-inet/common
33
34RCM_SRC = \
35	$(COMMON)/rcm_event.c \
36	$(COMMON)/rcm_main.c \
37	$(COMMON)/rcm_impl.c \
38	$(COMMON)/rcm_subr.c \
39	$(COMMON)/rcm_lock.c \
40	$(COMMON)/rcm_script.c
41
42RCM_OBJ = \
43	rcm_event.o \
44	rcm_main.o \
45	rcm_impl.o \
46	rcm_subr.o \
47	rcm_lock.o \
48	rcm_script.o
49
50COMMON_MOD_SRC = \
51	$(COMMON)/filesys_rcm.c \
52	$(COMMON)/dump_rcm.c \
53	$(COMMON)/swap_rcm.c \
54	$(COMMON)/network_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	$(COMMON)/mac_rcm.c
62
63sparc_MOD_SRC = $(COMMON)/ttymux_rcm.c
64
65COMMON_MOD_OBJ = \
66	filesys_rcm.o \
67	dump_rcm.o \
68	swap_rcm.o \
69	network_rcm.o \
70	ip_rcm.o \
71	cluster_rcm.o \
72	pool_rcm.o \
73	mpxio_rcm.o \
74	ip_anon_rcm.o \
75	svm_rcm.o \
76	mac_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_ip_rcm.so \
88	SUNW_cluster_rcm.so \
89	SUNW_pool_rcm.so \
90	SUNW_mpxio_rcm.so \
91	SUNW_ip_anon_rcm.so \
92	SUNW_svm_rcm.so \
93	SUNW_mac_rcm.so
94
95sparc_RCM_MODS = SUNW_ttymux_rcm.so
96
97RCM_DIR = rcm
98MOD_DIR = modules
99SCRIPT_DIR = scripts
100
101CLOBBERFILES = $(COMMON_RCM_MODS) $($(MACH)_RCM_MODS) $(RCM_DAEMON)
102
103LINT_MODULES = $(COMMON_MOD_SRC:.c=.ln) $($(MACH)_MOD_SRC:.c=.ln)
104
105CPPFLAGS += -I.. -I $(CMDINETCOMMON)
106CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
107CFLAGS += $(CCVERBOSE) $(C_PICFLAGS)
108
109LINTFLAGS += -u -erroff=E_FUNC_ARG_UNUSED
110
111LDLIBS_MODULES =
112SUNW_pool_rcm.so := LDLIBS_MODULES += -L$(ROOT)/usr/lib -lpool
113SUNW_svm_rcm.so	:= LDLIBS_MODULES += -L$(ROOT)/usr/lib -lmeta
114SUNW_mac_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm -llaadm
115SUNW_ip_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm -ldlpi
116SUNW_network_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldlpi
117
118LDLIBS += -lgen -lelf -lcmd -lrcm -lnvpair -ldevinfo -lnsl -lsocket -lrt
119
120SRCS = $(RCM_SRC) $(COMMON_MOD_SRC)
121
122POFILES = $(SRCS:.c=.po)
123POFILE = prcm_daemon.po
124
125# install specifics
126
127ROOTLIB_RCM = $(ROOTLIB)/$(RCM_DIR)
128ROOTLIB_RCM_MOD = $(ROOTLIB_RCM)/$(MOD_DIR)
129ROOTLIB_RCM_DAEMON = $(RCM_DAEMON:%=$(ROOTLIB_RCM)/%)
130ROOTLIB_RCM_MODULES = $(COMMON_RCM_MODS:%=$(ROOTLIB_RCM_MOD)/%) \
131			$($(MACH)_RCM_MODS:%=$(ROOTLIB_RCM_MOD)/%)
132ROOTLIB_RCM_SCRIPT = $(ROOTLIB_RCM)/$(SCRIPT_DIR)
133ROOTETC_RCM = $(ROOTETC)/$(RCM_DIR)
134ROOTETC_RCM_SCRIPT = $(ROOTETC_RCM)/$(SCRIPT_DIR)
135
136all :=		TARGET= all
137install :=	TARGET= install
138clean :=	TARGET= clean
139clobber :=	TARGET= clobber
140lint :=		TARGET= lint
141
142$(ROOTETC_RCM) :=		GROUP = sys
143$(ROOTETC_RCM_SCRIPT) :=	GROUP = sys
144
145.KEEP_STATE:
146
147all: $(RCM_DAEMON) $(COMMON_RCM_MODS) $($(MACH)_RCM_MODS)
148
149install: all			\
150	$(ROOTLIB_RCM)		\
151	$(ROOTLIB_RCM_DAEMON)	\
152	$(ROOTLIB_RCM_MOD)	\
153	$(ROOTLIB_RCM_MODULES)	\
154	$(ROOTLIB_RCM_SCRIPT)	\
155	$(ROOTETC_RCM)		\
156	$(ROOTETC_RCM_SCRIPT)
157
158clean:
159	$(RM) $(RCM_OBJ) $(COMMON_MOD_OBJ) $($(MACH)_MOD_OBJ) $(POFILES)
160
161lint: $(RCM_DAEMON).ln $(LINT_MODULES)
162
163$(RCM_DAEMON).ln: FRC
164	$(LINT.c) $(RCM_SRC) $(LDLIBS)
165
166%.ln: FRC
167	$(LINT.c) $(RCM_SRC) $(@:.ln=.c) $(LDLIBS)
168
169FRC:
170
171include ../../Makefile.targ
172
173$(POFILE):      $(POFILES)
174	$(RM) $@; cat $(POFILES) > $@
175
176$(RCM_DAEMON): $(RCM_OBJ)
177	$(LINK.c) -o $@ $< $(RCM_OBJ) $(LDLIBS)
178	$(POST_PROCESS)
179
180SUNW_%.so: %.o
181	$(LINK.c) -o $@ $(GSHARED) -h $@ $< $(LDLIBS_MODULES)
182
183%.o: $(COMMON)/%.c
184	$(COMPILE.c) -o $@ $<
185
186$(ROOTLIB_RCM):
187	$(INS.dir)
188
189$(ROOTLIB_RCM)/%: %
190	$(INS.file)
191
192$(ROOTLIB_RCM_MOD):
193	$(INS.dir)
194
195$(ROOTLIB_RCM_MOD)/%: %
196	$(INS.file)
197
198$(ROOTLIB_RCM_SCRIPT):
199	$(INS.dir)
200
201$(ROOTETC_RCM):
202	$(INS.dir)
203
204$(ROOTETC_RCM_SCRIPT):
205	$(INS.dir)
206