kill /usr/sadm
[unleashed.git] / usr / src / cmd / Makefile.cmd
blob9488235ed976c3f1e7eaf13ed7c2488a31c1be07
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 2014 Garrett D'Amore <garrett@damore.org>
23 # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
25 # Definitions common to command source.
27 # include global definitions; SRC should be defined in the shell.
28 # SRC is needed until RFE 1026993 is implemented.
30 include $(SRC)/Makefile.master
32 LN= ln
33 SH= sh
34 ECHO= echo
35 MKDIR= mkdir
36 TOUCH= touch
38 FILEMODE= 0555
39 LIBFILEMODE= 0444
41 KRB5DIR= $(ROOT)/usr
42 KRB5BIN= $(KRB5DIR)/bin
43 KRB5SBIN= $(KRB5DIR)/sbin
44 KRB5LIB= $(KRB5DIR)/lib/krb5
45 KRB5RUNPATH= /usr/lib/krb5
46 GSSRUNPATH= /usr/lib/gss
49 ROOTBIN= $(ROOT)/usr/bin
50 ROOTLIB= $(ROOT)/usr/lib
51 ROOTLIBSVCBIN= $(ROOT)/lib/svc/bin
52 ROOTLIBSVCMETHOD= $(ROOT)/lib/svc/method
53 ROOTLIBZONES= $(ROOT)/lib/zones
55 ROOTSHLIB= $(ROOT)/usr/share/lib
57 ROOTSHLIBCCS= $(ROOTSHLIB)/ccs
58 ROOTSBIN= $(ROOT)/sbin
59 ROOTUSRSBIN= $(ROOT)/usr/sbin
60 ROOTETC= $(ROOT)/etc
62 ROOTETCSECURITY= $(ROOTETC)/security
63 ROOTETCSECLIB= $(ROOTETCSECURITY)/lib
64 ROOTETCZONES= $(ROOTETC)/zones
66 ROOTETCFTPD= $(ROOT)/etc/ftpd
67 ROOTETCINET= $(ROOT)/etc/inet
68 ROOTCCSBIN= $(ROOT)/usr/ccs/bin
69 ROOTCCSBIN64= $(ROOTCCSBIN)/$(MACH64)
70 ROOTCCSBINLINKDIR= $(ROOT)/../../bin
71 ROOTCCSBINLINKDIR64= $(ROOT)../../../bin/$(MACH)
72 ROOTCCSLIB= $(ROOT)/usr/ccs/lib
73 ROOTBIN32= $(ROOTBIN)/$(MACH32)
74 ROOTBIN64= $(ROOTBIN)/$(MACH64)
75 ROOTCMDDIR64= $(ROOTCMDDIR)/$(MACH64)
76 ROOTLIB64= $(ROOTLIB)/$(MACH64)
77 ROOTUSRSBIN32= $(ROOTUSRSBIN)/$(MACH32)
78 ROOTUSRSBIN64= $(ROOTUSRSBIN)/$(MACH64)
79 ROOTMAN= $(ROOT)/usr/share/man
80 ROOTMAN1= $(ROOTMAN)/man1
81 ROOTMAN1M= $(ROOTMAN)/man1m
82 ROOTMAN3= $(ROOTMAN)/man3
83 ROOTVARSMB= $(ROOT)/var/smb
87 # Like ROOTLIBDIR in $(SRC)/Makefile.lib, any lower-level Makefiles that
88 # put their binaries in a non-standard location should reset this and use
89 # $(ROOTCMD) in their `install' target. By default we set this to a bogus
90 # value so that it will not conflict with any of the other values already
91 # defined in this Makefile.
93 ROOTCMDDIR= $(ROOT)/__nonexistent_directory__
95 ROOTSHAUDIO= $(ROOT)/usr/share/audio
96 ROOTAUDIOSAMP= $(ROOTSHAUDIO)/samples
97 ROOTAUDIOSAMPAU=$(ROOTAUDIOSAMP)/au
99 ISAEXEC= $(ROOT)/usr/lib/isaexec
100 PLATEXEC= $(ROOT)/usr/lib/platexec
102 LDLIBS = $(LDLIBS.cmd)
104 LDFLAGS.cmd = \
105 $(BDIRECT) $(ENVLDFLAGS1) $(ENVLDFLAGS2) $(ENVLDFLAGS3) \
106 $(MAPFILE.PGA:%=-Wl,-M%)
108 LDFLAGS = $(LDFLAGS.cmd)
111 KRB5PROG= $(PROG:%=$(KRB5BIN)/%)
112 KRB5SBINPROG= $(PROG:%=$(KRB5SBIN)/%)
113 KRB5LIBPROG= $(PROG:%=$(KRB5LIB)/%)
115 ROOTPROG= $(PROG:%=$(ROOTBIN)/%)
116 ROOTCMD= $(PROG:%=$(ROOTCMDDIR)/%)
117 ROOTSHFILES= $(SHFILES:%=$(ROOTBIN)/%)
118 ROOTLIBPROG= $(PROG:%=$(ROOTLIB)/%)
119 ROOTLIBSHFILES= $(SHFILES:%=$(ROOTLIB)/%)
120 ROOTSHLIBPROG= $(PROG:%=$(ROOTSHLIB)/%)
121 ROOTSBINPROG= $(PROG:%=$(ROOTSBIN)/%)
122 ROOTUSRSBINPROG=$(PROG:%=$(ROOTUSRSBIN)/%)
123 ROOTUSRSBINSCRIPT=$(SCRIPT:%=$(ROOTUSRSBIN)/%)
124 ROOTETCPROG= $(PROG:%=$(ROOTETC)/%)
125 ROOTCCSBINPROG= $(PROG:%=$(ROOTCCSBIN)/%)
126 ROOTCCSBINPROG64= $(PROG:%=$(ROOTCCSBIN64)/%)
127 ROOTCCSBINLINK=$(PROG:%= $(ROOTCCSBINLINKDIR)/%)
128 ROOTCCSBINLINK64=$(PROG:%=$(ROOTCCSBINLINKDIR64)/%)
129 ROOTLOCALEPROG= $(PROG:%=$(ROOTLOCALEDEF)/%)
130 ROOTPROG64= $(PROG:%=$(ROOTBIN64)/%)
131 ROOTPROG32= $(PROG:%=$(ROOTBIN32)/%)
132 ROOTCMD64= $(PROG:%=$(ROOTCMDDIR64)/%)
133 ROOTUSRSBINPROG32= $(PROG:%=$(ROOTUSRSBIN32)/%)
134 ROOTUSRSBINPROG64= $(PROG:%=$(ROOTUSRSBIN64)/%)
135 ROOTMAN1FILES= $(MAN1FILES:%=$(ROOTMAN1)/%)
136 $(ROOTMAN1FILES) := FILEMODE= 444
137 ROOTMAN1MFILES= $(MAN1MFILES:%=$(ROOTMAN1M)/%)
138 $(ROOTMAN1MFILES) := FILEMODE= 444
139 ROOTMAN3FILES= $(MAN3FILES:%=$(ROOTMAN3)/%)
140 $(ROOTMAN3FILES) := FILEMODE= 444
142 # Symlink rules for /usr/ccs/bin commands. Note, those commands under
143 # the rule of the linker area, are controlled by a different set of
144 # rules defined in $(SRC)/cmd/sgs/Makefile.var.
146 INS.ccsbinlink= \
147 $(RM) $(ROOTCCSBINPROG); \
148 $(SYMLINK) ../../bin/$(PROG) $(ROOTCCSBINPROG)
150 INS.ccsbinlink64= \
151 $(RM) $(ROOTCCSBINPROG64); \
152 $(SYMLINK) ../../../bin/$(MACH64)/$(PROG) $(ROOTCCSBINPROG64)
154 ROOTETCDEFAULT= $(ROOTETC)/default
155 ROOTETCDEFAULTFILES= $(DEFAULTFILES:%.dfl=$(ROOTETCDEFAULT)/%)
156 $(ROOTETCDEFAULTFILES) := FILEMODE = 0644
158 ROOTETCSECFILES= $(ETCSECFILES:%=$(ROOTETCSECURITY)/%)
159 $(ROOTETCSECFILES) := FILEMODE = 0644
161 ROOTETCSECLIBFILES= $(ETCSECLIBFILES:%=$(ROOTETCSECLIB)/%)
163 ROOTETCZONESFILES= $(ETCZONESFILES:%=$(ROOTETCZONES)/%)
164 $(ROOTETCZONESFILES) := FILEMODE = 0444
166 ROOTLIBZONESFILES= $(LIBZONESFILES:%=$(ROOTLIBZONES)/%)
167 $(ROOTLIBZONESFILES) := FILEMODE = 0555
170 # Directories for smf(5) service manifests and profiles.
172 ROOTSVC= $(ROOT)/lib/svc
173 ROOTETCSVC= $(ROOT)/etc/svc
175 ROOTSVCMANIFEST= $(ROOTSVC)/manifest
176 ROOTSVCPROFILE= $(ROOTETCSVC)/profile
178 ROOTSVCMILESTONE= $(ROOTSVCMANIFEST)/milestone
179 ROOTSVCDEVICE= $(ROOTSVCMANIFEST)/device
180 ROOTSVCSYSTEM= $(ROOTSVCMANIFEST)/system
181 ROOTSVCSYSTEMDEVICE= $(ROOTSVCSYSTEM)/device
182 ROOTSVCSYSTEMFILESYSTEM= $(ROOTSVCSYSTEM)/filesystem
183 ROOTSVCSYSTEMSECURITY= $(ROOTSVCSYSTEM)/security
184 ROOTSVCNETWORK= $(ROOTSVCMANIFEST)/network
185 ROOTSVCNETWORKDNS= $(ROOTSVCNETWORK)/dns
186 ROOTSVCNETWORKISCSI= $(ROOTSVCNETWORK)/iscsi
187 ROOTSVCNETWORKLDAP= $(ROOTSVCNETWORK)/ldap
188 ROOTSVCNETWORKNFS= $(ROOTSVCNETWORK)/nfs
189 ROOTSVCNETWORKNIS= $(ROOTSVCNETWORK)/nis
190 ROOTSVCNETWORKROUTING= $(ROOTSVCNETWORK)/routing
191 ROOTSVCNETWORKRPC= $(ROOTSVCNETWORK)/rpc
192 ROOTSVCNETWORKSMB= $(ROOTSVCNETWORK)/smb
193 ROOTSVCNETWORKSECURITY= $(ROOTSVCNETWORK)/security
194 ROOTSVCNETWORKIPSEC= $(ROOTSVCNETWORK)/ipsec
195 ROOTSVCNETWORKSHARES= $(ROOTSVCNETWORK)/shares
196 ROOTSVCSMB= $(ROOTSVCNETWORK)/smb
197 ROOTSVCPLATFORM= $(ROOTSVCMANIFEST)/platform
198 ROOTSVCPLATFORMSUN4U= $(ROOTSVCPLATFORM)/sun4u
199 ROOTSVCPLATFORMSUN4V= $(ROOTSVCPLATFORM)/sun4v
200 ROOTSVCAPPLICATION= $(ROOTSVCMANIFEST)/application
201 ROOTSVCAPPLICATIONMANAGEMENT= $(ROOTSVCAPPLICATION)/management
202 ROOTSVCAPPLICATIONSECURITY= $(ROOTSVCAPPLICATION)/security
203 ROOTSVCAPPLICATIONPRINT= $(ROOTSVCAPPLICATION)/print
206 # Commands Makefiles delivering a manifest are expected to define MANIFEST.
208 # Like ROOTCMDDIR, any lower-level Makefiles that put their manifests in a
209 # subdirectory of the manifest directories listed above should reset
210 # ROOTMANIFESTDIR and use it in their `install' target. By default we set this
211 # to a bogus value so that it will not conflict with any of the other values
212 # already defined in this Makefile.
214 # The manifest validation of the $SRC/cmd check target is also derived from a
215 # valid MANIFEST setting.
217 ROOTMANIFESTDIR= $(ROOTSVCMANIFEST)/__nonexistent_directory__
218 ROOTMANIFEST= $(MANIFEST:%=$(ROOTMANIFESTDIR)/%)
219 CHKMANIFEST= $(MANIFEST:%.xml=%.xmlchk)
221 # Manifests cannot be checked in parallel, because we are using the global
222 # repository that is in $(SRC)/cmd/svc/seed/global.db. This is a
223 # repository that is built from the manifests in this workspace, whereas
224 # the build machine's repository may be out of sync with these manifests.
225 # Because we are using a private repository, svccfg-native must start up a
226 # private copy of configd-native. We cannot have multiple copies of
227 # configd-native trying to access global.db simultaneously.
229 .NO_PARALLEL: $(CHKMANIFEST)
232 # For installing "starter scripts" of services
235 ROOTSVCMETHOD= $(SVCMETHOD:%=$(ROOTLIBSVCMETHOD)/%)
237 ROOTSVCBINDIR= $(ROOTLIBSVCBIN)/__nonexistent_directory__
238 ROOTSVCBIN= $(SVCBIN:%=$(ROOTSVCBINDIR)/%)
242 # For programs that are installed in the root filesystem,
243 # build $(ROOTFS_PROG) rather than $(PROG)
244 $(ROOTFS_PROG) := LDFLAGS += -Wl,-I/lib/ld.so.1
246 $(KRB5BIN)/%: %
247 $(INS.file)
249 $(KRB5SBIN)/%: %
250 $(INS.file)
252 $(KRB5LIB)/%: %
253 $(INS.file)
255 $(ROOTBIN)/%: %
256 $(INS.file)
258 $(ROOTLIB)/%: %
259 $(INS.file)
261 $(ROOTBIN64)/%: %
262 $(INS.file)
264 $(ROOTLIB64)/%: %
265 $(INS.file)
267 $(ROOTBIN32)/%: %
268 $(INS.file)
270 $(ROOTSHLIB)/%: %
271 $(INS.file)
273 $(ROOTSBIN)/%: %
274 $(INS.file)
276 $(ROOTUSRSBIN)/%: %
277 $(INS.file)
279 $(ROOTUSRSBIN32)/%: %
280 $(INS.file)
282 $(ROOTUSRSBIN64)/%: %
283 $(INS.file)
285 $(ROOTETC)/%: %
286 $(INS.file)
288 $(ROOTETCFTPD)/%: %
289 $(INS.file)
291 $(ROOTETCINET)/%: %
292 $(INS.file)
294 $(ROOTETCDEFAULT)/%: %.dfl
295 $(INS.rename)
297 $(ROOTETCSECLIB)/%: %
298 $(INS.file)
300 $(ROOTETCZONES)/%: %
301 $(INS.file)
303 $(ROOTLIBZONES)/%: %
304 $(INS.file)
306 $(ROOTLOCALEDEF)/%: %
307 $(INS.file)
309 $(ROOTCHARMAP)/%: %
310 $(INS.file)
312 $(ROOTI18NEXT)/%: %
313 $(INS.file)
315 $(ROOTI18NEXT64)/%: %
316 $(INS.file)
318 $(ROOTLIBSVCMETHOD)/%: %
319 $(INS.file)
321 $(ROOTLIBSVCBIN)/%: %
322 $(INS.file)
324 $(ROOTSVCMILESTONE)/%: %
325 $(INS.file)
327 $(ROOTSVCDEVICE)/%: %
328 $(INS.file)
330 $(ROOTSVCSYSTEM)/%: %
331 $(INS.file)
333 $(ROOTSVCSYSTEMDEVICE)/%: %
334 $(INS.file)
336 $(ROOTSVCSYSTEMFILESYSTEM)/%: %
337 $(INS.file)
339 $(ROOTSVCSYSTEMSECURITY)/%: %
340 $(INS.file)
342 $(ROOTSVCNETWORK)/%: %
343 $(INS.file)
345 $(ROOTSVCNETWORKLDAP)/%: %
346 $(INS.file)
348 $(ROOTSVCNETWORKNFS)/%: %
349 $(INS.file)
351 $(ROOTSVCNETWORKNIS)/%: %
352 $(INS.file)
354 $(ROOTSVCNETWORKRPC)/%: %
355 $(INS.file)
357 $(ROOTSVCNETWORKSECURITY)/%: %
358 $(INS.file)
360 $(ROOTSVCNETWORKIPSEC)/%: %
361 $(INS.file)
363 $(ROOTSVCNETWORKSHARES)/%: %
364 $(INS.file)
366 $(ROOTSVCNETWORKSMB)/%: %
367 $(INS.file)
369 $(ROOTSVCAPPLICATION)/%: %
370 $(INS.file)
372 $(ROOTSVCAPPLICATIONMANAGEMENT)/%: %
373 $(INS.file)
375 $(ROOTSVCAPPLICATIONSECURITY)/%: %
376 $(INS.file)
378 $(ROOTSVCAPPLICATIONPRINT)/%: %
379 $(INS.file)
381 $(ROOTSVCPLATFORM)/%: %
382 $(INS.file)
384 $(ROOTSVCPLATFORMSUN4U)/%: %
385 $(INS.file)
387 $(ROOTSVCPLATFORMSUN4V)/%: %
388 $(INS.file)
390 # Install rule for gprof, yacc, and lex dependency files
391 $(ROOTSHLIBCCS)/%: ../common/%
392 $(INS.file)
394 $(ROOTCCSBINLINKDIR)/%: %
395 $(INS.ccsbinlink)
397 $(ROOTCCSBINLINKDIR64)/%: %
398 $(INS.ccsbinlink64)
400 $(ROOTVARSMB)/%: %
401 $(INS.file)
403 # build rule for statically linked programs with single source file.
404 %.static: %.c
405 $(LINK.c) -o $@ $< $(LDLIBS)
406 $(POST_PROCESS)
408 # Define the majority text domain in this directory.
409 TEXT_DOMAIN= SUNW_OST_OSCMD
411 CLOBBERFILES += $(DCFILE)
413 # This flag is for programs which should not build a 32-bit binary
414 sparc_64ONLY= $(POUND_SIGN)
415 64ONLY= $($(MACH)_64ONLY)