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