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 ROOTXPG4= $(ROOT)/usr/xpg4
81 ROOTXPG4BIN= $(ROOT)/usr/xpg4/bin
82 ROOTXPG4BIN32= $(ROOTXPG4BIN)/$(MACH32)
83 ROOTXPG4BIN64= $(ROOTXPG4BIN)/$(MACH64)
84 ROOTXPG6= $(ROOT)/usr/xpg6
85 ROOTXPG6BIN= $(ROOT)/usr/xpg6/bin
86 ROOTBIN32= $(ROOTBIN)/$(MACH32)
87 ROOTBIN64= $(ROOTBIN)/$(MACH64)
88 ROOTCMDDIR64= $(ROOTCMDDIR)/$(MACH64)
89 ROOTLIB64= $(ROOTLIB)/$(MACH64)
90 ROOTUSRSBIN32= $(ROOTUSRSBIN)/$(MACH32)
91 ROOTUSRSBIN64= $(ROOTUSRSBIN)/$(MACH64)
92 ROOTMAN= $(ROOT)/usr/share/man
93 ROOTMAN1= $(ROOTMAN)/man1
94 ROOTMAN1M= $(ROOTMAN)/man1m
95 ROOTMAN3= $(ROOTMAN)/man3
96 ROOTVARSMB= $(ROOT)/var/smb
100 # Like ROOTLIBDIR in $(SRC)/Makefile.lib, any lower-level Makefiles that
101 # put their binaries in a non-standard location should reset this and use
102 # $(ROOTCMD) in their `install' target. By default we
set this to a bogus
103 # value so that it will
not conflict with any of the other values already
104 # defined in this Makefile.
106 ROOTCMDDIR
= $
(ROOT
)/__nonexistent_directory__
108 ROOTSHAUDIO
= $
(ROOT
)/usr
/share
/audio
109 ROOTAUDIOSAMP
= $
(ROOTSHAUDIO
)/samples
110 ROOTAUDIOSAMPAU
=$
(ROOTAUDIOSAMP
)/au
112 ISAEXEC
= $
(ROOT
)/usr
/lib
/isaexec
113 PLATEXEC
= $
(ROOT
)/usr
/lib
/platexec
115 LDLIBS
= $
(LDLIBS.
cmd)
118 $
(BDIRECT
) $
(ENVLDFLAGS1
) $
(ENVLDFLAGS2
) $
(ENVLDFLAGS3
) \
119 $
(MAPFILE.NES
:%=-Wl
,-M
%) $
(MAPFILE.PGA
:%=-Wl
,-M
%) $
(MAPFILE.NED
:%=-Wl
,-M
%)
121 LDFLAGS
= $
(LDFLAGS.
cmd)
124 KRB5PROG
= $
(PROG
:%=$
(KRB5BIN
)/%)
125 KRB5SBINPROG
= $
(PROG
:%=$
(KRB5SBIN
)/%)
126 KRB5LIBPROG
= $
(PROG
:%=$
(KRB5LIB
)/%)
128 ROOTPROG
= $
(PROG
:%=$
(ROOTBIN
)/%)
129 ROOTCMD
= $
(PROG
:%=$
(ROOTCMDDIR
)/%)
130 ROOTSHFILES
= $
(SHFILES
:%=$
(ROOTBIN
)/%)
131 ROOTLIBPROG
= $
(PROG
:%=$
(ROOTLIB
)/%)
132 ROOTLIBSHFILES
= $
(SHFILES
:%=$
(ROOTLIB
)/%)
133 ROOTSHLIBPROG
= $
(PROG
:%=$
(ROOTSHLIB
)/%)
134 ROOTSBINPROG
= $
(PROG
:%=$
(ROOTSBIN
)/%)
135 ROOTPKGBINPROG
= $
(PROG
:%=$
(ROOTPKGBIN
)/%)
136 ROOTCLASS_SCR_FILES
= $
(SCRIPTS
:%=$
(ROOTCLASS_SCR_DIR
)/%)
137 ROOTUSRSBINPROG
=$
(PROG
:%=$
(ROOTUSRSBIN
)/%)
138 ROOTUSRSBINSCRIPT
=$
(SCRIPT
:%=$
(ROOTUSRSBIN
)/%)
139 ROOTETCPROG
= $
(PROG
:%=$
(ROOTETC
)/%)
140 ROOTCCSBINPROG
= $
(PROG
:%=$
(ROOTCCSBIN
)/%)
141 ROOTCCSBINPROG64
= $
(PROG
:%=$
(ROOTCCSBIN64
)/%)
142 ROOTCCSBINLINK
=$
(PROG
:%= $
(ROOTCCSBINLINKDIR
)/%)
143 ROOTCCSBINLINK64
=$
(PROG
:%=$
(ROOTCCSBINLINKDIR64
)/%)
144 ROOTXPG4PROG
= $
(XPG4PROG
:%=$
(ROOTXPG4BIN
)/%)
145 ROOTXPG4PROG32
= $
(XPG4PROG
:%=$
(ROOTXPG4BIN32
)/%)
146 ROOTXPG4PROG64
= $
(XPG4PROG
:%=$
(ROOTXPG4BIN64
)/%)
147 ROOTXPG6PROG
= $
(XPG6PROG
:%=$
(ROOTXPG6BIN
)/%)
148 ROOTLOCALEPROG
= $
(PROG
:%=$
(ROOTLOCALEDEF
)/%)
149 ROOTPROG64
= $
(PROG
:%=$
(ROOTBIN64
)/%)
150 ROOTPROG32
= $
(PROG
:%=$
(ROOTBIN32
)/%)
151 ROOTCMD64
= $
(PROG
:%=$
(ROOTCMDDIR64
)/%)
152 ROOTUSRSBINPROG32
= $
(PROG
:%=$
(ROOTUSRSBIN32
)/%)
153 ROOTUSRSBINPROG64
= $
(PROG
:%=$
(ROOTUSRSBIN64
)/%)
154 ROOTMAN1FILES
= $
(MAN1FILES
:%=$
(ROOTMAN1
)/%)
155 $
(ROOTMAN1FILES
) := FILEMODE
= 444
156 ROOTMAN1MFILES
= $
(MAN1MFILES
:%=$
(ROOTMAN1M
)/%)
157 $
(ROOTMAN1MFILES
) := FILEMODE
= 444
158 ROOTMAN3FILES
= $
(MAN3FILES
:%=$
(ROOTMAN3
)/%)
159 $
(ROOTMAN3FILES
) := FILEMODE
= 444
161 # Symlink rules
for /usr
/ccs
/bin commands. Note
, those commands under
162 # the rule of the linker area
, are controlled by a different
set of
163 # rules defined in $
(SRC
)/cmd/sgs
/Makefile.var.
166 $
(RM
) $
(ROOTCCSBINPROG
); \
167 $
(SYMLINK
) ..
/..
/bin
/$
(PROG
) $
(ROOTCCSBINPROG
)
170 $
(RM
) $
(ROOTCCSBINPROG64
); \
171 $
(SYMLINK
) ..
/..
/..
/bin
/$
(MACH64
)/$
(PROG
) $
(ROOTCCSBINPROG64
)
173 ROOTETCDEFAULT
= $
(ROOTETC
)/default
174 ROOTETCDEFAULTFILES
= $
(DEFAULTFILES
:%.dfl
=$
(ROOTETCDEFAULT
)/%)
175 $
(ROOTETCDEFAULTFILES
) := FILEMODE
= 0644
177 ROOTETCSECFILES
= $
(ETCSECFILES
:%=$
(ROOTETCSECURITY
)/%)
178 $
(ROOTETCSECFILES
) := FILEMODE
= 0644
180 ROOTETCTSOLFILES
= $
(ETCTSOLFILES
:%=$
(ROOTETCTSOL
)/%)
181 $
(ROOTETCTSOLFILES
) := FILEMODE
= 0644
183 ROOTETCSECLIBFILES
= $
(ETCSECLIBFILES
:%=$
(ROOTETCSECLIB
)/%)
185 ROOTETCZONESFILES
= $
(ETCZONESFILES
:%=$
(ROOTETCZONES
)/%)
186 $
(ROOTETCZONESFILES
) := FILEMODE
= 0444
188 ROOTLIBZONESFILES
= $
(LIBZONESFILES
:%=$
(ROOTLIBZONES
)/%)
189 $
(ROOTLIBZONESFILES
) := FILEMODE
= 0555
191 ROOTADMIN_SRC_FILE
= $
(ADMINFILE
:%=$
(ROOTADMIN_SRC_DIR
)/%)
192 $
(ROOTADMIN_SRC_FILE
) := FILEMODE
= 0444
195 # Directories
for smf
(5) service manifests and profiles.
197 ROOTSVC
= $
(ROOT
)/lib
/svc
198 ROOTETCSVC
= $
(ROOT
)/etc
/svc
200 ROOTSVCMANIFEST
= $
(ROOTSVC
)/manifest
201 ROOTSVCPROFILE
= $
(ROOTETCSVC
)/profile
203 ROOTSVCMILESTONE
= $
(ROOTSVCMANIFEST
)/milestone
204 ROOTSVCDEVICE
= $
(ROOTSVCMANIFEST
)/device
205 ROOTSVCSYSTEM
= $
(ROOTSVCMANIFEST
)/system
206 ROOTSVCSYSTEMDEVICE
= $
(ROOTSVCSYSTEM
)/device
207 ROOTSVCSYSTEMFILESYSTEM
= $
(ROOTSVCSYSTEM
)/filesystem
208 ROOTSVCSYSTEMSECURITY
= $
(ROOTSVCSYSTEM
)/security
209 ROOTSVCNETWORK
= $
(ROOTSVCMANIFEST
)/network
210 ROOTSVCNETWORKDNS
= $
(ROOTSVCNETWORK
)/dns
211 ROOTSVCNETWORKISCSI
= $
(ROOTSVCNETWORK
)/iscsi
212 ROOTSVCNETWORKLDAP
= $
(ROOTSVCNETWORK
)/ldap
213 ROOTSVCNETWORKNFS
= $
(ROOTSVCNETWORK
)/nfs
214 ROOTSVCNETWORKNIS
= $
(ROOTSVCNETWORK
)/nis
215 ROOTSVCNETWORKROUTING
= $
(ROOTSVCNETWORK
)/routing
216 ROOTSVCNETWORKRPC
= $
(ROOTSVCNETWORK
)/rpc
217 ROOTSVCNETWORKSMB
= $
(ROOTSVCNETWORK
)/smb
218 ROOTSVCNETWORKSECURITY
= $
(ROOTSVCNETWORK
)/security
219 ROOTSVCNETWORKIPSEC
= $
(ROOTSVCNETWORK
)/ipsec
220 ROOTSVCNETWORKSHARES
= $
(ROOTSVCNETWORK
)/shares
221 ROOTSVCSMB
= $
(ROOTSVCNETWORK
)/smb
222 ROOTSVCPLATFORM
= $
(ROOTSVCMANIFEST
)/platform
223 ROOTSVCPLATFORMSUN4U
= $
(ROOTSVCPLATFORM
)/sun4u
224 ROOTSVCPLATFORMSUN4V
= $
(ROOTSVCPLATFORM
)/sun4v
225 ROOTSVCAPPLICATION
= $
(ROOTSVCMANIFEST
)/application
226 ROOTSVCAPPLICATIONMANAGEMENT
= $
(ROOTSVCAPPLICATION
)/management
227 ROOTSVCAPPLICATIONSECURITY
= $
(ROOTSVCAPPLICATION
)/security
228 ROOTSVCAPPLICATIONPRINT
= $
(ROOTSVCAPPLICATION
)/print
231 # Commands Makefiles delivering a manifest are expected to define MANIFEST.
233 # Like ROOTCMDDIR
, any lower
-level Makefiles that put their manifests in a
234 # subdirectory of the manifest directories listed above should reset
235 # ROOTMANIFESTDIR and
use it in their `install
' target. By default we set this
236 # to a bogus value so that it will not conflict with any of the other values
237 # already defined in this Makefile.
239 # The manifest validation of the $SRC/cmd check target is also derived from a
240 # valid MANIFEST setting.
242 ROOTMANIFESTDIR= $(ROOTSVCMANIFEST)/__nonexistent_directory__
243 ROOTMANIFEST= $(MANIFEST:%=$(ROOTMANIFESTDIR)/%)
244 CHKMANIFEST= $(MANIFEST:%.xml=%.xmlchk)
246 # Manifests cannot be checked in parallel, because we are using the global
247 # repository that is in $(SRC)/cmd/svc/seed/global.db. This is a
248 # repository that is built from the manifests in this workspace, whereas
249 # the build machine's repository may be out of sync with these manifests.
250 # Because we are using a private repository
, svccfg
-native must
start up a
251 # private
copy of configd
-native. We cannot have multiple copies of
252 # configd
-native trying to access global.db simultaneously.
254 .NO_PARALLEL
: $
(CHKMANIFEST
)
257 #
For installing
"starter scripts" of services
260 ROOTSVCMETHOD
= $
(SVCMETHOD
:%=$
(ROOTLIBSVCMETHOD
)/%)
262 ROOTSVCBINDIR
= $
(ROOTLIBSVCBIN
)/__nonexistent_directory__
263 ROOTSVCBIN
= $
(SVCBIN
:%=$
(ROOTSVCBINDIR
)/%)
267 #
For programs that are installed in the root filesystem
,
268 # build $
(ROOTFS_PROG
) rather than $
(PROG
)
269 $
(ROOTFS_PROG
) := LDFLAGS
+= -Wl
,-I
/lib
/ld.so
.1
301 $
(ROOTCLASS_SCR_DIR
)/%: %
304 $
(ROOTADMIN_SRC_DIR
)/%: %
313 $
(ROOTUSRSBIN32
)/%: %
316 $
(ROOTUSRSBIN64
)/%: %
328 $
(ROOTETCDEFAULT
)/%: %.dfl
334 $
(ROOTETCSECLIB
)/%: %
346 $
(ROOTXPG4BIN
)/%: %.xpg4
349 $
(ROOTXPG4BIN32
)/%: %.xpg4
352 $
(ROOTXPG4BIN64
)/%: %.xpg4
355 $
(ROOTXPG6BIN
)/%: %.xpg6
358 $
(ROOTLOCALEDEF
)/%: %
367 $
(ROOTI18NEXT64
)/%: %
370 $
(ROOTLIBSVCMETHOD
)/%: %
373 $
(ROOTLIBSVCBIN
)/%: %
376 $
(ROOTSVCMILESTONE
)/%: %
379 $
(ROOTSVCDEVICE
)/%: %
382 $
(ROOTSVCSYSTEM
)/%: %
385 $
(ROOTSVCSYSTEMDEVICE
)/%: %
388 $
(ROOTSVCSYSTEMFILESYSTEM
)/%: %
391 $
(ROOTSVCSYSTEMSECURITY
)/%: %
394 $
(ROOTSVCNETWORK
)/%: %
397 $
(ROOTSVCNETWORKLDAP
)/%: %
400 $
(ROOTSVCNETWORKNFS
)/%: %
403 $
(ROOTSVCNETWORKNIS
)/%: %
406 $
(ROOTSVCNETWORKRPC
)/%: %
409 $
(ROOTSVCNETWORKSECURITY
)/%: %
412 $
(ROOTSVCNETWORKIPSEC
)/%: %
415 $
(ROOTSVCNETWORKSHARES
)/%: %
418 $
(ROOTSVCNETWORKSMB
)/%: %
421 $
(ROOTSVCAPPLICATION
)/%: %
424 $
(ROOTSVCAPPLICATIONMANAGEMENT
)/%: %
427 $
(ROOTSVCAPPLICATIONSECURITY
)/%: %
430 $
(ROOTSVCAPPLICATIONPRINT
)/%: %
433 $
(ROOTSVCPLATFORM
)/%: %
436 $
(ROOTSVCPLATFORMSUN4U
)/%: %
439 $
(ROOTSVCPLATFORMSUN4V
)/%: %
442 # Install rule
for gprof
, yacc
, and lex dependency
files
443 $
(ROOTSHLIBCCS
)/%: ..
/common
/%
446 $
(ROOTCCSBINLINKDIR
)/%: %
449 $
(ROOTCCSBINLINKDIR64
)/%: %
455 # build rule
for statically linked programs with single source file.
457 $
(LINK.c
) -o $@ $
< $
(LDLIBS
)
461 $
(LINK.c
) -o $@ $
< $
(LDLIBS
)
465 $
(LINK.c
) -o $@ $
< $
(LDLIBS
)
468 # Define the majority text domain in this directory.
469 TEXT_DOMAIN
= SUNW_OST_OSCMD
471 CLOBBERFILES
+= $
(XPG4
) $
(XPG6
) $
(DCFILE
)
473 # This flag is
for programs which should
not build a
32-bit binary
474 sparc_64ONLY
= $
(POUND_SIGN
)
475 64ONLY
= $
($
(MACH
)_64ONLY
)