xref: /illumos-gate/usr/src/cmd/saf/Makefile (revision b30d193948be5a7794d7ae3ba0ed9c2f72c88e0f)
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# Copyright (c) 2018, Joyent, Inc.
26
27PROG= sac sacadm pmadm
28
29MANIFEST = sac.xml
30
31include ../Makefile.cmd
32
33ROOTMANIFESTDIR = $(ROOTSVCSYSTEM)
34
35SACOBJ= sac.o readtab.o global.o log.o misc.o
36SACOBJS= $(SACOBJ) util1.o
37SACADMOBJ= sacadm.o admutil.o
38SACADMOBJS= $(SACADMOBJ) util2.o
39PMADMOBJ= pmadm.o admutil.o
40PMADMOBJS= $(PMADMOBJ) util2.o
41SACSRC= $(SACOBJ:%.o=%.c)
42SACSRCS= $(SACSRC) util.c
43SACADMSRC= $(SACADMOBJ:%.o=%.c)
44SACADMSRCS= $(SACADMSRC) util.c
45PMADMSRC= $(PMADMOBJ:%.o=%.c)
46PMADMSRCS= $(PMADMSRC) util.c
47OBJS= $(SACOBJS) $(SACADMOBJS) $(PMADMOBJS)
48
49LIBSAFD = $(ROOTLIB)/saf
50DIRS= $(LIBSAFD)
51SACF= sac
52ADMF= sacadm pmadm
53ROOTSACF= $(SACF:%=$(LIBSAFD)/%)
54ROOTADMF= $(ADMF:%=$(ROOTUSRSBIN)/%)
55
56LDLIBS += -lnsl
57LDFLAGS += $(MAPFILE.NGB:%=-Wl,-M%)
58
59CERRWARN += -_gcc=-Wno-implicit-function-declaration
60CERRWARN += -_gcc=-Wno-parentheses
61CERRWARN += -_gcc=-Wno-unused-variable
62CERRWARN += -_gcc=-Wno-extra
63
64# too many untyped funcs
65SMATCH=off
66
67util1.o := CPPFLAGS += -DSAC
68util2.o := CPPFLAGS += -USAC
69
70sac :=	LDLIBS += -lpam
71
72$(ROOTUSRSBIN)/sacadm :=	FILEMODE =	04755
73
74$(LIBSAFD)/% : %
75	$(INS.file)
76
77.KEEP_STATE:
78
79.PARALLEL: $(OBJS)
80
81all: $(PROG)
82
83sac: $(SACOBJS) $(MAPFILE.NGB)
84	$(LINK.c) $(SACOBJS) -o $@ $(LDLIBS)
85	$(POST_PROCESS)
86
87sacadm: $(SACADMOBJS) $(MAPFILE.NGB)
88	$(LINK.c) $(SACADMOBJS) -o $@ $(LDLIBS)
89	$(POST_PROCESS)
90
91pmadm: $(PMADMOBJS) $(MAPFILE.NGB)
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
112include ../Makefile.targ
113