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
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
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)
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.
147 $
(RM
) $
(ROOTCCSBINPROG
); \
148 $
(SYMLINK
) ..
/..
/bin
/$
(PROG
) $
(ROOTCCSBINPROG
)
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
279 $
(ROOTUSRSBIN32
)/%: %
282 $
(ROOTUSRSBIN64
)/%: %
294 $
(ROOTETCDEFAULT
)/%: %.dfl
297 $
(ROOTETCSECLIB
)/%: %
306 $
(ROOTLOCALEDEF
)/%: %
315 $
(ROOTI18NEXT64
)/%: %
318 $
(ROOTLIBSVCMETHOD
)/%: %
321 $
(ROOTLIBSVCBIN
)/%: %
324 $
(ROOTSVCMILESTONE
)/%: %
327 $
(ROOTSVCDEVICE
)/%: %
330 $
(ROOTSVCSYSTEM
)/%: %
333 $
(ROOTSVCSYSTEMDEVICE
)/%: %
336 $
(ROOTSVCSYSTEMFILESYSTEM
)/%: %
339 $
(ROOTSVCSYSTEMSECURITY
)/%: %
342 $
(ROOTSVCNETWORK
)/%: %
345 $
(ROOTSVCNETWORKLDAP
)/%: %
348 $
(ROOTSVCNETWORKNFS
)/%: %
351 $
(ROOTSVCNETWORKNIS
)/%: %
354 $
(ROOTSVCNETWORKRPC
)/%: %
357 $
(ROOTSVCNETWORKSECURITY
)/%: %
360 $
(ROOTSVCNETWORKIPSEC
)/%: %
363 $
(ROOTSVCNETWORKSHARES
)/%: %
366 $
(ROOTSVCNETWORKSMB
)/%: %
369 $
(ROOTSVCAPPLICATION
)/%: %
372 $
(ROOTSVCAPPLICATIONMANAGEMENT
)/%: %
375 $
(ROOTSVCAPPLICATIONSECURITY
)/%: %
378 $
(ROOTSVCAPPLICATIONPRINT
)/%: %
381 $
(ROOTSVCPLATFORM
)/%: %
384 $
(ROOTSVCPLATFORMSUN4U
)/%: %
387 $
(ROOTSVCPLATFORMSUN4V
)/%: %
390 # Install rule
for gprof
, yacc
, and lex dependency
files
391 $
(ROOTSHLIBCCS
)/%: ..
/common
/%
394 $
(ROOTCCSBINLINKDIR
)/%: %
397 $
(ROOTCCSBINLINKDIR64
)/%: %
403 # build rule
for statically linked programs with single source file.
405 $
(LINK.c
) -o $@ $
< $
(LDLIBS
)
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
)