xref: /illumos-gate/usr/src/cmd/saf/Makefile (revision 996aa816)
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 2006 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26#
27
28PROG= sac sacadm pmadm
29
30MANIFEST = sac.xml
31
32include ../Makefile.cmd
33
34ROOTMANIFESTDIR = $(ROOTSVCSYSTEM)
35
36SACOBJ= sac.o readtab.o global.o log.o misc.o
37SACOBJS= $(SACOBJ) util1.o
38SACADMOBJ= sacadm.o admutil.o
39SACADMOBJS= $(SACADMOBJ) util2.o
40PMADMOBJ= pmadm.o admutil.o
41PMADMOBJS= $(PMADMOBJ) util2.o
42SACSRC= $(SACOBJ:%.o=%.c)
43SACSRCS= $(SACSRC) util.c
44SACADMSRC= $(SACADMOBJ:%.o=%.c)
45SACADMSRCS= $(SACADMSRC) util.c
46PMADMSRC= $(PMADMOBJ:%.o=%.c)
47PMADMSRCS= $(PMADMSRC) util.c
48OBJS= $(SACOBJS) $(SACADMOBJS) $(PMADMOBJS)
49
50LIBSAFD = $(ROOTLIB)/saf
51DIRS= $(LIBSAFD)
52SACF= sac
53ADMF= sacadm pmadm
54ROOTSACF= $(SACF:%=$(LIBSAFD)/%)
55ROOTADMF= $(ADMF:%=$(ROOTUSRSBIN)/%)
56
57LDLIBS += -lnsl
58LINTFLAGS += -b -x
59OWNER= root
60GROUP= sys
61
62util1.o := CPPFLAGS += -DSAC
63util2.o := CPPFLAGS += -USAC
64
65sac :=	LDLIBS += -lpam
66
67$(ROOTUSRSBIN)/sacadm :=	FILEMODE =	04755
68
69$(LIBSAFD)/% : %
70	$(INS.file)
71
72.KEEP_STATE:
73
74.PARALLEL: $(OBJS)
75
76all: $(PROG)
77
78sac: $(SACOBJS)
79	$(LINK.c) $(SACOBJS) -o $@ $(LDLIBS)
80	$(POST_PROCESS)
81
82sacadm: $(SACADMOBJS)
83	$(LINK.c) $(SACADMOBJS) -o $@ $(LDLIBS)
84	$(POST_PROCESS)
85
86pmadm: $(PMADMOBJS)
87	$(LINK.c) $(PMADMOBJS) -o $@ $(LDLIBS)
88	$(POST_PROCESS)
89
90util1.o: util.c
91	$(COMPILE.c) -o $@ util.c
92
93util2.o: util.c
94	$(COMPILE.c) -o $@ util.c
95
96install: all .WAIT $(ROOTSACF) $(ROOTADMF) $(ROOTMANIFEST)
97
98# Don't install dirs already installed by Targetdirs
99#$(DIRS):
100#	$(INS.dir)
101
102check:	$(CHKMANIFEST)
103
104clean:
105	$(RM) $(OBJS)
106
107lint:
108	$(LINT.c) $(SACSRCS)
109	$(LINT.c) $(SACADMSRCS)
110	$(LINT.c) $(PMADMSRCS)
111
112include ../Makefile.targ
113