xref: /titanic_41/usr/src/cmd/saf/Makefile (revision 31ceb98b622e1a310256f4c4a1472beb92046db3)
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 2007 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
58LDFLAGS += $(MAPFILE.NGB:%=-M%)
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$(LIBSAFD)/% : %
71	$(INS.file)
72
73.KEEP_STATE:
74
75.PARALLEL: $(OBJS)
76
77all: $(PROG)
78
79sac: $(SACOBJS) $(MAPFILE.NGB)
80	$(LINK.c) $(SACOBJS) -o $@ $(LDLIBS)
81	$(POST_PROCESS)
82
83sacadm: $(SACADMOBJS) $(MAPFILE.NGB)
84	$(LINK.c) $(SACADMOBJS) -o $@ $(LDLIBS)
85	$(POST_PROCESS)
86
87pmadm: $(PMADMOBJS) $(MAPFILE.NGB)
88	$(LINK.c) $(PMADMOBJS) -o $@ $(LDLIBS)
89	$(POST_PROCESS)
90
91util1.o: util.c
92	$(COMPILE.c) -o $@ util.c
93
94util2.o: util.c
95	$(COMPILE.c) -o $@ util.c
96
97install: all .WAIT $(ROOTSACF) $(ROOTADMF) $(ROOTMANIFEST)
98
99# Don't install dirs already installed by Targetdirs
100#$(DIRS):
101#	$(INS.dir)
102
103check:	$(CHKMANIFEST)
104
105clean:
106	$(RM) $(OBJS)
107
108lint:
109	$(LINT.c) $(SACSRCS)
110	$(LINT.c) $(SACADMSRCS)
111	$(LINT.c) $(PMADMSRCS)
112
113include ../Makefile.targ
114