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