xref: /titanic_41/usr/src/cmd/logadm/Makefile (revision 2449e17f82f6097fd2c665b64723e31ceecbeca6)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28
29PROG= logadm
30TESTS= conftest globtest kwtest luttest optstest
31OBJS= conf.o err.o fn.o glob.o kw.o lut.o main.o opts.o
32TESTOBJS= $(TESTS:%=%.o)
33SRCS= $(OBJS:%.o=%.c)
34POFILES= $(OBJS:%.o=%.po)
35CONFIGFILE= logadm.conf
36
37include ../Makefile.cmd
38
39CPPFLAGS += -D_FILE_OFFSET_BITS=64
40XGETFLAGS += -a -x logadm.xcl
41
42$(ROOTETC)/$(CONFIGFILE):= FILEMODE= 644
43$(ROOTETC)/$(CONFIGFILE):= OWNER= root
44$(ROOTETC)/$(CONFIGFILE):= GROUP= sys
45
46CLOBBERFILES += $(TESTS)
47
48.KEEP_STATE:
49
50all: $(PROG)
51
52test: $(TESTS) $(PROG)
53	./tester `pwd`
54
55$(PROG): $(OBJS)
56	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
57	$(POST_PROCESS)
58
59install: all $(ROOTUSRSBINPROG) $(ROOTETC)/$(CONFIGFILE)
60
61$(POFILE): $(POFILES)
62	$(RM) $@
63	cat $(POFILES) > $@
64
65clean:
66	$(RM) $(OBJS) $(TESTOBJS)
67
68lint: lint_SRCS
69
70include ../Makefile.targ
71
72#
73# dependencies for various test programs built from same source
74#
75%test.o: %.c
76	$(COMPILE.c) -DTESTMODULE -o $@ $<
77	$(POST_PROCESS_O)
78
79conftest: conftest.o err.o fn.o lut.o opts.o
80	$(LINK.c) -o conftest conftest.o err.o fn.o lut.o opts.o $(LDLIBS)
81	$(POST_PROCESS)
82
83globtest: globtest.o lut.o err.o fn.o
84	$(LINK.c) -o globtest globtest.o lut.o err.o fn.o $(LDLIBS)
85	$(POST_PROCESS)
86
87kwtest: kwtest.o err.o fn.o lut.o
88	$(LINK.c) -o kwtest kwtest.o err.o fn.o lut.o $(LDLIBS)
89	$(POST_PROCESS)
90
91luttest: luttest.o err.o
92	$(LINK.c) -o luttest luttest.o err.o $(LDLIBS)
93	$(POST_PROCESS)
94
95optstest: optstest.o err.o fn.o lut.o
96	$(LINK.c) -o optstest optstest.o err.o fn.o lut.o $(LDLIBS)
97	$(POST_PROCESS)
98