Merge illumos-gate
[unleashed.git] / usr / src / cmd / saf / Makefile
blobfafdd94638fe6f843f378295ffdcd6968d76187b
2 # CDDL HEADER START
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.
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.
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]
19 # CDDL HEADER END
22 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
25 # Copyright (c) 2018, Joyent, Inc.
27 PROG= sac sacadm pmadm
29 MANIFEST = sac.xml
31 include ../Makefile.cmd
33 ROOTMANIFESTDIR = $(ROOTSVCSYSTEM)
35 SACOBJ= sac.o readtab.o global.o log.o misc.o
36 SACOBJS= $(SACOBJ) util1.o
37 SACADMOBJ= sacadm.o admutil.o
38 SACADMOBJS= $(SACADMOBJ) util2.o
39 PMADMOBJ= pmadm.o admutil.o
40 PMADMOBJS= $(PMADMOBJ) util2.o
41 SACSRC= $(SACOBJ:%.o=%.c)
42 SACSRCS= $(SACSRC) util.c
43 SACADMSRC= $(SACADMOBJ:%.o=%.c)
44 SACADMSRCS= $(SACADMSRC) util.c
45 PMADMSRC= $(PMADMOBJ:%.o=%.c)
46 PMADMSRCS= $(PMADMSRC) util.c
47 OBJS= $(SACOBJS) $(SACADMOBJS) $(PMADMOBJS)
49 LIBSAFD = $(ROOTLIB)/saf
50 DIRS= $(LIBSAFD)
51 SACF= sac
52 ADMF= sacadm pmadm
53 ROOTSACF= $(SACF:%=$(LIBSAFD)/%)
54 ROOTADMF= $(ADMF:%=$(ROOTUSRSBIN)/%)
56 LDFLAGS += $(MAPFILE.NGB:%=-Wl,-M%)
58 CERRWARN += -Wno-parentheses
59 CERRWARN += -Wno-unused-variable
60 CERRWARN += -Wno-extra
62 # too many untyped funcs
63 SMATCH=off
65 util1.o := CPPFLAGS += -DSAC
66 util2.o := CPPFLAGS += -USAC
68 sac := LDLIBS += -lpam
70 $(ROOTUSRSBIN)/sacadm := FILEMODE = 04755
72 $(LIBSAFD)/% : %
73 $(INS.file)
75 .KEEP_STATE:
77 .PARALLEL: $(OBJS)
79 all: $(PROG)
81 sac: $(SACOBJS) $(MAPFILE.NGB)
82 $(LINK.c) $(SACOBJS) -o $@ $(LDLIBS)
83 $(POST_PROCESS)
85 sacadm: $(SACADMOBJS) $(MAPFILE.NGB)
86 $(LINK.c) $(SACADMOBJS) -o $@ $(LDLIBS)
87 $(POST_PROCESS)
89 pmadm: $(PMADMOBJS) $(MAPFILE.NGB)
90 $(LINK.c) $(PMADMOBJS) -o $@ $(LDLIBS)
91 $(POST_PROCESS)
93 util1.o: util.c
94 $(COMPILE.c) -o $@ util.c
96 util2.o: util.c
97 $(COMPILE.c) -o $@ util.c
99 install: all .WAIT $(ROOTSACF) $(ROOTADMF) $(ROOTMANIFEST)
101 # Don't install dirs already installed by Targetdirs
102 #$(DIRS):
103 # $(INS.dir)
105 check: $(CHKMANIFEST)
107 clean:
108 $(RM) $(OBJS)
110 include ../Makefile.targ