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