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