xref: /onnv-gate/usr/src/cmd/logadm/Makefile (revision 12986:04c3fb904c79)
10Sstevel@tonic-gate#
20Sstevel@tonic-gate# CDDL HEADER START
30Sstevel@tonic-gate#
40Sstevel@tonic-gate# The contents of this file are subject to the terms of the
510207SJames.McPherson@Sun.COM# Common Development and Distribution License (the "License").
610207SJames.McPherson@Sun.COM# You may not use this file except in compliance with the License.
70Sstevel@tonic-gate#
80Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate# See the License for the specific language governing permissions
110Sstevel@tonic-gate# and limitations under the License.
120Sstevel@tonic-gate#
130Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate#
190Sstevel@tonic-gate# CDDL HEADER END
200Sstevel@tonic-gate#
210Sstevel@tonic-gate#
2212967Sgavin.maltby@oracle.com# Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
230Sstevel@tonic-gate#
240Sstevel@tonic-gate
250Sstevel@tonic-gatePROG= logadm
260Sstevel@tonic-gateTESTS= conftest globtest kwtest luttest optstest
270Sstevel@tonic-gateOBJS= conf.o err.o fn.o glob.o kw.o lut.o main.o opts.o
280Sstevel@tonic-gateTESTOBJS= $(TESTS:%=%.o)
290Sstevel@tonic-gateSRCS= $(OBJS:%.o=%.c)
300Sstevel@tonic-gatePOFILES= $(OBJS:%.o=%.po)
310Sstevel@tonic-gateCONFIGFILE= logadm.conf
320Sstevel@tonic-gate
330Sstevel@tonic-gateinclude ../Makefile.cmd
340Sstevel@tonic-gate
350Sstevel@tonic-gateCPPFLAGS += -D_FILE_OFFSET_BITS=64
360Sstevel@tonic-gateXGETFLAGS += -a -x logadm.xcl
370Sstevel@tonic-gate
380Sstevel@tonic-gate$(ROOTETC)/$(CONFIGFILE):= FILEMODE= 644
390Sstevel@tonic-gate
400Sstevel@tonic-gateCLOBBERFILES += $(TESTS)
410Sstevel@tonic-gate
4212967Sgavin.maltby@oracle.comLOGADMDIR = $(ROOT)/etc/logadm.d
4312967Sgavin.maltby@oracle.com
4412967Sgavin.maltby@oracle.comMFSTFILES =	logadm-upgrade.xml
4512967Sgavin.maltby@oracle.comMANIFESTDIR =	$(ROOT)/lib/svc/manifest/system
4612967Sgavin.maltby@oracle.comMANIFEST =	$(MFSTFILES:%=$(MANIFESTDIR)/%)
4712967Sgavin.maltby@oracle.com$(MANIFEST) :=	FILEMODE = 0444
4812967Sgavin.maltby@oracle.com
4912967Sgavin.maltby@oracle.comMETHODFILES =	logadm-upgrade
5012967Sgavin.maltby@oracle.comMETHODDIR =	$(ROOT)/lib/svc/method
5112967Sgavin.maltby@oracle.comMETHOD =	$(METHODFILES:%=$(METHODDIR)/%)
5212967Sgavin.maltby@oracle.com$(METHOD) :=	FILEMODE = 0555
5312967Sgavin.maltby@oracle.com
540Sstevel@tonic-gate.KEEP_STATE:
550Sstevel@tonic-gate
560Sstevel@tonic-gateall: $(PROG)
570Sstevel@tonic-gate
580Sstevel@tonic-gatetest: $(TESTS) $(PROG)
59*12986SJohn.Zolnowsky@Sun.COM	$(PERL) -w ./tester `pwd`
600Sstevel@tonic-gate
610Sstevel@tonic-gate$(PROG): $(OBJS)
620Sstevel@tonic-gate	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
630Sstevel@tonic-gate	$(POST_PROCESS)
640Sstevel@tonic-gate
6512967Sgavin.maltby@oracle.cominstall: all $(ROOTUSRSBINPROG) $(ROOTETC)/$(CONFIGFILE) $(LOGADMDIR) \
6612967Sgavin.maltby@oracle.com             $(MANIFESTDIR) $(MANIFEST) $(METHODDIR) $(METHOD)
6712967Sgavin.maltby@oracle.com
6812967Sgavin.maltby@oracle.com$(LOGADMDIR):
6912967Sgavin.maltby@oracle.com	$(INS.dir)
7012967Sgavin.maltby@oracle.com
7112967Sgavin.maltby@oracle.com$(MANIFESTDIR):
7212967Sgavin.maltby@oracle.com	$(INS.dir)
7312967Sgavin.maltby@oracle.com
7412967Sgavin.maltby@oracle.com$(MANIFESTDIR)/% : %
7512967Sgavin.maltby@oracle.com	$(INS.file)
7612967Sgavin.maltby@oracle.com
7712967Sgavin.maltby@oracle.com$(METHODDIR):
7812967Sgavin.maltby@oracle.com	$(INS.dir)
7912967Sgavin.maltby@oracle.com
8012967Sgavin.maltby@oracle.com$(METHODDIR)/% : %
8112967Sgavin.maltby@oracle.com	$(INS.file)
820Sstevel@tonic-gate
830Sstevel@tonic-gate$(POFILE): $(POFILES)
840Sstevel@tonic-gate	$(RM) $@
850Sstevel@tonic-gate	cat $(POFILES) > $@
860Sstevel@tonic-gate
870Sstevel@tonic-gateclean:
880Sstevel@tonic-gate	$(RM) $(OBJS) $(TESTOBJS)
890Sstevel@tonic-gate
900Sstevel@tonic-gatelint: lint_SRCS
910Sstevel@tonic-gate
920Sstevel@tonic-gateinclude ../Makefile.targ
930Sstevel@tonic-gate
940Sstevel@tonic-gate#
950Sstevel@tonic-gate# dependencies for various test programs built from same source
960Sstevel@tonic-gate#
970Sstevel@tonic-gate%test.o: %.c
980Sstevel@tonic-gate	$(COMPILE.c) -DTESTMODULE -o $@ $<
990Sstevel@tonic-gate	$(POST_PROCESS_O)
1000Sstevel@tonic-gate
1010Sstevel@tonic-gateconftest: conftest.o err.o fn.o lut.o opts.o
1020Sstevel@tonic-gate	$(LINK.c) -o conftest conftest.o err.o fn.o lut.o opts.o $(LDLIBS)
1030Sstevel@tonic-gate	$(POST_PROCESS)
1040Sstevel@tonic-gate
1050Sstevel@tonic-gateglobtest: globtest.o lut.o err.o fn.o
1060Sstevel@tonic-gate	$(LINK.c) -o globtest globtest.o lut.o err.o fn.o $(LDLIBS)
1070Sstevel@tonic-gate	$(POST_PROCESS)
1080Sstevel@tonic-gate
1090Sstevel@tonic-gatekwtest: kwtest.o err.o fn.o lut.o
1100Sstevel@tonic-gate	$(LINK.c) -o kwtest kwtest.o err.o fn.o lut.o $(LDLIBS)
1110Sstevel@tonic-gate	$(POST_PROCESS)
1120Sstevel@tonic-gate
1130Sstevel@tonic-gateluttest: luttest.o err.o
1140Sstevel@tonic-gate	$(LINK.c) -o luttest luttest.o err.o $(LDLIBS)
1150Sstevel@tonic-gate	$(POST_PROCESS)
1160Sstevel@tonic-gate
1170Sstevel@tonic-gateoptstest: optstest.o err.o fn.o lut.o
1180Sstevel@tonic-gate	$(LINK.c) -o optstest optstest.o err.o fn.o lut.o $(LDLIBS)
1190Sstevel@tonic-gate	$(POST_PROCESS)
120