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
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
40 XPG4= $(XPG4PROG:%=%.xpg4)
41 XPG6= $(XPG6PROG:%=%.xpg6)
44 KRB5BIN= $(KRB5DIR)/bin
45 KRB5SBIN= $(KRB5DIR)/sbin
46 KRB5LIB= $(KRB5DIR)/lib/krb5
47 KRB5RUNPATH= /usr/lib/krb5
48 GSSRUNPATH= /usr/lib/gss
51 ROOTBIN= $(ROOT)/usr/bin
52 ROOTLIB= $(ROOT)/usr/lib
53 ROOTLIBSVCBIN= $(ROOT)/lib/svc/bin
54 ROOTLIBSVCMETHOD= $(ROOT)/lib/svc/method
55 ROOTLIBXEN= $(ROOT)/usr/lib/xen/bin
56 ROOTLIBZONES= $(ROOT)/lib/zones
58 ROOTSHLIB= $(ROOT)/usr/share/lib
59 ROOTPKGBIN= $(ROOT)/usr/sadm/install/bin
60 ROOTCLASS_SCR_DIR= $(ROOT)/usr/sadm/install/scripts
61 ROOTADMIN_SRC_DIR= $(ROOT)/var/sadm/install/admin
63 ROOTSHLIBCCS= $(ROOTSHLIB)/ccs
64 ROOTSBIN= $(ROOT)/sbin
65 ROOTUSRSBIN= $(ROOT)/usr/sbin
68 ROOTETCSECURITY= $(ROOTETC)/security
69 ROOTETCTSOL= $(ROOTETCSECURITY)/tsol
70 ROOTETCSECLIB= $(ROOTETCSECURITY)/lib
71 ROOTETCZONES= $(ROOTETC)/zones
73 ROOTETCFTPD= $(ROOT)/etc/ftpd
74 ROOTETCINET= $(ROOT)/etc/inet
75 ROOTCCSBIN= $(ROOT)/usr/ccs/bin
76 ROOTCCSBIN64= $(ROOTCCSBIN)/$(MACH64)
77 ROOTCCSBINLINKDIR= $(ROOT)/../../bin
78 ROOTCCSBINLINKDIR64= $(ROOT)../../../bin/$(MACH)
79 ROOTCCSLIB= $(ROOT)/usr/ccs/lib
80 ROOTUSRKVM= $(ROOT)/usr/kvm
81 ROOTXPG4= $(ROOT)/usr/xpg4
82 ROOTXPG4BIN= $(ROOT)/usr/xpg4/bin
83 ROOTXPG4BIN32= $(ROOTXPG4BIN)/$(MACH32)
84 ROOTXPG4BIN64= $(ROOTXPG4BIN)/$(MACH64)
85 ROOTXPG6= $(ROOT)/usr/xpg6
86 ROOTXPG6BIN= $(ROOT)/usr/xpg6/bin
87 ROOTLOCALEDEF= $(ROOT)/usr/lib/localedef
88 ROOTCHARMAP= $(ROOTLOCALEDEF)/charmap
89 ROOTI18NEXT= $(ROOTLOCALEDEF)/extensions
90 ROOTI18NEXT64= $(ROOTLOCALEDEF)/extensions/$(MACH64)
91 ROOTBIN32= $(ROOTBIN)/$(MACH32)
92 ROOTBIN64= $(ROOTBIN)/$(MACH64)
93 ROOTCMDDIR64= $(ROOTCMDDIR)/$(MACH64)
94 ROOTLIB64= $(ROOTLIB)/$(MACH64)
95 ROOTUSRSBIN32= $(ROOTUSRSBIN)/$(MACH32)
96 ROOTUSRSBIN64= $(ROOTUSRSBIN)/$(MACH64)
97 ROOTMAN= $(ROOT)/usr/share/man
98 ROOTMAN1= $(ROOTMAN)/man1
99 ROOTMAN1M= $(ROOTMAN)/man1m
100 ROOTMAN3= $(ROOTMAN)/man3
101 ROOTVARSMB= $(ROOT)/var/smb
105 # Like ROOTLIBDIR in $(SRC)/Makefile.lib, any lower-level Makefiles that
106 # put their binaries in a non-standard location should reset this and use
107 # $(ROOTCMD) in their `install' target. By default we
set this to a bogus
108 # value so that it will
not conflict with any of the other values already
109 # defined in this Makefile.
111 ROOTCMDDIR
= $
(ROOT
)/__nonexistent_directory__
113 ROOTSHAUDIO
= $
(ROOT
)/usr
/share
/audio
114 ROOTAUDIOSAMP
= $
(ROOTSHAUDIO
)/samples
115 ROOTAUDIOSAMPAU
=$
(ROOTAUDIOSAMP
)/au
117 ISAEXEC
= $
(ROOT
)/usr
/lib
/isaexec
118 PLATEXEC
= $
(ROOT
)/usr
/lib
/platexec
120 LDLIBS
= $
(LDLIBS.
cmd)
123 $
(BDIRECT
) $
(ENVLDFLAGS1
) $
(ENVLDFLAGS2
) $
(ENVLDFLAGS3
) \
124 $
(MAPFILE.NES
:%=-M
%) $
(MAPFILE.PGA
:%=-M
%) $
(MAPFILE.NED
:%=-M
%)
126 LDFLAGS
= $
(LDFLAGS.
cmd)
129 KRB5PROG
= $
(PROG
:%=$
(KRB5BIN
)/%)
130 KRB5SBINPROG
= $
(PROG
:%=$
(KRB5SBIN
)/%)
131 KRB5LIBPROG
= $
(PROG
:%=$
(KRB5LIB
)/%)
133 ROOTPROG
= $
(PROG
:%=$
(ROOTBIN
)/%)
134 ROOTCMD
= $
(PROG
:%=$
(ROOTCMDDIR
)/%)
135 ROOTSHFILES
= $
(SHFILES
:%=$
(ROOTBIN
)/%)
136 ROOTLIBPROG
= $
(PROG
:%=$
(ROOTLIB
)/%)
137 ROOTLIBSHFILES
= $
(SHFILES
:%=$
(ROOTLIB
)/%)
138 ROOTSHLIBPROG
= $
(PROG
:%=$
(ROOTSHLIB
)/%)
139 ROOTSBINPROG
= $
(PROG
:%=$
(ROOTSBIN
)/%)
140 ROOTPKGBINPROG
= $
(PROG
:%=$
(ROOTPKGBIN
)/%)
141 ROOTCLASS_SCR_FILES
= $
(SCRIPTS
:%=$
(ROOTCLASS_SCR_DIR
)/%)
142 ROOTUSRSBINPROG
=$
(PROG
:%=$
(ROOTUSRSBIN
)/%)
143 ROOTUSRSBINSCRIPT
=$
(SCRIPT
:%=$
(ROOTUSRSBIN
)/%)
144 ROOTETCPROG
= $
(PROG
:%=$
(ROOTETC
)/%)
145 ROOTCCSBINPROG
= $
(PROG
:%=$
(ROOTCCSBIN
)/%)
146 ROOTCCSBINPROG64
= $
(PROG
:%=$
(ROOTCCSBIN64
)/%)
147 ROOTCCSBINLINK
=$
(PROG
:%= $
(ROOTCCSBINLINKDIR
)/%)
148 ROOTCCSBINLINK64
=$
(PROG
:%=$
(ROOTCCSBINLINKDIR64
)/%)
149 ROOTUSRKVMPROG
= $
(PROG
:%=$
(ROOTUSRKVM
)/%)
150 ROOTXPG4PROG
= $
(XPG4PROG
:%=$
(ROOTXPG4BIN
)/%)
151 ROOTXPG4PROG32
= $
(XPG4PROG
:%=$
(ROOTXPG4BIN32
)/%)
152 ROOTXPG4PROG64
= $
(XPG4PROG
:%=$
(ROOTXPG4BIN64
)/%)
153 ROOTXPG6PROG
= $
(XPG6PROG
:%=$
(ROOTXPG6BIN
)/%)
154 ROOTLOCALEPROG
= $
(PROG
:%=$
(ROOTLOCALEDEF
)/%)
155 ROOTPROG64
= $
(PROG
:%=$
(ROOTBIN64
)/%)
156 ROOTPROG32
= $
(PROG
:%=$
(ROOTBIN32
)/%)
157 ROOTCMD64
= $
(PROG
:%=$
(ROOTCMDDIR64
)/%)
158 ROOTUSRSBINPROG32
= $
(PROG
:%=$
(ROOTUSRSBIN32
)/%)
159 ROOTUSRSBINPROG64
= $
(PROG
:%=$
(ROOTUSRSBIN64
)/%)
160 ROOTMAN1FILES
= $
(MAN1FILES
:%=$
(ROOTMAN1
)/%)
161 $
(ROOTMAN1FILES
) := FILEMODE
= 444
162 ROOTMAN1MFILES
= $
(MAN1MFILES
:%=$
(ROOTMAN1M
)/%)
163 $
(ROOTMAN1MFILES
) := FILEMODE
= 444
164 ROOTMAN3FILES
= $
(MAN3FILES
:%=$
(ROOTMAN3
)/%)
165 $
(ROOTMAN3FILES
) := FILEMODE
= 444
167 # Symlink rules
for /usr
/ccs
/bin commands. Note
, those commands under
168 # the rule of the linker area
, are controlled by a different
set of
169 # rules defined in $
(SRC
)/cmd/sgs
/Makefile.var.
172 $
(RM
) $
(ROOTCCSBINPROG
); \
173 $
(SYMLINK
) ..
/..
/bin
/$
(PROG
) $
(ROOTCCSBINPROG
)
176 $
(RM
) $
(ROOTCCSBINPROG64
); \
177 $
(SYMLINK
) ..
/..
/..
/bin
/$
(MACH64
)/$
(PROG
) $
(ROOTCCSBINPROG64
)
179 ROOTETCDEFAULT
= $
(ROOTETC
)/default
180 ROOTETCDEFAULTFILES
= $
(DEFAULTFILES
:%.dfl
=$
(ROOTETCDEFAULT
)/%)
181 $
(ROOTETCDEFAULTFILES
) := FILEMODE
= 0644
183 ROOTETCSECFILES
= $
(ETCSECFILES
:%=$
(ROOTETCSECURITY
)/%)
184 $
(ROOTETCSECFILES
) := FILEMODE
= 0644
186 ROOTETCTSOLFILES
= $
(ETCTSOLFILES
:%=$
(ROOTETCTSOL
)/%)
187 $
(ROOTETCTSOLFILES
) := FILEMODE
= 0644
189 ROOTETCSECLIBFILES
= $
(ETCSECLIBFILES
:%=$
(ROOTETCSECLIB
)/%)
191 ROOTETCZONESFILES
= $
(ETCZONESFILES
:%=$
(ROOTETCZONES
)/%)
192 $
(ROOTETCZONESFILES
) := FILEMODE
= 0444
194 ROOTLIBZONESFILES
= $
(LIBZONESFILES
:%=$
(ROOTLIBZONES
)/%)
195 $
(ROOTLIBZONESFILES
) := FILEMODE
= 0555
197 ROOTADMIN_SRC_FILE
= $
(ADMINFILE
:%=$
(ROOTADMIN_SRC_DIR
)/%)
198 $
(ROOTADMIN_SRC_FILE
) := FILEMODE
= 0444
201 # Directories
for smf
(5) service manifests and profiles.
203 ROOTSVC
= $
(ROOT
)/lib
/svc
204 ROOTETCSVC
= $
(ROOT
)/etc
/svc
206 ROOTSVCMANIFEST
= $
(ROOTSVC
)/manifest
207 ROOTSVCPROFILE
= $
(ROOTETCSVC
)/profile
209 ROOTSVCMILESTONE
= $
(ROOTSVCMANIFEST
)/milestone
210 ROOTSVCDEVICE
= $
(ROOTSVCMANIFEST
)/device
211 ROOTSVCSYSTEM
= $
(ROOTSVCMANIFEST
)/system
212 ROOTSVCSYSTEMDEVICE
= $
(ROOTSVCSYSTEM
)/device
213 ROOTSVCSYSTEMFILESYSTEM
= $
(ROOTSVCSYSTEM
)/filesystem
214 ROOTSVCSYSTEMSECURITY
= $
(ROOTSVCSYSTEM
)/security
215 ROOTSVCNETWORK
= $
(ROOTSVCMANIFEST
)/network
216 ROOTSVCNETWORKDNS
= $
(ROOTSVCNETWORK
)/dns
217 ROOTSVCNETWORKISCSI
= $
(ROOTSVCNETWORK
)/iscsi
218 ROOTSVCNETWORKLDAP
= $
(ROOTSVCNETWORK
)/ldap
219 ROOTSVCNETWORKNFS
= $
(ROOTSVCNETWORK
)/nfs
220 ROOTSVCNETWORKNIS
= $
(ROOTSVCNETWORK
)/nis
221 ROOTSVCNETWORKROUTING
= $
(ROOTSVCNETWORK
)/routing
222 ROOTSVCNETWORKRPC
= $
(ROOTSVCNETWORK
)/rpc
223 ROOTSVCNETWORKSMB
= $
(ROOTSVCNETWORK
)/smb
224 ROOTSVCNETWORKSECURITY
= $
(ROOTSVCNETWORK
)/security
225 ROOTSVCNETWORKIPSEC
= $
(ROOTSVCNETWORK
)/ipsec
226 ROOTSVCNETWORKSHARES
= $
(ROOTSVCNETWORK
)/shares
227 ROOTSVCSMB
= $
(ROOTSVCNETWORK
)/smb
228 ROOTSVCPLATFORM
= $
(ROOTSVCMANIFEST
)/platform
229 ROOTSVCPLATFORMSUN4U
= $
(ROOTSVCPLATFORM
)/sun4u
230 ROOTSVCPLATFORMSUN4V
= $
(ROOTSVCPLATFORM
)/sun4v
231 ROOTSVCAPPLICATION
= $
(ROOTSVCMANIFEST
)/application
232 ROOTSVCAPPLICATIONMANAGEMENT
= $
(ROOTSVCAPPLICATION
)/management
233 ROOTSVCAPPLICATIONSECURITY
= $
(ROOTSVCAPPLICATION
)/security
234 ROOTSVCAPPLICATIONPRINT
= $
(ROOTSVCAPPLICATION
)/print
237 # Commands Makefiles delivering a manifest are expected to define MANIFEST.
239 # Like ROOTCMDDIR
, any lower
-level Makefiles that put their manifests in a
240 # subdirectory of the manifest directories listed above should reset
241 # ROOTMANIFESTDIR and
use it in their `install
' target. By default we set this
242 # to a bogus value so that it will not conflict with any of the other values
243 # already defined in this Makefile.
245 # The manifest validation of the $SRC/cmd check target is also derived from a
246 # valid MANIFEST setting.
248 ROOTMANIFESTDIR= $(ROOTSVCMANIFEST)/__nonexistent_directory__
249 ROOTMANIFEST= $(MANIFEST:%=$(ROOTMANIFESTDIR)/%)
250 CHKMANIFEST= $(MANIFEST:%.xml=%.xmlchk)
252 # Manifests cannot be checked in parallel, because we are using the global
253 # repository that is in $(SRC)/cmd/svc/seed/global.db. This is a
254 # repository that is built from the manifests in this workspace, whereas
255 # the build machine's repository may be out of sync with these manifests.
256 # Because we are using a private repository
, svccfg
-native must
start up a
257 # private
copy of configd
-native. We cannot have multiple copies of
258 # configd
-native trying to access global.db simultaneously.
260 .NO_PARALLEL
: $
(CHKMANIFEST
)
263 #
For installing
"starter scripts" of services
266 ROOTSVCMETHOD
= $
(SVCMETHOD
:%=$
(ROOTLIBSVCMETHOD
)/%)
268 ROOTSVCBINDIR
= $
(ROOTLIBSVCBIN
)/__nonexistent_directory__
269 ROOTSVCBIN
= $
(SVCBIN
:%=$
(ROOTSVCBINDIR
)/%)
273 #
For programs that are installed in the root filesystem
,
274 # build $
(ROOTFS_PROG
) rather than $
(PROG
)
275 $
(ROOTFS_PROG
) := LDFLAGS
+= -Wl
,-I
/lib
/ld.so
.1
307 $
(ROOTCLASS_SCR_DIR
)/%: %
310 $
(ROOTADMIN_SRC_DIR
)/%: %
319 $
(ROOTUSRSBIN32
)/%: %
322 $
(ROOTUSRSBIN64
)/%: %
334 $
(ROOTETCDEFAULT
)/%: %.dfl
340 $
(ROOTETCSECLIB
)/%: %
355 $
(ROOTXPG4BIN
)/%: %.xpg4
358 $
(ROOTXPG4BIN32
)/%: %.xpg4
361 $
(ROOTXPG4BIN64
)/%: %.xpg4
364 $
(ROOTXPG6BIN
)/%: %.xpg6
367 $
(ROOTLOCALEDEF
)/%: %
376 $
(ROOTI18NEXT64
)/%: %
379 $
(ROOTLIBSVCMETHOD
)/%: %
382 $
(ROOTLIBSVCBIN
)/%: %
385 $
(ROOTSVCMILESTONE
)/%: %
388 $
(ROOTSVCDEVICE
)/%: %
391 $
(ROOTSVCSYSTEM
)/%: %
394 $
(ROOTSVCSYSTEMDEVICE
)/%: %
397 $
(ROOTSVCSYSTEMFILESYSTEM
)/%: %
400 $
(ROOTSVCSYSTEMSECURITY
)/%: %
403 $
(ROOTSVCNETWORK
)/%: %
406 $
(ROOTSVCNETWORKLDAP
)/%: %
409 $
(ROOTSVCNETWORKNFS
)/%: %
412 $
(ROOTSVCNETWORKNIS
)/%: %
415 $
(ROOTSVCNETWORKRPC
)/%: %
418 $
(ROOTSVCNETWORKSECURITY
)/%: %
421 $
(ROOTSVCNETWORKIPSEC
)/%: %
424 $
(ROOTSVCNETWORKSHARES
)/%: %
427 $
(ROOTSVCNETWORKSMB
)/%: %
430 $
(ROOTSVCAPPLICATION
)/%: %
433 $
(ROOTSVCAPPLICATIONMANAGEMENT
)/%: %
436 $
(ROOTSVCAPPLICATIONSECURITY
)/%: %
439 $
(ROOTSVCAPPLICATIONPRINT
)/%: %
442 $
(ROOTSVCPLATFORM
)/%: %
445 $
(ROOTSVCPLATFORMSUN4U
)/%: %
448 $
(ROOTSVCPLATFORMSUN4V
)/%: %
451 # Install rule
for gprof
, yacc
, and lex dependency
files
452 $
(ROOTSHLIBCCS
)/%: ..
/common
/%
455 $
(ROOTCCSBINLINKDIR
)/%: %
458 $
(ROOTCCSBINLINKDIR64
)/%: %
464 # build rule
for statically linked programs with single source file.
466 $
(LINK.c
) -o $@ $
< $
(LDLIBS
)
470 $
(LINK.c
) -o $@ $
< $
(LDLIBS
)
474 $
(LINK.c
) -o $@ $
< $
(LDLIBS
)
477 # Define the majority text domain in this directory.
478 TEXT_DOMAIN
= SUNW_OST_OSCMD
480 CLOBBERFILES
+= $
(XPG4
) $
(XPG6
) $
(DCFILE
)
482 # This flag is
for programs which should
not build a
32-bit binary
483 sparc_64ONLY
= $
(POUND_SIGN
)
484 64ONLY
= $
($
(MACH
)_64ONLY
)