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 (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  23 #
  24 
  25 PROG= logadm
  26 TESTS= conftest globtest kwtest luttest optstest
  27 OBJS= conf.o err.o fn.o glob.o kw.o lut.o main.o opts.o
  28 TESTOBJS= $(TESTS:%=%.o)
  29 SRCS= $(OBJS:%.o=%.c)
  30 POFILES= $(OBJS:%.o=%.po)
  31 CONFIGFILE= logadm.conf
  32 
  33 include ../Makefile.cmd
  34 
  35 CPPFLAGS += -D_FILE_OFFSET_BITS=64
  36 CERRWARN += -_gcc=-Wno-parentheses
  37 CERRWARN += -_gcc=-Wno-clobbered
  38 CERRWARN += $(CNOWARN_UNINIT)
  39 XGETFLAGS += -a -x logadm.xcl
  40 
  41 $(ROOTETC)/$(CONFIGFILE):= FILEMODE= 644
  42 
  43 CLOBBERFILES += $(TESTS)
  44 
  45 LOGADMDIR = $(ROOT)/etc/logadm.d
  46 
  47 MFSTFILES =     logadm-upgrade.xml
  48 MANIFESTDIR =   $(ROOT)/lib/svc/manifest/system
  49 MANIFEST =      $(MFSTFILES:%=$(MANIFESTDIR)/%)
  50 $(MANIFEST) :=  FILEMODE = 0444
  51 
  52 METHODFILES =   logadm-upgrade
  53 METHODDIR =     $(ROOT)/lib/svc/method
  54 METHOD =        $(METHODFILES:%=$(METHODDIR)/%)
  55 $(METHOD) :=    FILEMODE = 0555
  56 
  57 .KEEP_STATE:
  58 
  59 all: $(PROG)
  60 
  61 test: $(TESTS) $(PROG)
  62         $(PERL) -w ./tester `pwd`
  63 
  64 $(PROG): $(OBJS)
  65         $(LINK.c) -o $@ $(OBJS) $(LDLIBS)
  66         $(POST_PROCESS)
  67 
  68 install: all $(ROOTUSRSBINPROG) $(ROOTETC)/$(CONFIGFILE) $(LOGADMDIR) \
  69              $(MANIFESTDIR) $(MANIFEST) $(METHODDIR) $(METHOD)
  70 
  71 $(LOGADMDIR):
  72         $(INS.dir)
  73 
  74 $(MANIFESTDIR):
  75         $(INS.dir)
  76 
  77 $(MANIFESTDIR)/% : %
  78         $(INS.file)
  79 
  80 $(METHODDIR):
  81         $(INS.dir)
  82 
  83 $(METHODDIR)/% : %
  84         $(INS.file)
  85 
  86 $(POFILE): $(POFILES)
  87         $(RM) $@
  88         cat $(POFILES) > $@
  89 
  90 clean:
  91         $(RM) $(OBJS) $(TESTOBJS)
  92 
  93 lint: lint_SRCS
  94 
  95 include ../Makefile.targ
  96 
  97 #
  98 # dependencies for various test programs built from same source
  99 #
 100 %test.o: %.c
 101         $(COMPILE.c) -DTESTMODULE -o $@ $<
 102         $(POST_PROCESS_O)
 103 
 104 conftest: conftest.o err.o fn.o lut.o opts.o
 105         $(LINK.c) -o conftest conftest.o err.o fn.o lut.o opts.o $(LDLIBS)
 106         $(POST_PROCESS)
 107 
 108 globtest: globtest.o lut.o err.o fn.o
 109         $(LINK.c) -o globtest globtest.o lut.o err.o fn.o $(LDLIBS)
 110         $(POST_PROCESS)
 111 
 112 kwtest: kwtest.o err.o fn.o lut.o
 113         $(LINK.c) -o kwtest kwtest.o err.o fn.o lut.o $(LDLIBS)
 114         $(POST_PROCESS)
 115 
 116 luttest: luttest.o err.o
 117         $(LINK.c) -o luttest luttest.o err.o $(LDLIBS)
 118         $(POST_PROCESS)
 119 
 120 optstest: optstest.o err.o fn.o lut.o
 121         $(LINK.c) -o optstest optstest.o err.o fn.o lut.o $(LDLIBS)
 122         $(POST_PROCESS)