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
]
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
39 XPG4
= $
(XPG4PROG
:%=%.xpg4
)
40 XPG6
= $
(XPG6PROG
:%=%.xpg6
)
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
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)
125 $(BDIRECT) $(ENVLDFLAGS1) $(ENVLDFLAGS2) $(ENVLDFLAGS3) \
126 $(MAPFILE.NES:%=-M%) $(MAPFILE.PGA:%=-M%) $(MAPFILE.NED:%=-M%)
128 LDFLAGS = $(LDFLAGS.cmd)
131 LINTFLAGS64= -axsm -m64
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.
179 $(RM) $(ROOTCCSBINPROG); \
180 $(SYMLINK) ../../bin/$(PROG) $(ROOTCCSBINPROG)
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
315 $(ROOTCLASS_SCR_DIR)/%: %
318 $(ROOTADMIN_SRC_DIR)/%: %
327 $(ROOTUSRSBIN32)/%: %
330 $(ROOTUSRSBIN64)/%: %
342 $(ROOTETCDEFAULT)/%: %.dfl
348 $(ROOTETCSECLIB)/%: %
369 $(ROOTXPG4BIN)/%: %.xpg4
372 $(ROOTXPG4BIN32)/%: %.xpg4
375 $(ROOTXPG4BIN64)/%: %.xpg4
378 $(ROOTXPG6BIN)/%: %.xpg6
381 $(ROOTLOCALEDEF)/%: %
390 $(ROOTI18NEXT64)/%: %
393 $(ROOTLIBSVCMETHOD)/%: %
396 $(ROOTLIBSVCBIN)/%: %
399 $(ROOTSVCMILESTONE)/%: %
402 $(ROOTSVCDEVICE)/%: %
405 $(ROOTSVCSYSTEM)/%: %
408 $(ROOTSVCSYSTEMDEVICE)/%: %
411 $(ROOTSVCSYSTEMFILESYSTEM)/%: %
414 $(ROOTSVCSYSTEMSECURITY)/%: %
417 $(ROOTSVCNETWORK)/%: %
420 $(ROOTSVCNETWORKLDAP)/%: %
423 $(ROOTSVCNETWORKNFS)/%: %
426 $(ROOTSVCNETWORKNIS)/%: %
429 $(ROOTSVCNETWORKRPC)/%: %
432 $(ROOTSVCNETWORKSECURITY)/%: %
435 $(ROOTSVCNETWORKSSL)/%: %
438 $(ROOTSVCNETWORKIPSEC)/%: %
441 $(ROOTSVCNETWORKSHARES)/%: %
444 $(ROOTSVCNETWORKSMB)/%: %
447 $(ROOTSVCAPPLICATION)/%: %
450 $(ROOTSVCAPPLICATIONMANAGEMENT)/%: %
453 $(ROOTSVCAPPLICATIONSECURITY)/%: %
456 $(ROOTSVCAPPLICATIONPRINT)/%: %
459 $(ROOTSVCPLATFORM)/%: %
462 $(ROOTSVCPLATFORMSUN4U)/%: %
465 $(ROOTSVCPLATFORMSUN4V)/%: %
468 # Install rule for gprof, yacc, and lex dependency files
469 $(ROOTSHLIBCCS)/%: ../common/%
472 $(ROOTCCSBINLINKDIR)/%: %
475 $(ROOTCCSBINLINKDIR64)/%: %
478 $(ROOTMAN1)/%: %.sunman
481 $(ROOTMAN1M)/%: %.sunman
484 $(ROOTMAN3)/%: %.sunman
490 # build rule for statically linked programs with single source file.
492 $(LINK.c) -o $@ $< $(LDLIBS)
496 $(LINK.c) -o $@ $< $(LDLIBS)
500 $(LINK.c) -o $@ $< $(LDLIBS)
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)