xref: /titanic_52/usr/src/cmd/saf/Makefile (revision e1d3217b9afde782c4d3e946fda0e6ef36a61306)
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
59CERRWARN += -_gcc=-Wno-implicit-function-declaration
60CERRWARN += -_gcc=-Wno-parentheses
61CERRWARN += -_gcc=-Wno-unused-variable
62CERRWARN += -_gcc=-Wno-extra
63
64util1.o := CPPFLAGS += -DSAC
65util2.o := CPPFLAGS += -USAC
66
67sac :=	LDLIBS += -lpam
68
69$(ROOTUSRSBIN)/sacadm :=	FILEMODE =	04755
70
71$(LIBSAFD)/% : %
72	$(INS.file)
73
74.KEEP_STATE:
75
76.PARALLEL: $(OBJS)
77
78all: $(PROG)
79
80sac: $(SACOBJS) $(MAPFILE.NGB)
81	$(LINK.c) $(SACOBJS) -o $@ $(LDLIBS)
82	$(POST_PROCESS)
83
84sacadm: $(SACADMOBJS) $(MAPFILE.NGB)
85	$(LINK.c) $(SACADMOBJS) -o $@ $(LDLIBS)
86	$(POST_PROCESS)
87
88pmadm: $(PMADMOBJS) $(MAPFILE.NGB)
89	$(LINK.c) $(PMADMOBJS) -o $@ $(LDLIBS)
90	$(POST_PROCESS)
91
92util1.o: util.c
93	$(COMPILE.c) -o $@ util.c
94
95util2.o: util.c
96	$(COMPILE.c) -o $@ util.c
97
98install: all .WAIT $(ROOTSACF) $(ROOTADMF) $(ROOTMANIFEST)
99
100# Don't install dirs already installed by Targetdirs
101#$(DIRS):
102#	$(INS.dir)
103
104check:	$(CHKMANIFEST)
105
106clean:
107	$(RM) $(OBJS)
108
109lint:
110	$(LINT.c) $(SACSRCS)
111	$(LINT.c) $(SACADMSRCS)
112	$(LINT.c) $(PMADMSRCS)
113
114include ../Makefile.targ
115