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