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