Home | History | Annotate | Download | only in configd
      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 
     26 MYPROG = svc.configd
     27 MYOBJS = \
     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 
     37 PROG = $(MYPROG)
     38 OBJS = $(MYOBJS)
     39 
     40 SRCS = $(MYOBJS:%.o=%.c)
     41 
     42 include ../../Makefile.cmd
     43 include ../../Makefile.ctf
     44 
     45 NATIVE_BUILD=$(POUND_SIGN)
     46 $(NATIVE_BUILD)PROG = $(MYPROG:%=%-native)
     47 $(NATIVE_BUILD)OBJS = $(MYOBJS:%.o=%-native.o)
     48 
     49 ROOTCMDDIR=	$(ROOT)/lib/svc/bin
     50 
     51 MYCPPFLAGS = -I. -I../common -I../../../common/svc -I$(ROOT)/usr/include/sqlite -D_REENTRANT
     52 CPPFLAGS += $(MYCPPFLAGS)
     53 CFLAGS	+= -v
     54 MYLDLIBS = -lumem -luutil -lbsm
     55 LDLIBS	+= -lsecdb $(MYLDLIBS)
     56 LINTFLAGS += -errtags -erroff=E_BAD_FORMAT_ARG_TYPE2
     57 
     58 CLOBBERFILES +=	$(MYPROG:%=%-native)
     59 
     60 LIBUUTIL	= $(SRC)/lib/libuutil
     61 LIBSCF		= $(SRC)/lib/libscf
     62 
     63 SCRIPTFILE	= restore_repository
     64 ROOTSCRIPTFILE	= $(ROOTCMDDIR)/$(SCRIPTFILE)
     65 
     66 $(NATIVE_BUILD)CC =	$(NATIVECC)
     67 $(NATIVE_BUILD)LD =	$(NATIVELD)
     68 $(NATIVE_BUILD)CFLAGS =	$(NATIVE_CFLAGS)
     69 $(NATIVE_BUILD)CPPFLAGS = $(MYCPPFLAGS) -I$(LIBUUTIL)/common -I$(LIBSCF)/inc
     70 $(NATIVE_BUILD)CPPFLAGS += -DNATIVE_BUILD
     71 $(NATIVE_BUILD)LDFLAGS =
     72 $(NATIVE_BUILD)LDLIBS = -L$(LIBUUTIL)/native -R $(LIBUUTIL)/native $(MYLDLIBS)
     73 
     74 DIRMODE = 0755
     75 FILEMODE = 0555
     76 
     77 LIBSQLITE = $(ROOT)/usr/lib/libsqlite.o
     78 $(NATIVE_BUILD)LIBSQLITE = $(ROOT)/usr/lib/libsqlite-native.o
     79 SQLITELINT = $(ROOT)/usr/lib/llib-lsqlite.ln
     80 
     81 OBJS += $(LIBSQLITE)
     82 
     83 install := TARGET = install
     84 clobber := TARGET = clobber
     85 
     86 lint	:= LDLIBS += $(SQLITELINT)
     87 
     88 .KEEP_STATE:
     89 .PARALLEL: $(MYOBJS) $(MYOBJS:%.o=%-native.o)
     90 
     91 all: $(PROG)
     92 
     93 native: FRC
     94 	@cd $(LIBUUTIL)/native; pwd; $(MAKE) $(MFLAGS) install
     95 	@NATIVE_BUILD= $(MAKE) $(MFLAGS) all
     96 
     97 $(PROG): $(OBJS)
     98 	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
     99 	$(POST_PROCESS)
    100 
    101 %-native.o: %.c
    102 	$(COMPILE.c) -o $@ $<
    103 	$(POST_PROCESS_O)
    104 
    105 $(ROOTCMDDIR)/%: %.sh
    106 	$(INS.rename)
    107 
    108 install: all $(ROOTCMD) $(ROOTVARSADMFILE) $(ROOTSCRIPTFILE)
    109 
    110 clean: FRC
    111 	$(RM) $(MYOBJS) $(MYOBJS:%.o=%-native.o)
    112 
    113 clobber:
    114 
    115 lint:   lint_SRCS
    116 
    117 lint_SRCS:
    118 
    119 include ../../Makefile.targ
    120 
    121 FRC:
    122