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