xref: /titanic_52/usr/src/cmd/svc/configd/Makefile (revision 10db1377dafab8ba3feedef26db9c5d8539a5cd1)
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
29MYPROG = svc.configd
30MYOBJS = \
31	backend.o \
32	configd.o \
33	client.o \
34	file_object.o \
35	maindoor.o \
36	object.o \
37	rc_node.o \
38	snapshot.o
39
40PROG = $(MYPROG)
41OBJS = $(MYOBJS)
42
43SRCS = $(MYOBJS:%.o=%.c)
44
45include ../../Makefile.cmd
46include ../Makefile.ctf
47
48NATIVE_BUILD=$(POUND_SIGN)
49$(NATIVE_BUILD)PROG = $(MYPROG:%=%-native)
50$(NATIVE_BUILD)OBJS = $(MYOBJS:%.o=%-native.o)
51
52ROOTCMDDIR=	$(ROOT)/lib/svc/bin
53
54MYCPPFLAGS = -I. -I../common -I../../../common/svc -D_REENTRANT
55CPPFLAGS += $(MYCPPFLAGS)
56CFLAGS	+= -v
57MYLDLIBS = -lrt -lumem -luutil
58LDLIBS	+= -lsecdb $(MYLDLIBS)
59LINTFLAGS += -errtags -erroff=E_BAD_FORMAT_ARG_TYPE2
60
61CLOBBERFILES +=	$(MYPROG:%=%-native)
62
63LIBUUTIL	= $(SRC)/lib/libuutil
64LIBSCF		= $(SRC)/lib/libscf
65
66SCRIPTFILE	= restore_repository
67ROOTSCRIPTFILE	= $(ROOTCMDDIR)/$(SCRIPTFILE)
68
69$(NATIVE_BUILD)CC =	$(NATIVECC)
70$(NATIVE_BUILD)LD =	$(NATIVELD)
71$(NATIVE_BUILD)CFLAGS =	$(NATIVE_CFLAGS)
72$(NATIVE_BUILD)CPPFLAGS = $(MYCPPFLAGS) -I$(LIBUUTIL)/common -I$(LIBSCF)/inc
73$(NATIVE_BUILD)CPPFLAGS += -DNATIVE_BUILD
74$(NATIVE_BUILD)LDFLAGS =
75$(NATIVE_BUILD)LDLIBS = -L$(LIBUUTIL)/native -R $(LIBUUTIL)/native \
76	$(MYLDLIBS) -ldoor
77
78DIRMODE = 0755
79FILEMODE = 0555
80OWNER = root
81GROUP = sys
82
83SQLITEDIR = sqlite
84LIBSQLITE = $(SQLITEDIR)/libsqlite.o
85$(NATIVE_BUILD)LIBSQLITE = $(SQLITEDIR)/libsqlite-native.o
86SQLITELINT = $(SQLITEDIR)/llib-lsqlite.ln
87
88OBJS += $(LIBSQLITE)
89
90install := TARGET = install
91clobber := TARGET = clobber
92
93lint	:= LDLIBS += $(SQLITELINT)
94
95.KEEP_STATE:
96.PARALLEL: $(MYOBJS) $(MYOBJS:%.o=%-native.o)
97
98all: $(PROG)
99
100native: FRC
101	@cd $(LIBUUTIL)/native; pwd; $(MAKE) $(MFLAGS) install
102	@NATIVE_BUILD= $(MAKE) $(MFLAGS) all
103
104$(SQLITEDIR): FRC
105	@cd $(SQLITEDIR); pwd; $(MAKE) $(TARGET)
106
107$(SQLITEDIR)/libsqlite.o: FRC
108	@cd $(SQLITEDIR); pwd; $(MAKE) all
109
110$(SQLITEDIR)/libsqlite-native.o: FRC
111	@cd $(SQLITEDIR); pwd; $(MAKE) native
112
113$(SQLITEDIR)/llib-lsqlite.ln: FRC
114	@cd $(SQLITEDIR); pwd; $(MAKE) llib-lsqlite.ln
115
116$(PROG): $(LIBSQLITE) $(OBJS)
117	$(LINK.c) -o $@ $(OBJS) $(LDLIBS) $(CTFMERGE_HOOK)
118	$(POST_PROCESS)
119
120%-native.o: %.c
121	$(COMPILE.c) -o $@ $< $(CTFCONVERT_HOOK)
122	$(POST_PROCESS_O)
123
124$(ROOTCMDDIR)/%: %.sh
125	$(INS.rename)
126
127install: all $(SQLITEDIR) $(ROOTCMD) $(ROOTVARSADMFILE) $(ROOTSCRIPTFILE)
128
129clean: FRC
130	$(RM) $(MYOBJS) $(MYOBJS:%.o=%-native.o)
131
132clobber: $(SQLITEDIR)
133
134lint:   lint_SRCS
135
136lint_SRCS: $(SQLITELINT)
137
138include ../../Makefile.targ
139
140FRC:
141