8672 proc_t changes broke genunix dmods and walker
[unleashed.git] / usr / src / cmd / Makefile.cmd
blobe00665a839a6bc06aa2a0bd9fe3fc67119749686
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 (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
24 # Definitions common to command source.
26 # include global definitions; SRC should be defined in the shell.
27 # SRC is needed until RFE 1026993 is implemented.
29 include $(SRC)/Makefile.master
31 LN= ln
32 SH= sh
33 ECHO= echo
34 MKDIR= mkdir
35 TOUCH= touch
37 FILEMODE= 0555
38 LIBFILEMODE= 0444
39 XPG4= $(XPG4PROG:%=%.xpg4)
40 XPG6= $(XPG6PROG:%=%.xpg6)
42 KRB5DIR= $(ROOT)/usr
43 KRB5BIN= $(KRB5DIR)/bin
44 KRB5SBIN= $(KRB5DIR)/sbin
45 KRB5LIB= $(KRB5DIR)/lib/krb5
46 KRB5RUNPATH= /usr/lib/krb5
47 GSSRUNPATH= /usr/lib/gss
50 ROOTBIN= $(ROOT)/usr/bin
51 ROOTLIB= $(ROOT)/usr/lib
52 ROOTLIBSVCBIN= $(ROOT)/lib/svc/bin
53 ROOTLIBSVCMETHOD= $(ROOT)/lib/svc/method
54 ROOTLIBXEN= $(ROOT)/usr/lib/xen/bin
55 ROOTLIBZONES= $(ROOT)/lib/zones
57 ROOTSHLIB= $(ROOT)/usr/share/lib
58 ROOTPKGBIN= $(ROOT)/usr/sadm/install/bin
59 ROOTCLASS_SCR_DIR= $(ROOT)/usr/sadm/install/scripts
60 ROOTADMIN_SRC_DIR= $(ROOT)/var/sadm/install/admin
62 ROOTSHLIBCCS= $(ROOTSHLIB)/ccs
63 ROOTSBIN= $(ROOT)/sbin
64 ROOTUSRSBIN= $(ROOT)/usr/sbin
65 ROOTETC= $(ROOT)/etc
67 ROOTETCSECURITY= $(ROOTETC)/security
68 ROOTETCTSOL= $(ROOTETCSECURITY)/tsol
69 ROOTETCSECLIB= $(ROOTETCSECURITY)/lib
70 ROOTETCZONES= $(ROOTETC)/zones
72 ROOTETCFTPD= $(ROOT)/etc/ftpd
73 ROOTETCINET= $(ROOT)/etc/inet
74 ROOTCCSBIN= $(ROOT)/usr/ccs/bin
75 ROOTCCSBIN64= $(ROOTCCSBIN)/$(MACH64)
76 ROOTCCSBINLINKDIR= $(ROOT)/../../bin
77 ROOTCCSBINLINKDIR64= $(ROOT)../../../bin/$(MACH)
78 ROOTCCSLIB= $(ROOT)/usr/ccs/lib
79 ROOTUSRKVM= $(ROOT)/usr/kvm
80 ROOTHAS= $(ROOT)/usr/has
81 ROOTHASBIN= $(ROOT)/usr/has/bin
82 ROOTHASLIB= $(ROOT)/usr/has/lib
83 ROOTXPG4= $(ROOT)/usr/xpg4
84 ROOTXPG4BIN= $(ROOT)/usr/xpg4/bin
85 ROOTXPG4BIN32= $(ROOTXPG4BIN)/$(MACH32)
86 ROOTXPG4BIN64= $(ROOTXPG4BIN)/$(MACH64)
87 ROOTXPG6= $(ROOT)/usr/xpg6
88 ROOTXPG6BIN= $(ROOT)/usr/xpg6/bin
89 ROOTLOCALEDEF= $(ROOT)/usr/lib/localedef
90 ROOTCHARMAP= $(ROOTLOCALEDEF)/charmap
91 ROOTI18NEXT= $(ROOTLOCALEDEF)/extensions
92 ROOTI18NEXT64= $(ROOTLOCALEDEF)/extensions/$(MACH64)
93 ROOTBIN32= $(ROOTBIN)/$(MACH32)
94 ROOTBIN64= $(ROOTBIN)/$(MACH64)
95 ROOTCMDDIR64= $(ROOTCMDDIR)/$(MACH64)
96 ROOTLIB64= $(ROOTLIB)/$(MACH64)
97 ROOTUSRSBIN32= $(ROOTUSRSBIN)/$(MACH32)
98 ROOTUSRSBIN64= $(ROOTUSRSBIN)/$(MACH64)
99 ROOTMAN= $(ROOT)/usr/share/man
100 ROOTMAN1= $(ROOTMAN)/man1
101 ROOTMAN1M= $(ROOTMAN)/man1m
102 ROOTMAN3= $(ROOTMAN)/man3
103 ROOTVARSMB= $(ROOT)/var/smb
107 # Like ROOTLIBDIR in $(SRC)/Makefile.lib, any lower-level Makefiles that
108 # put their binaries in a non-standard location should reset this and use
109 # $(ROOTCMD) in their `install' target. By default we set this to a bogus
110 # value so that it will not conflict with any of the other values already
111 # defined in this Makefile.
113 ROOTCMDDIR= $(ROOT)/__nonexistent_directory__
115 ROOTSHAUDIO= $(ROOT)/usr/share/audio
116 ROOTAUDIOSAMP= $(ROOTSHAUDIO)/samples
117 ROOTAUDIOSAMPAU=$(ROOTAUDIOSAMP)/au
119 ISAEXEC= $(ROOT)/usr/lib/isaexec
120 PLATEXEC= $(ROOT)/usr/lib/platexec
122 LDLIBS = $(LDLIBS.cmd)
124 LDFLAGS.cmd = \
125 $(BDIRECT) $(ENVLDFLAGS1) $(ENVLDFLAGS2) $(ENVLDFLAGS3) \
126 $(MAPFILE.NES:%=-M%) $(MAPFILE.PGA:%=-M%) $(MAPFILE.NED:%=-M%)
128 LDFLAGS = $(LDFLAGS.cmd)
130 LINTFLAGS= -axsm
131 LINTFLAGS64= -axsm -m64
132 LINTOUT= lint.out
134 KRB5PROG= $(PROG:%=$(KRB5BIN)/%)
135 KRB5SBINPROG= $(PROG:%=$(KRB5SBIN)/%)
136 KRB5LIBPROG= $(PROG:%=$(KRB5LIB)/%)
138 ROOTPROG= $(PROG:%=$(ROOTBIN)/%)
139 ROOTCMD= $(PROG:%=$(ROOTCMDDIR)/%)
140 ROOTSHFILES= $(SHFILES:%=$(ROOTBIN)/%)
141 ROOTLIBPROG= $(PROG:%=$(ROOTLIB)/%)
142 ROOTLIBSHFILES= $(SHFILES:%=$(ROOTLIB)/%)
143 ROOTSHLIBPROG= $(PROG:%=$(ROOTSHLIB)/%)
144 ROOTSBINPROG= $(PROG:%=$(ROOTSBIN)/%)
145 ROOTPKGBINPROG= $(PROG:%=$(ROOTPKGBIN)/%)
146 ROOTCLASS_SCR_FILES= $(SCRIPTS:%=$(ROOTCLASS_SCR_DIR)/%)
147 ROOTUSRSBINPROG=$(PROG:%=$(ROOTUSRSBIN)/%)
148 ROOTUSRSBINSCRIPT=$(SCRIPT:%=$(ROOTUSRSBIN)/%)
149 ROOTETCPROG= $(PROG:%=$(ROOTETC)/%)
150 ROOTHASBINPROG= $(PROG:%=$(ROOTHASBIN)/%)
151 ROOTHASLIBPROG= $(PROG:%=$(ROOTHASLIB)/%)
152 ROOTCCSBINPROG= $(PROG:%=$(ROOTCCSBIN)/%)
153 ROOTCCSBINPROG64= $(PROG:%=$(ROOTCCSBIN64)/%)
154 ROOTCCSBINLINK=$(PROG:%= $(ROOTCCSBINLINKDIR)/%)
155 ROOTCCSBINLINK64=$(PROG:%=$(ROOTCCSBINLINKDIR64)/%)
156 ROOTUSRKVMPROG= $(PROG:%=$(ROOTUSRKVM)/%)
157 ROOTXPG4PROG= $(XPG4PROG:%=$(ROOTXPG4BIN)/%)
158 ROOTXPG4PROG32= $(XPG4PROG:%=$(ROOTXPG4BIN32)/%)
159 ROOTXPG4PROG64= $(XPG4PROG:%=$(ROOTXPG4BIN64)/%)
160 ROOTXPG6PROG= $(XPG6PROG:%=$(ROOTXPG6BIN)/%)
161 ROOTLOCALEPROG= $(PROG:%=$(ROOTLOCALEDEF)/%)
162 ROOTPROG64= $(PROG:%=$(ROOTBIN64)/%)
163 ROOTPROG32= $(PROG:%=$(ROOTBIN32)/%)
164 ROOTCMD64= $(PROG:%=$(ROOTCMDDIR64)/%)
165 ROOTUSRSBINPROG32= $(PROG:%=$(ROOTUSRSBIN32)/%)
166 ROOTUSRSBINPROG64= $(PROG:%=$(ROOTUSRSBIN64)/%)
167 ROOTMAN1FILES= $(MAN1FILES:%=$(ROOTMAN1)/%)
168 $(ROOTMAN1FILES) := FILEMODE= 444
169 ROOTMAN1MFILES= $(MAN1MFILES:%=$(ROOTMAN1M)/%)
170 $(ROOTMAN1MFILES) := FILEMODE= 444
171 ROOTMAN3FILES= $(MAN3FILES:%=$(ROOTMAN3)/%)
172 $(ROOTMAN3FILES) := FILEMODE= 444
174 # Symlink rules for /usr/ccs/bin commands. Note, those commands under
175 # the rule of the linker area, are controlled by a different set of
176 # rules defined in $(SRC)/cmd/sgs/Makefile.var.
178 INS.ccsbinlink= \
179 $(RM) $(ROOTCCSBINPROG); \
180 $(SYMLINK) ../../bin/$(PROG) $(ROOTCCSBINPROG)
182 INS.ccsbinlink64= \
183 $(RM) $(ROOTCCSBINPROG64); \
184 $(SYMLINK) ../../../bin/$(MACH64)/$(PROG) $(ROOTCCSBINPROG64)
186 ROOTETCDEFAULT= $(ROOTETC)/default
187 ROOTETCDEFAULTFILES= $(DEFAULTFILES:%.dfl=$(ROOTETCDEFAULT)/%)
188 $(ROOTETCDEFAULTFILES) := FILEMODE = 0644
190 ROOTETCSECFILES= $(ETCSECFILES:%=$(ROOTETCSECURITY)/%)
191 $(ROOTETCSECFILES) := FILEMODE = 0644
193 ROOTETCTSOLFILES= $(ETCTSOLFILES:%=$(ROOTETCTSOL)/%)
194 $(ROOTETCTSOLFILES) := FILEMODE = 0644
196 ROOTETCSECLIBFILES= $(ETCSECLIBFILES:%=$(ROOTETCSECLIB)/%)
198 ROOTETCZONESFILES= $(ETCZONESFILES:%=$(ROOTETCZONES)/%)
199 $(ROOTETCZONESFILES) := FILEMODE = 0444
201 ROOTLIBZONESFILES= $(LIBZONESFILES:%=$(ROOTLIBZONES)/%)
202 $(ROOTLIBZONESFILES) := FILEMODE = 0555
204 ROOTADMIN_SRC_FILE= $(ADMINFILE:%=$(ROOTADMIN_SRC_DIR)/%)
205 $(ROOTADMIN_SRC_FILE) := FILEMODE = 0444
208 # Directories for smf(5) service manifests and profiles.
210 ROOTSVC= $(ROOT)/lib/svc
211 ROOTETCSVC= $(ROOT)/etc/svc
213 ROOTSVCMANIFEST= $(ROOTSVC)/manifest
214 ROOTSVCPROFILE= $(ROOTETCSVC)/profile
216 ROOTSVCMILESTONE= $(ROOTSVCMANIFEST)/milestone
217 ROOTSVCDEVICE= $(ROOTSVCMANIFEST)/device
218 ROOTSVCSYSTEM= $(ROOTSVCMANIFEST)/system
219 ROOTSVCSYSTEMDEVICE= $(ROOTSVCSYSTEM)/device
220 ROOTSVCSYSTEMFILESYSTEM= $(ROOTSVCSYSTEM)/filesystem
221 ROOTSVCSYSTEMSECURITY= $(ROOTSVCSYSTEM)/security
222 ROOTSVCNETWORK= $(ROOTSVCMANIFEST)/network
223 ROOTSVCNETWORKDNS= $(ROOTSVCNETWORK)/dns
224 ROOTSVCNETWORKISCSI= $(ROOTSVCNETWORK)/iscsi
225 ROOTSVCNETWORKLDAP= $(ROOTSVCNETWORK)/ldap
226 ROOTSVCNETWORKNFS= $(ROOTSVCNETWORK)/nfs
227 ROOTSVCNETWORKNIS= $(ROOTSVCNETWORK)/nis
228 ROOTSVCNETWORKROUTING= $(ROOTSVCNETWORK)/routing
229 ROOTSVCNETWORKRPC= $(ROOTSVCNETWORK)/rpc
230 ROOTSVCNETWORKSMB= $(ROOTSVCNETWORK)/smb
231 ROOTSVCNETWORKSECURITY= $(ROOTSVCNETWORK)/security
232 ROOTSVCNETWORKSSL= $(ROOTSVCNETWORK)/ssl
233 ROOTSVCNETWORKIPSEC= $(ROOTSVCNETWORK)/ipsec
234 ROOTSVCNETWORKSHARES= $(ROOTSVCNETWORK)/shares
235 ROOTSVCSMB= $(ROOTSVCNETWORK)/smb
236 ROOTSVCPLATFORM= $(ROOTSVCMANIFEST)/platform
237 ROOTSVCPLATFORMSUN4U= $(ROOTSVCPLATFORM)/sun4u
238 ROOTSVCPLATFORMSUN4V= $(ROOTSVCPLATFORM)/sun4v
239 ROOTSVCAPPLICATION= $(ROOTSVCMANIFEST)/application
240 ROOTSVCAPPLICATIONMANAGEMENT= $(ROOTSVCAPPLICATION)/management
241 ROOTSVCAPPLICATIONSECURITY= $(ROOTSVCAPPLICATION)/security
242 ROOTSVCAPPLICATIONPRINT= $(ROOTSVCAPPLICATION)/print
245 # Commands Makefiles delivering a manifest are expected to define MANIFEST.
247 # Like ROOTCMDDIR, any lower-level Makefiles that put their manifests in a
248 # subdirectory of the manifest directories listed above should reset
249 # ROOTMANIFESTDIR and use it in their `install' target. By default we set this
250 # to a bogus value so that it will not conflict with any of the other values
251 # already defined in this Makefile.
253 # The manifest validation of the $SRC/cmd check target is also derived from a
254 # valid MANIFEST setting.
256 ROOTMANIFESTDIR= $(ROOTSVCMANIFEST)/__nonexistent_directory__
257 ROOTMANIFEST= $(MANIFEST:%=$(ROOTMANIFESTDIR)/%)
258 CHKMANIFEST= $(MANIFEST:%.xml=%.xmlchk)
260 # Manifests cannot be checked in parallel, because we are using the global
261 # repository that is in $(SRC)/cmd/svc/seed/global.db. This is a
262 # repository that is built from the manifests in this workspace, whereas
263 # the build machine's repository may be out of sync with these manifests.
264 # Because we are using a private repository, svccfg-native must start up a
265 # private copy of configd-native. We cannot have multiple copies of
266 # configd-native trying to access global.db simultaneously.
268 .NO_PARALLEL: $(CHKMANIFEST)
271 # For installing "starter scripts" of services
274 ROOTSVCMETHOD= $(SVCMETHOD:%=$(ROOTLIBSVCMETHOD)/%)
276 ROOTSVCBINDIR= $(ROOTLIBSVCBIN)/__nonexistent_directory__
277 ROOTSVCBIN= $(SVCBIN:%=$(ROOTSVCBINDIR)/%)
281 # For programs that are installed in the root filesystem,
282 # build $(ROOTFS_PROG) rather than $(PROG)
283 $(ROOTFS_PROG) := LDFLAGS += -Wl,-I/lib/ld.so.1
285 $(KRB5BIN)/%: %
286 $(INS.file)
288 $(KRB5SBIN)/%: %
289 $(INS.file)
291 $(KRB5LIB)/%: %
292 $(INS.file)
294 $(ROOTBIN)/%: %
295 $(INS.file)
297 $(ROOTLIB)/%: %
298 $(INS.file)
300 $(ROOTBIN64)/%: %
301 $(INS.file)
303 $(ROOTLIB64)/%: %
304 $(INS.file)
306 $(ROOTBIN32)/%: %
307 $(INS.file)
309 $(ROOTSHLIB)/%: %
310 $(INS.file)
312 $(ROOTPKGBIN)/%: %
313 $(INS.file)
315 $(ROOTCLASS_SCR_DIR)/%: %
316 $(INS.file)
318 $(ROOTADMIN_SRC_DIR)/%: %
319 $(INS.file)
321 $(ROOTSBIN)/%: %
322 $(INS.file)
324 $(ROOTUSRSBIN)/%: %
325 $(INS.file)
327 $(ROOTUSRSBIN32)/%: %
328 $(INS.file)
330 $(ROOTUSRSBIN64)/%: %
331 $(INS.file)
333 $(ROOTETC)/%: %
334 $(INS.file)
336 $(ROOTETCFTPD)/%: %
337 $(INS.file)
339 $(ROOTETCINET)/%: %
340 $(INS.file)
342 $(ROOTETCDEFAULT)/%: %.dfl
343 $(INS.rename)
345 $(ROOTETCTSOL)/%: %
346 $(INS.file)
348 $(ROOTETCSECLIB)/%: %
349 $(INS.file)
351 $(ROOTETCZONES)/%: %
352 $(INS.file)
354 $(ROOTLIBZONES)/%: %
355 $(INS.file)
357 $(ROOTLIBXEN)/%: %
358 $(INS.file)
360 $(ROOTHASBIN)/%: %
361 $(INS.file)
363 $(ROOTHASLIB)/%: %
364 $(INS.file)
366 $(ROOTUSRKVM)/%: %
367 $(INS.file)
369 $(ROOTXPG4BIN)/%: %.xpg4
370 $(INS.rename)
372 $(ROOTXPG4BIN32)/%: %.xpg4
373 $(INS.rename)
375 $(ROOTXPG4BIN64)/%: %.xpg4
376 $(INS.rename)
378 $(ROOTXPG6BIN)/%: %.xpg6
379 $(INS.rename)
381 $(ROOTLOCALEDEF)/%: %
382 $(INS.file)
384 $(ROOTCHARMAP)/%: %
385 $(INS.file)
387 $(ROOTI18NEXT)/%: %
388 $(INS.file)
390 $(ROOTI18NEXT64)/%: %
391 $(INS.file)
393 $(ROOTLIBSVCMETHOD)/%: %
394 $(INS.file)
396 $(ROOTLIBSVCBIN)/%: %
397 $(INS.file)
399 $(ROOTSVCMILESTONE)/%: %
400 $(INS.file)
402 $(ROOTSVCDEVICE)/%: %
403 $(INS.file)
405 $(ROOTSVCSYSTEM)/%: %
406 $(INS.file)
408 $(ROOTSVCSYSTEMDEVICE)/%: %
409 $(INS.file)
411 $(ROOTSVCSYSTEMFILESYSTEM)/%: %
412 $(INS.file)
414 $(ROOTSVCSYSTEMSECURITY)/%: %
415 $(INS.file)
417 $(ROOTSVCNETWORK)/%: %
418 $(INS.file)
420 $(ROOTSVCNETWORKLDAP)/%: %
421 $(INS.file)
423 $(ROOTSVCNETWORKNFS)/%: %
424 $(INS.file)
426 $(ROOTSVCNETWORKNIS)/%: %
427 $(INS.file)
429 $(ROOTSVCNETWORKRPC)/%: %
430 $(INS.file)
432 $(ROOTSVCNETWORKSECURITY)/%: %
433 $(INS.file)
435 $(ROOTSVCNETWORKSSL)/%: %
436 $(INS.file)
438 $(ROOTSVCNETWORKIPSEC)/%: %
439 $(INS.file)
441 $(ROOTSVCNETWORKSHARES)/%: %
442 $(INS.file)
444 $(ROOTSVCNETWORKSMB)/%: %
445 $(INS.file)
447 $(ROOTSVCAPPLICATION)/%: %
448 $(INS.file)
450 $(ROOTSVCAPPLICATIONMANAGEMENT)/%: %
451 $(INS.file)
453 $(ROOTSVCAPPLICATIONSECURITY)/%: %
454 $(INS.file)
456 $(ROOTSVCAPPLICATIONPRINT)/%: %
457 $(INS.file)
459 $(ROOTSVCPLATFORM)/%: %
460 $(INS.file)
462 $(ROOTSVCPLATFORMSUN4U)/%: %
463 $(INS.file)
465 $(ROOTSVCPLATFORMSUN4V)/%: %
466 $(INS.file)
468 # Install rule for gprof, yacc, and lex dependency files
469 $(ROOTSHLIBCCS)/%: ../common/%
470 $(INS.file)
472 $(ROOTCCSBINLINKDIR)/%: %
473 $(INS.ccsbinlink)
475 $(ROOTCCSBINLINKDIR64)/%: %
476 $(INS.ccsbinlink64)
478 $(ROOTMAN1)/%: %.sunman
479 $(INS.rename)
481 $(ROOTMAN1M)/%: %.sunman
482 $(INS.rename)
484 $(ROOTMAN3)/%: %.sunman
485 $(INS.rename)
487 $(ROOTVARSMB)/%: %
488 $(INS.file)
490 # build rule for statically linked programs with single source file.
491 %.static: %.c
492 $(LINK.c) -o $@ $< $(LDLIBS)
493 $(POST_PROCESS)
495 %.xpg4: %.c
496 $(LINK.c) -o $@ $< $(LDLIBS)
497 $(POST_PROCESS)
499 %.xpg6: %.c
500 $(LINK.c) -o $@ $< $(LDLIBS)
501 $(POST_PROCESS)
503 # Define the majority text domain in this directory.
504 TEXT_DOMAIN= SUNW_OST_OSCMD
506 CLOBBERFILES += $(XPG4) $(XPG6) $(DCFILE)
508 # This flag is for programs which should not build a 32-bit binary
509 sparc_64ONLY= $(POUND_SIGN)
510 64ONLY= $($(MACH)_64ONLY)