xref: /illumos-gate/usr/src/cmd/logadm/Makefile (revision 2ed5ea5a)
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
387c478bd9Sstevel@tonic-gateXGETFLAGS += -a -x logadm.xcl
397c478bd9Sstevel@tonic-gate
407c478bd9Sstevel@tonic-gate$(ROOTETC)/$(CONFIGFILE):= FILEMODE= 644
417c478bd9Sstevel@tonic-gate
427c478bd9Sstevel@tonic-gateCLOBBERFILES += $(TESTS)
437c478bd9Sstevel@tonic-gate
44f6e214c7SGavin MaltbyLOGADMDIR = $(ROOT)/etc/logadm.d
45f6e214c7SGavin Maltby
46f6e214c7SGavin MaltbyMFSTFILES =	logadm-upgrade.xml
47f6e214c7SGavin MaltbyMANIFESTDIR =	$(ROOT)/lib/svc/manifest/system
48f6e214c7SGavin MaltbyMANIFEST =	$(MFSTFILES:%=$(MANIFESTDIR)/%)
49f6e214c7SGavin Maltby$(MANIFEST) :=	FILEMODE = 0444
50f6e214c7SGavin Maltby
51f6e214c7SGavin MaltbyMETHODFILES =	logadm-upgrade
52f6e214c7SGavin MaltbyMETHODDIR =	$(ROOT)/lib/svc/method
53f6e214c7SGavin MaltbyMETHOD =	$(METHODFILES:%=$(METHODDIR)/%)
54f6e214c7SGavin Maltby$(METHOD) :=	FILEMODE = 0555
55f6e214c7SGavin Maltby
567c478bd9Sstevel@tonic-gate.KEEP_STATE:
577c478bd9Sstevel@tonic-gate
587c478bd9Sstevel@tonic-gateall: $(PROG)
597c478bd9Sstevel@tonic-gate
607c478bd9Sstevel@tonic-gatetest: $(TESTS) $(PROG)
61e9a193fcSJohn.Zolnowsky@Sun.COM	$(PERL) -w ./tester `pwd`
627c478bd9Sstevel@tonic-gate
637c478bd9Sstevel@tonic-gate$(PROG): $(OBJS)
647c478bd9Sstevel@tonic-gate	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
657c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
667c478bd9Sstevel@tonic-gate
67f6e214c7SGavin Maltbyinstall: all $(ROOTUSRSBINPROG) $(ROOTETC)/$(CONFIGFILE) $(LOGADMDIR) \
68f6e214c7SGavin Maltby             $(MANIFESTDIR) $(MANIFEST) $(METHODDIR) $(METHOD)
69f6e214c7SGavin Maltby
70f6e214c7SGavin Maltby$(LOGADMDIR):
71f6e214c7SGavin Maltby	$(INS.dir)
72f6e214c7SGavin Maltby
73f6e214c7SGavin Maltby$(MANIFESTDIR):
74f6e214c7SGavin Maltby	$(INS.dir)
75f6e214c7SGavin Maltby
76f6e214c7SGavin Maltby$(MANIFESTDIR)/% : %
77f6e214c7SGavin Maltby	$(INS.file)
78f6e214c7SGavin Maltby
79f6e214c7SGavin Maltby$(METHODDIR):
80f6e214c7SGavin Maltby	$(INS.dir)
81f6e214c7SGavin Maltby
82f6e214c7SGavin Maltby$(METHODDIR)/% : %
83f6e214c7SGavin Maltby	$(INS.file)
847c478bd9Sstevel@tonic-gate
857c478bd9Sstevel@tonic-gate$(POFILE): $(POFILES)
867c478bd9Sstevel@tonic-gate	$(RM) $@
877c478bd9Sstevel@tonic-gate	cat $(POFILES) > $@
887c478bd9Sstevel@tonic-gate
897c478bd9Sstevel@tonic-gateclean:
907c478bd9Sstevel@tonic-gate	$(RM) $(OBJS) $(TESTOBJS)
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