xref: /illumos-gate/usr/src/cmd/svc/configd/Makefile (revision 4c28a617e3922d92a58e813a5b955eb526b9c386)
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# Copyright 2015 RackTop Systems.
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 \
54	-I$(ROOT)/usr/include/sqlite-sys -D_REENTRANT
55CPPFLAGS += $(MYCPPFLAGS)
56CFLAGS	+= $(CCVERBOSE)
57CERRWARN += -_gcc=-Wno-parentheses
58CERRWARN += -_gcc=-Wno-type-limits
59CERRWARN += -_gcc=-Wno-unused-label
60CERRWARN += -_gcc=-Wno-unused-variable
61CERRWARN += -_gcc=-Wno-unused-function
62CERRWARN += -_gcc=-Wno-uninitialized
63MYLDLIBS = -lumem -luutil
64LDLIBS	+= -lsecdb -lbsm $(MYLDLIBS)
65LINTFLAGS += -errtags -erroff=E_BAD_FORMAT_ARG_TYPE2 -erroff=E_NAME_DEF_NOT_USED2
66
67CLOBBERFILES +=	$(MYPROG:%=%-native)
68
69LIBUUTIL	= $(SRC)/lib/libuutil
70LIBSCF		= $(SRC)/lib/libscf
71
72SCRIPTFILE	= restore_repository
73ROOTSCRIPTFILE	= $(ROOTCMDDIR)/$(SCRIPTFILE)
74
75#
76# Native variant (used in ../seed)
77#
78$(NATIVE_BUILD)CC =	$(NATIVECC)
79$(NATIVE_BUILD)LD =	$(NATIVELD)
80$(NATIVE_BUILD)CFLAGS =	$(NATIVE_CFLAGS)
81$(NATIVE_BUILD)CPPFLAGS = $(MYCPPFLAGS) -I$(LIBUUTIL)/common -I$(LIBSCF)/inc
82$(NATIVE_BUILD)CPPFLAGS += -DNATIVE_BUILD
83$(NATIVE_BUILD)LDFLAGS =
84$(NATIVE_BUILD)LDLIBS = -L$(ADJUNCT_PROTO)/usr/lib -R$(ADJUNCT_PROTO)/usr/lib \
85			-L$(LIBUUTIL)/native -R $(LIBUUTIL)/native $(MYLDLIBS)
86
87DIRMODE = 0755
88FILEMODE = 0555
89
90OBJSQLITE =
91LIBSQLITE = -lsqlite-sys
92$(NATIVE_BUILD)OBJSQLITE = $(ROOT)/lib/libsqlite-native.o
93$(NATIVE_BUILD)LIBSQLITE =
94
95OBJS += $(OBJSQLITE)
96LDLIBS += $(LIBSQLITE)
97
98install := TARGET = install
99clobber := TARGET = clobber
100
101.KEEP_STATE:
102.PARALLEL: $(MYOBJS) $(MYOBJS:%.o=%-native.o)
103
104all: $(PROG)
105
106native: FRC
107	@cd $(LIBUUTIL)/native; pwd; $(MAKE) $(MFLAGS) install
108	@NATIVE_BUILD= $(MAKE) $(MFLAGS) all
109
110$(PROG): $(OBJS)
111	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
112	$(POST_PROCESS)
113
114%-native.o: %.c
115	$(COMPILE.c) -o $@ $<
116	$(POST_PROCESS_O)
117
118$(ROOTCMDDIR)/%: %.sh
119	$(INS.rename)
120
121install: all $(ROOTCMD) $(ROOTVARSADMFILE) $(ROOTSCRIPTFILE)
122
123clean: FRC
124	$(RM) $(MYOBJS) $(MYOBJS:%.o=%-native.o)
125
126clobber:
127
128lint:   lint_SRCS
129
130lint_SRCS:
131
132include ../../Makefile.targ
133
134FRC:
135