xref: /titanic_50/usr/src/cmd/logadm/Makefile (revision 7014882c6a3672fd0e5d60200af8643ae53c5928)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
524fe0b3bSjmcp# Common Development and Distribution License (the "License").
624fe0b3bSjmcp# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
217c478bd9Sstevel@tonic-gate#
22f6e214c7SGavin Maltby# Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
237c478bd9Sstevel@tonic-gate#
247c478bd9Sstevel@tonic-gate
257c478bd9Sstevel@tonic-gatePROG= logadm
267c478bd9Sstevel@tonic-gateTESTS= conftest globtest kwtest luttest optstest
277c478bd9Sstevel@tonic-gateOBJS= conf.o err.o fn.o glob.o kw.o lut.o main.o opts.o
287c478bd9Sstevel@tonic-gateTESTOBJS= $(TESTS:%=%.o)
297c478bd9Sstevel@tonic-gateSRCS= $(OBJS:%.o=%.c)
307c478bd9Sstevel@tonic-gatePOFILES= $(OBJS:%.o=%.po)
317c478bd9Sstevel@tonic-gateCONFIGFILE= logadm.conf
327c478bd9Sstevel@tonic-gate
337c478bd9Sstevel@tonic-gateinclude ../Makefile.cmd
347c478bd9Sstevel@tonic-gate
357c478bd9Sstevel@tonic-gateCPPFLAGS += -D_FILE_OFFSET_BITS=64
36*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-parentheses
37*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-clobbered
38*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-uninitialized
397c478bd9Sstevel@tonic-gateXGETFLAGS += -a -x logadm.xcl
407c478bd9Sstevel@tonic-gate
417c478bd9Sstevel@tonic-gate$(ROOTETC)/$(CONFIGFILE):= FILEMODE= 644
427c478bd9Sstevel@tonic-gate
437c478bd9Sstevel@tonic-gateCLOBBERFILES += $(TESTS)
447c478bd9Sstevel@tonic-gate
45f6e214c7SGavin MaltbyLOGADMDIR = $(ROOT)/etc/logadm.d
46f6e214c7SGavin Maltby
47f6e214c7SGavin MaltbyMFSTFILES =	logadm-upgrade.xml
48f6e214c7SGavin MaltbyMANIFESTDIR =	$(ROOT)/lib/svc/manifest/system
49f6e214c7SGavin MaltbyMANIFEST =	$(MFSTFILES:%=$(MANIFESTDIR)/%)
50f6e214c7SGavin Maltby$(MANIFEST) :=	FILEMODE = 0444
51f6e214c7SGavin Maltby
52f6e214c7SGavin MaltbyMETHODFILES =	logadm-upgrade
53f6e214c7SGavin MaltbyMETHODDIR =	$(ROOT)/lib/svc/method
54f6e214c7SGavin MaltbyMETHOD =	$(METHODFILES:%=$(METHODDIR)/%)
55f6e214c7SGavin Maltby$(METHOD) :=	FILEMODE = 0555
56f6e214c7SGavin Maltby
577c478bd9Sstevel@tonic-gate.KEEP_STATE:
587c478bd9Sstevel@tonic-gate
597c478bd9Sstevel@tonic-gateall: $(PROG)
607c478bd9Sstevel@tonic-gate
617c478bd9Sstevel@tonic-gatetest: $(TESTS) $(PROG)
62e9a193fcSJohn.Zolnowsky@Sun.COM	$(PERL) -w ./tester `pwd`
637c478bd9Sstevel@tonic-gate
647c478bd9Sstevel@tonic-gate$(PROG): $(OBJS)
657c478bd9Sstevel@tonic-gate	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
667c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
677c478bd9Sstevel@tonic-gate
68f6e214c7SGavin Maltbyinstall: all $(ROOTUSRSBINPROG) $(ROOTETC)/$(CONFIGFILE) $(LOGADMDIR) \
69f6e214c7SGavin Maltby             $(MANIFESTDIR) $(MANIFEST) $(METHODDIR) $(METHOD)
70f6e214c7SGavin Maltby
71f6e214c7SGavin Maltby$(LOGADMDIR):
72f6e214c7SGavin Maltby	$(INS.dir)
73f6e214c7SGavin Maltby
74f6e214c7SGavin Maltby$(MANIFESTDIR):
75f6e214c7SGavin Maltby	$(INS.dir)
76f6e214c7SGavin Maltby
77f6e214c7SGavin Maltby$(MANIFESTDIR)/% : %
78f6e214c7SGavin Maltby	$(INS.file)
79f6e214c7SGavin Maltby
80f6e214c7SGavin Maltby$(METHODDIR):
81f6e214c7SGavin Maltby	$(INS.dir)
82f6e214c7SGavin Maltby
83f6e214c7SGavin Maltby$(METHODDIR)/% : %
84f6e214c7SGavin Maltby	$(INS.file)
857c478bd9Sstevel@tonic-gate
867c478bd9Sstevel@tonic-gate$(POFILE): $(POFILES)
877c478bd9Sstevel@tonic-gate	$(RM) $@
887c478bd9Sstevel@tonic-gate	cat $(POFILES) > $@
897c478bd9Sstevel@tonic-gate
907c478bd9Sstevel@tonic-gateclean:
917c478bd9Sstevel@tonic-gate	$(RM) $(OBJS) $(TESTOBJS)
927c478bd9Sstevel@tonic-gate
937c478bd9Sstevel@tonic-gatelint: lint_SRCS
947c478bd9Sstevel@tonic-gate
957c478bd9Sstevel@tonic-gateinclude ../Makefile.targ
967c478bd9Sstevel@tonic-gate
977c478bd9Sstevel@tonic-gate#
987c478bd9Sstevel@tonic-gate# dependencies for various test programs built from same source
997c478bd9Sstevel@tonic-gate#
1007c478bd9Sstevel@tonic-gate%test.o: %.c
1017c478bd9Sstevel@tonic-gate	$(COMPILE.c) -DTESTMODULE -o $@ $<
1027c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
1037c478bd9Sstevel@tonic-gate
1047c478bd9Sstevel@tonic-gateconftest: conftest.o err.o fn.o lut.o opts.o
1057c478bd9Sstevel@tonic-gate	$(LINK.c) -o conftest conftest.o err.o fn.o lut.o opts.o $(LDLIBS)
1067c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1077c478bd9Sstevel@tonic-gate
1087c478bd9Sstevel@tonic-gateglobtest: globtest.o lut.o err.o fn.o
1097c478bd9Sstevel@tonic-gate	$(LINK.c) -o globtest globtest.o lut.o err.o fn.o $(LDLIBS)
1107c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1117c478bd9Sstevel@tonic-gate
1127c478bd9Sstevel@tonic-gatekwtest: kwtest.o err.o fn.o lut.o
1137c478bd9Sstevel@tonic-gate	$(LINK.c) -o kwtest kwtest.o err.o fn.o lut.o $(LDLIBS)
1147c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1157c478bd9Sstevel@tonic-gate
1167c478bd9Sstevel@tonic-gateluttest: luttest.o err.o
1177c478bd9Sstevel@tonic-gate	$(LINK.c) -o luttest luttest.o err.o $(LDLIBS)
1187c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1197c478bd9Sstevel@tonic-gate
1207c478bd9Sstevel@tonic-gateoptstest: optstest.o err.o fn.o lut.o
1217c478bd9Sstevel@tonic-gate	$(LINK.c) -o optstest optstest.o err.o fn.o lut.o $(LDLIBS)
1227c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
123