xref: /illumos-gate/usr/src/cmd/svc/configd/Makefile (revision 3470957343f37ed9baa957980891dbbe4c2d7092)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
5*34709573Sraf# Common Development and Distribution License (the "License").
6*34709573Sraf# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
217c478bd9Sstevel@tonic-gate#
22*34709573Sraf# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate# Use is subject to license terms.
247c478bd9Sstevel@tonic-gate#
257c478bd9Sstevel@tonic-gate# ident	"%Z%%M%	%I%	%E% SMI"
267c478bd9Sstevel@tonic-gate#
277c478bd9Sstevel@tonic-gate
287c478bd9Sstevel@tonic-gateMYPROG = svc.configd
297c478bd9Sstevel@tonic-gateMYOBJS = \
307c478bd9Sstevel@tonic-gate	backend.o \
317c478bd9Sstevel@tonic-gate	configd.o \
327c478bd9Sstevel@tonic-gate	client.o \
337c478bd9Sstevel@tonic-gate	file_object.o \
347c478bd9Sstevel@tonic-gate	maindoor.o \
357c478bd9Sstevel@tonic-gate	object.o \
367c478bd9Sstevel@tonic-gate	rc_node.o \
377c478bd9Sstevel@tonic-gate	snapshot.o
387c478bd9Sstevel@tonic-gate
397c478bd9Sstevel@tonic-gatePROG = $(MYPROG)
407c478bd9Sstevel@tonic-gateOBJS = $(MYOBJS)
417c478bd9Sstevel@tonic-gate
427c478bd9Sstevel@tonic-gateSRCS = $(MYOBJS:%.o=%.c)
437c478bd9Sstevel@tonic-gate
447c478bd9Sstevel@tonic-gateinclude ../../Makefile.cmd
457c478bd9Sstevel@tonic-gateinclude ../Makefile.ctf
467c478bd9Sstevel@tonic-gate
477c478bd9Sstevel@tonic-gateNATIVE_BUILD=$(POUND_SIGN)
487c478bd9Sstevel@tonic-gate$(NATIVE_BUILD)PROG = $(MYPROG:%=%-native)
497c478bd9Sstevel@tonic-gate$(NATIVE_BUILD)OBJS = $(MYOBJS:%.o=%-native.o)
507c478bd9Sstevel@tonic-gate
517c478bd9Sstevel@tonic-gateROOTCMDDIR=	$(ROOT)/lib/svc/bin
527c478bd9Sstevel@tonic-gate
537c478bd9Sstevel@tonic-gateMYCPPFLAGS = -I. -I../common -I../../../common/svc -D_REENTRANT
547c478bd9Sstevel@tonic-gateCPPFLAGS += $(MYCPPFLAGS)
557c478bd9Sstevel@tonic-gateCFLAGS	+= -v
56*34709573SrafMYLDLIBS = -lumem -luutil
577c478bd9Sstevel@tonic-gateLDLIBS	+= -lsecdb $(MYLDLIBS)
587c478bd9Sstevel@tonic-gateLINTFLAGS += -errtags -erroff=E_BAD_FORMAT_ARG_TYPE2
597c478bd9Sstevel@tonic-gate
607c478bd9Sstevel@tonic-gateCLOBBERFILES +=	$(MYPROG:%=%-native)
617c478bd9Sstevel@tonic-gate
627c478bd9Sstevel@tonic-gateLIBUUTIL	= $(SRC)/lib/libuutil
637c478bd9Sstevel@tonic-gateLIBSCF		= $(SRC)/lib/libscf
647c478bd9Sstevel@tonic-gate
657c478bd9Sstevel@tonic-gateSCRIPTFILE	= restore_repository
667c478bd9Sstevel@tonic-gateROOTSCRIPTFILE	= $(ROOTCMDDIR)/$(SCRIPTFILE)
677c478bd9Sstevel@tonic-gate
687c478bd9Sstevel@tonic-gate$(NATIVE_BUILD)CC =	$(NATIVECC)
697c478bd9Sstevel@tonic-gate$(NATIVE_BUILD)LD =	$(NATIVELD)
707c478bd9Sstevel@tonic-gate$(NATIVE_BUILD)CFLAGS =	$(NATIVE_CFLAGS)
717c478bd9Sstevel@tonic-gate$(NATIVE_BUILD)CPPFLAGS = $(MYCPPFLAGS) -I$(LIBUUTIL)/common -I$(LIBSCF)/inc
727c478bd9Sstevel@tonic-gate$(NATIVE_BUILD)CPPFLAGS += -DNATIVE_BUILD
737c478bd9Sstevel@tonic-gate$(NATIVE_BUILD)LDFLAGS =
747c478bd9Sstevel@tonic-gate$(NATIVE_BUILD)LDLIBS = -L$(LIBUUTIL)/native -R $(LIBUUTIL)/native \
757c478bd9Sstevel@tonic-gate	$(MYLDLIBS) -ldoor
767c478bd9Sstevel@tonic-gate
777c478bd9Sstevel@tonic-gateDIRMODE = 0755
787c478bd9Sstevel@tonic-gateFILEMODE = 0555
797c478bd9Sstevel@tonic-gateOWNER = root
807c478bd9Sstevel@tonic-gateGROUP = sys
817c478bd9Sstevel@tonic-gate
827c478bd9Sstevel@tonic-gateSQLITEDIR = sqlite
837c478bd9Sstevel@tonic-gateLIBSQLITE = $(SQLITEDIR)/libsqlite.o
847c478bd9Sstevel@tonic-gate$(NATIVE_BUILD)LIBSQLITE = $(SQLITEDIR)/libsqlite-native.o
857c478bd9Sstevel@tonic-gateSQLITELINT = $(SQLITEDIR)/llib-lsqlite.ln
867c478bd9Sstevel@tonic-gate
877c478bd9Sstevel@tonic-gateOBJS += $(LIBSQLITE)
887c478bd9Sstevel@tonic-gate
897c478bd9Sstevel@tonic-gateinstall := TARGET = install
907c478bd9Sstevel@tonic-gateclobber := TARGET = clobber
917c478bd9Sstevel@tonic-gate
927c478bd9Sstevel@tonic-gatelint	:= LDLIBS += $(SQLITELINT)
937c478bd9Sstevel@tonic-gate
947c478bd9Sstevel@tonic-gate.KEEP_STATE:
957c478bd9Sstevel@tonic-gate.PARALLEL: $(MYOBJS) $(MYOBJS:%.o=%-native.o)
967c478bd9Sstevel@tonic-gate
977c478bd9Sstevel@tonic-gateall: $(PROG)
987c478bd9Sstevel@tonic-gate
997c478bd9Sstevel@tonic-gatenative: FRC
1007c478bd9Sstevel@tonic-gate	@cd $(LIBUUTIL)/native; pwd; $(MAKE) $(MFLAGS) install
1017c478bd9Sstevel@tonic-gate	@NATIVE_BUILD= $(MAKE) $(MFLAGS) all
1027c478bd9Sstevel@tonic-gate
1037c478bd9Sstevel@tonic-gate$(SQLITEDIR): FRC
1047c478bd9Sstevel@tonic-gate	@cd $(SQLITEDIR); pwd; $(MAKE) $(TARGET)
1057c478bd9Sstevel@tonic-gate
1067c478bd9Sstevel@tonic-gate$(SQLITEDIR)/libsqlite.o: FRC
1077c478bd9Sstevel@tonic-gate	@cd $(SQLITEDIR); pwd; $(MAKE) all
1087c478bd9Sstevel@tonic-gate
1097c478bd9Sstevel@tonic-gate$(SQLITEDIR)/libsqlite-native.o: FRC
1107c478bd9Sstevel@tonic-gate	@cd $(SQLITEDIR); pwd; $(MAKE) native
1117c478bd9Sstevel@tonic-gate
1127c478bd9Sstevel@tonic-gate$(SQLITEDIR)/llib-lsqlite.ln: FRC
1137c478bd9Sstevel@tonic-gate	@cd $(SQLITEDIR); pwd; $(MAKE) llib-lsqlite.ln
1147c478bd9Sstevel@tonic-gate
1157c478bd9Sstevel@tonic-gate$(PROG): $(LIBSQLITE) $(OBJS)
1167c478bd9Sstevel@tonic-gate	$(LINK.c) -o $@ $(OBJS) $(LDLIBS) $(CTFMERGE_HOOK)
1177c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1187c478bd9Sstevel@tonic-gate
1197c478bd9Sstevel@tonic-gate%-native.o: %.c
1207c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $< $(CTFCONVERT_HOOK)
1217c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
1227c478bd9Sstevel@tonic-gate
1237c478bd9Sstevel@tonic-gate$(ROOTCMDDIR)/%: %.sh
1247c478bd9Sstevel@tonic-gate	$(INS.rename)
1257c478bd9Sstevel@tonic-gate
1267c478bd9Sstevel@tonic-gateinstall: all $(SQLITEDIR) $(ROOTCMD) $(ROOTVARSADMFILE) $(ROOTSCRIPTFILE)
1277c478bd9Sstevel@tonic-gate
1287c478bd9Sstevel@tonic-gateclean: FRC
1297c478bd9Sstevel@tonic-gate	$(RM) $(MYOBJS) $(MYOBJS:%.o=%-native.o)
1307c478bd9Sstevel@tonic-gate
1317c478bd9Sstevel@tonic-gateclobber: $(SQLITEDIR)
1327c478bd9Sstevel@tonic-gate
1337c478bd9Sstevel@tonic-gatelint:   lint_SRCS
1347c478bd9Sstevel@tonic-gate
1357c478bd9Sstevel@tonic-gatelint_SRCS: $(SQLITELINT)
1367c478bd9Sstevel@tonic-gate
1377c478bd9Sstevel@tonic-gateinclude ../../Makefile.targ
1387c478bd9Sstevel@tonic-gate
1397c478bd9Sstevel@tonic-gateFRC:
140