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