xref: /titanic_50/usr/src/cmd/logadm/Makefile (revision e9a193fce9f1bf8520f55929577e0175e1e7625b)
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
367c478bd9Sstevel@tonic-gateXGETFLAGS += -a -x logadm.xcl
377c478bd9Sstevel@tonic-gate
387c478bd9Sstevel@tonic-gate$(ROOTETC)/$(CONFIGFILE):= FILEMODE= 644
397c478bd9Sstevel@tonic-gate
407c478bd9Sstevel@tonic-gateCLOBBERFILES += $(TESTS)
417c478bd9Sstevel@tonic-gate
42f6e214c7SGavin MaltbyLOGADMDIR = $(ROOT)/etc/logadm.d
43f6e214c7SGavin Maltby
44f6e214c7SGavin MaltbyMFSTFILES =	logadm-upgrade.xml
45f6e214c7SGavin MaltbyMANIFESTDIR =	$(ROOT)/lib/svc/manifest/system
46f6e214c7SGavin MaltbyMANIFEST =	$(MFSTFILES:%=$(MANIFESTDIR)/%)
47f6e214c7SGavin Maltby$(MANIFEST) :=	FILEMODE = 0444
48f6e214c7SGavin Maltby
49f6e214c7SGavin MaltbyMETHODFILES =	logadm-upgrade
50f6e214c7SGavin MaltbyMETHODDIR =	$(ROOT)/lib/svc/method
51f6e214c7SGavin MaltbyMETHOD =	$(METHODFILES:%=$(METHODDIR)/%)
52f6e214c7SGavin Maltby$(METHOD) :=	FILEMODE = 0555
53f6e214c7SGavin Maltby
547c478bd9Sstevel@tonic-gate.KEEP_STATE:
557c478bd9Sstevel@tonic-gate
567c478bd9Sstevel@tonic-gateall: $(PROG)
577c478bd9Sstevel@tonic-gate
587c478bd9Sstevel@tonic-gatetest: $(TESTS) $(PROG)
59*e9a193fcSJohn.Zolnowsky@Sun.COM	$(PERL) -w ./tester `pwd`
607c478bd9Sstevel@tonic-gate
617c478bd9Sstevel@tonic-gate$(PROG): $(OBJS)
627c478bd9Sstevel@tonic-gate	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
637c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
647c478bd9Sstevel@tonic-gate
65f6e214c7SGavin Maltbyinstall: all $(ROOTUSRSBINPROG) $(ROOTETC)/$(CONFIGFILE) $(LOGADMDIR) \
66f6e214c7SGavin Maltby             $(MANIFESTDIR) $(MANIFEST) $(METHODDIR) $(METHOD)
67f6e214c7SGavin Maltby
68f6e214c7SGavin Maltby$(LOGADMDIR):
69f6e214c7SGavin Maltby	$(INS.dir)
70f6e214c7SGavin Maltby
71f6e214c7SGavin Maltby$(MANIFESTDIR):
72f6e214c7SGavin Maltby	$(INS.dir)
73f6e214c7SGavin Maltby
74f6e214c7SGavin Maltby$(MANIFESTDIR)/% : %
75f6e214c7SGavin Maltby	$(INS.file)
76f6e214c7SGavin Maltby
77f6e214c7SGavin Maltby$(METHODDIR):
78f6e214c7SGavin Maltby	$(INS.dir)
79f6e214c7SGavin Maltby
80f6e214c7SGavin Maltby$(METHODDIR)/% : %
81f6e214c7SGavin Maltby	$(INS.file)
827c478bd9Sstevel@tonic-gate
837c478bd9Sstevel@tonic-gate$(POFILE): $(POFILES)
847c478bd9Sstevel@tonic-gate	$(RM) $@
857c478bd9Sstevel@tonic-gate	cat $(POFILES) > $@
867c478bd9Sstevel@tonic-gate
877c478bd9Sstevel@tonic-gateclean:
887c478bd9Sstevel@tonic-gate	$(RM) $(OBJS) $(TESTOBJS)
897c478bd9Sstevel@tonic-gate
907c478bd9Sstevel@tonic-gatelint: lint_SRCS
917c478bd9Sstevel@tonic-gate
927c478bd9Sstevel@tonic-gateinclude ../Makefile.targ
937c478bd9Sstevel@tonic-gate
947c478bd9Sstevel@tonic-gate#
957c478bd9Sstevel@tonic-gate# dependencies for various test programs built from same source
967c478bd9Sstevel@tonic-gate#
977c478bd9Sstevel@tonic-gate%test.o: %.c
987c478bd9Sstevel@tonic-gate	$(COMPILE.c) -DTESTMODULE -o $@ $<
997c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
1007c478bd9Sstevel@tonic-gate
1017c478bd9Sstevel@tonic-gateconftest: conftest.o err.o fn.o lut.o opts.o
1027c478bd9Sstevel@tonic-gate	$(LINK.c) -o conftest conftest.o err.o fn.o lut.o opts.o $(LDLIBS)
1037c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1047c478bd9Sstevel@tonic-gate
1057c478bd9Sstevel@tonic-gateglobtest: globtest.o lut.o err.o fn.o
1067c478bd9Sstevel@tonic-gate	$(LINK.c) -o globtest globtest.o lut.o err.o fn.o $(LDLIBS)
1077c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1087c478bd9Sstevel@tonic-gate
1097c478bd9Sstevel@tonic-gatekwtest: kwtest.o err.o fn.o lut.o
1107c478bd9Sstevel@tonic-gate	$(LINK.c) -o kwtest kwtest.o err.o fn.o lut.o $(LDLIBS)
1117c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1127c478bd9Sstevel@tonic-gate
1137c478bd9Sstevel@tonic-gateluttest: luttest.o err.o
1147c478bd9Sstevel@tonic-gate	$(LINK.c) -o luttest luttest.o err.o $(LDLIBS)
1157c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1167c478bd9Sstevel@tonic-gate
1177c478bd9Sstevel@tonic-gateoptstest: optstest.o err.o fn.o lut.o
1187c478bd9Sstevel@tonic-gate	$(LINK.c) -o optstest optstest.o err.o fn.o lut.o $(LDLIBS)
1197c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
120