xref: /illumos-gate/usr/src/cmd/logadm/Makefile (revision a5619348a00282a0a129610076aefdb4dd7ab2ab)
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
36CERRWARN += -_gcc=-Wno-parentheses
37CERRWARN += -_gcc=-Wno-clobbered
38XGETFLAGS += -a -x logadm.xcl
39
40$(ROOTETC)/$(CONFIGFILE):= FILEMODE= 644
41
42CLOBBERFILES += $(TESTS)
43
44LOGADMDIR = $(ROOT)/etc/logadm.d
45
46MFSTFILES =	logadm-upgrade.xml
47MANIFESTDIR =	$(ROOT)/lib/svc/manifest/system
48MANIFEST =	$(MFSTFILES:%=$(MANIFESTDIR)/%)
49$(MANIFEST) :=	FILEMODE = 0444
50
51METHODFILES =	logadm-upgrade
52METHODDIR =	$(ROOT)/lib/svc/method
53METHOD =	$(METHODFILES:%=$(METHODDIR)/%)
54$(METHOD) :=	FILEMODE = 0555
55
56.KEEP_STATE:
57
58all: $(PROG)
59
60test: $(TESTS) $(PROG)
61	$(PERL) -w ./tester `pwd`
62
63$(PROG): $(OBJS)
64	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
65	$(POST_PROCESS)
66
67install: all $(ROOTUSRSBINPROG) $(ROOTETC)/$(CONFIGFILE) $(LOGADMDIR) \
68             $(MANIFESTDIR) $(MANIFEST) $(METHODDIR) $(METHOD)
69
70$(LOGADMDIR):
71	$(INS.dir)
72
73$(MANIFESTDIR):
74	$(INS.dir)
75
76$(MANIFESTDIR)/% : %
77	$(INS.file)
78
79$(METHODDIR):
80	$(INS.dir)
81
82$(METHODDIR)/% : %
83	$(INS.file)
84
85$(POFILE): $(POFILES)
86	$(RM) $@
87	cat $(POFILES) > $@
88
89clean:
90	$(RM) $(OBJS) $(TESTOBJS)
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