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 -I$(ROOT)/usr/include/sqlite -D_REENTRANT 52CPPFLAGS += $(MYCPPFLAGS) 53CFLAGS += $(CCVERBOSE) 54CERRWARN += -_gcc=-Wno-parentheses 55CERRWARN += -_gcc=-Wno-type-limits 56CERRWARN += -_gcc=-Wno-unused-label 57CERRWARN += -_gcc=-Wno-unused-variable 58CERRWARN += -_gcc=-Wno-unused-function 59CERRWARN += -_gcc=-Wno-uninitialized 60MYLDLIBS = -lumem -luutil -lbsm 61LDLIBS += -lsecdb $(MYLDLIBS) 62LINTFLAGS += -errtags -erroff=E_BAD_FORMAT_ARG_TYPE2 -erroff=E_NAME_DEF_NOT_USED2 63 64CLOBBERFILES += $(MYPROG:%=%-native) 65 66LIBUUTIL = $(SRC)/lib/libuutil 67LIBSCF = $(SRC)/lib/libscf 68 69SCRIPTFILE = restore_repository 70ROOTSCRIPTFILE = $(ROOTCMDDIR)/$(SCRIPTFILE) 71 72$(NATIVE_BUILD)CC = $(NATIVECC) 73$(NATIVE_BUILD)LD = $(NATIVELD) 74$(NATIVE_BUILD)CFLAGS = $(NATIVE_CFLAGS) 75$(NATIVE_BUILD)CPPFLAGS = $(MYCPPFLAGS) -I$(LIBUUTIL)/common -I$(LIBSCF)/inc 76$(NATIVE_BUILD)CPPFLAGS += -DNATIVE_BUILD 77$(NATIVE_BUILD)LDFLAGS = 78$(NATIVE_BUILD)LDLIBS = -L$(LIBUUTIL)/native -R $(LIBUUTIL)/native $(MYLDLIBS) 79 80DIRMODE = 0755 81FILEMODE = 0555 82 83LIBSQLITE = $(ROOT)/usr/lib/libsqlite.o 84$(NATIVE_BUILD)LIBSQLITE = $(ROOT)/usr/lib/libsqlite-native.o 85SQLITELINT = $(ROOT)/usr/lib/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$(PROG): $(OBJS) 104 $(LINK.c) -o $@ $(OBJS) $(LDLIBS) 105 $(POST_PROCESS) 106 107%-native.o: %.c 108 $(COMPILE.c) -o $@ $< 109 $(POST_PROCESS_O) 110 111$(ROOTCMDDIR)/%: %.sh 112 $(INS.rename) 113 114install: all $(ROOTCMD) $(ROOTVARSADMFILE) $(ROOTSCRIPTFILE) 115 116clean: FRC 117 $(RM) $(MYOBJS) $(MYOBJS:%.o=%-native.o) 118 119clobber: 120 121lint: lint_SRCS 122 123lint_SRCS: 124 125include ../../Makefile.targ 126 127FRC: 128