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