Home | History | Annotate | Download | only in startd
      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 PROG = svc.startd
     27 OBJS = \
     28 	contract.o \
     29 	deathrow.o \
     30 	dict.o \
     31 	env.o \
     32 	expand.o \
     33 	file.o \
     34 	fork.o \
     35 	graph.o \
     36 	libscf.o \
     37 	log.o \
     38 	method.o \
     39 	misc.o \
     40 	protocol.o \
     41 	restarter.o \
     42 	specials.o \
     43 	startd.o \
     44 	transition.o \
     45 	wait.o \
     46 	utmpx.o
     47 
     48 ALLOBJS = $(OBJS) proc.o
     49 
     50 SRCS = $(OBJS:%.o=%.c)
     51 
     52 POFILES = $(ALLOBJS:%.o=%.po)
     53 
     54 include ../../Makefile.cmd
     55 include ../../Makefile.ctf
     56 
     57 ROOTCMDDIR=	$(ROOT)/lib/svc/bin
     58 
     59 CFLAGS += -v
     60 
     61 $(OBJS) := CPPFLAGS += \
     62 	-I. -I../common -D_REENTRANT -D_FILE_OFFSET_BITS=64
     63 
     64 $(POFILE) := CPPFLAGS += -I. -I../common
     65 
     66 proc.o := CPPFLAGS += -I. -I../common -D_REENTRANT
     67 
     68 LDLIBS += \
     69 	-lcontract \
     70 	-lkstat \
     71 	-lnvpair \
     72 	-lrestart \
     73 	-lscf \
     74 	-lsysevent \
     75 	-lumem \
     76 	-luutil
     77 
     78 LDLIBS_i386 +=	-lgrubmgmt
     79 LDLIBS +=	$(LDLIBS_$(MACH))
     80 
     81 FILEMODE = 0555
     82 
     83 # lint doesn't like the unused _umem_*_init()
     84 # And lint thinks uadmin() is undefined.
     85 lint_SRCS := LINTFLAGS += -U_FILE_OFFSET_BITS -xerroff=E_NAME_DEF_NOT_USED2 -u
     86 lint_SRCS := CPPFLAGS += \
     87 	-I. -I../common -D_REENTRANT -D_FILE_OFFSET_BITS=64
     88 
     89 .KEEP_STATE:
     90 
     91 .PARALLEL: $(ALLOBJS)
     92 
     93 all: $(PROG)
     94 
     95 $(PROG): $(ALLOBJS)
     96 	$(LINK.c) -o $@ $(ALLOBJS) $(LDLIBS)
     97 	$(POST_PROCESS)
     98 
     99 $(POFILE): $(POFILES)
    100 	cat $(POFILES) > $(POFILE)
    101 
    102 install: all $(ROOTCMD)
    103 
    104 clean:
    105 	$(RM) $(ALLOBJS)
    106 
    107 lint:   lint_SRCS
    108 
    109 include ../../Makefile.targ
    110