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 ISAEXEC
= $
(ROOT
)/usr
/lib
/isaexec
96 PLATEXEC
= $
(ROOT
)/usr
/lib
/platexec
98 LDLIBS
= $
(LDLIBS.
cmd)
101 $
(BDIRECT
) $
(ENVLDFLAGS1
) $
(ENVLDFLAGS2
) $
(ENVLDFLAGS3
) \
102 $
(MAPFILE.PGA
:%=-Wl
,-M
%)
104 LDFLAGS
= $
(LDFLAGS.
cmd)
107 KRB5PROG
= $
(PROG
:%=$
(KRB5BIN
)/%)
108 KRB5SBINPROG
= $
(PROG
:%=$
(KRB5SBIN
)/%)
109 KRB5LIBPROG
= $
(PROG
:%=$
(KRB5LIB
)/%)
111 ROOTPROG
= $
(PROG
:%=$
(ROOTBIN
)/%)
112 ROOTCMD
= $
(PROG
:%=$
(ROOTCMDDIR
)/%)
113 ROOTSHFILES
= $
(SHFILES
:%=$
(ROOTBIN
)/%)
114 ROOTLIBPROG
= $
(PROG
:%=$
(ROOTLIB
)/%)
115 ROOTLIBSHFILES
= $
(SHFILES
:%=$
(ROOTLIB
)/%)
116 ROOTSHLIBPROG
= $
(PROG
:%=$
(ROOTSHLIB
)/%)
117 ROOTSBINPROG
= $
(PROG
:%=$
(ROOTSBIN
)/%)
118 ROOTUSRSBINPROG
=$
(PROG
:%=$
(ROOTUSRSBIN
)/%)
119 ROOTUSRSBINSCRIPT
=$
(SCRIPT
:%=$
(ROOTUSRSBIN
)/%)
120 ROOTETCPROG
= $
(PROG
:%=$
(ROOTETC
)/%)
121 ROOTCCSBINPROG
= $
(PROG
:%=$
(ROOTCCSBIN
)/%)
122 ROOTCCSBINPROG64
= $
(PROG
:%=$
(ROOTCCSBIN64
)/%)
123 ROOTCCSBINLINK
=$
(PROG
:%= $
(ROOTCCSBINLINKDIR
)/%)
124 ROOTCCSBINLINK64
=$
(PROG
:%=$
(ROOTCCSBINLINKDIR64
)/%)
125 ROOTLOCALEPROG
= $
(PROG
:%=$
(ROOTLOCALEDEF
)/%)
126 ROOTPROG64
= $
(PROG
:%=$
(ROOTBIN64
)/%)
127 ROOTPROG32
= $
(PROG
:%=$
(ROOTBIN32
)/%)
128 ROOTCMD64
= $
(PROG
:%=$
(ROOTCMDDIR64
)/%)
129 ROOTUSRSBINPROG32
= $
(PROG
:%=$
(ROOTUSRSBIN32
)/%)
130 ROOTUSRSBINPROG64
= $
(PROG
:%=$
(ROOTUSRSBIN64
)/%)
131 ROOTMAN1FILES
= $
(MAN1FILES
:%=$
(ROOTMAN1
)/%)
132 $
(ROOTMAN1FILES
) := FILEMODE
= 444
133 ROOTMAN1MFILES
= $
(MAN1MFILES
:%=$
(ROOTMAN1M
)/%)
134 $
(ROOTMAN1MFILES
) := FILEMODE
= 444
135 ROOTMAN3FILES
= $
(MAN3FILES
:%=$
(ROOTMAN3
)/%)
136 $
(ROOTMAN3FILES
) := FILEMODE
= 444
138 # Symlink rules
for /usr
/ccs
/bin commands. Note
, those commands under
139 # the rule of the linker area
, are controlled by a different
set of
140 # rules defined in $
(SRC
)/cmd/sgs
/Makefile.var.
143 $
(RM
) $
(ROOTCCSBINPROG
); \
144 $
(SYMLINK
) ..
/..
/bin
/$
(PROG
) $
(ROOTCCSBINPROG
)
147 $
(RM
) $
(ROOTCCSBINPROG64
); \
148 $
(SYMLINK
) ..
/..
/..
/bin
/$
(MACH64
)/$
(PROG
) $
(ROOTCCSBINPROG64
)
150 ROOTETCDEFAULT
= $
(ROOTETC
)/default
151 ROOTETCDEFAULTFILES
= $
(DEFAULTFILES
:%.dfl
=$
(ROOTETCDEFAULT
)/%)
152 $
(ROOTETCDEFAULTFILES
) := FILEMODE
= 0644
154 ROOTETCSECFILES
= $
(ETCSECFILES
:%=$
(ROOTETCSECURITY
)/%)
155 $
(ROOTETCSECFILES
) := FILEMODE
= 0644
157 ROOTETCSECLIBFILES
= $
(ETCSECLIBFILES
:%=$
(ROOTETCSECLIB
)/%)
159 ROOTETCZONESFILES
= $
(ETCZONESFILES
:%=$
(ROOTETCZONES
)/%)
160 $
(ROOTETCZONESFILES
) := FILEMODE
= 0444
162 ROOTLIBZONESFILES
= $
(LIBZONESFILES
:%=$
(ROOTLIBZONES
)/%)
163 $
(ROOTLIBZONESFILES
) := FILEMODE
= 0555
166 # Directories
for smf
(5) service manifests and profiles.
168 ROOTSVC
= $
(ROOT
)/lib
/svc
169 ROOTETCSVC
= $
(ROOT
)/etc
/svc
171 ROOTSVCMANIFEST
= $
(ROOTSVC
)/manifest
172 ROOTSVCPROFILE
= $
(ROOTETCSVC
)/profile
174 ROOTSVCMILESTONE
= $
(ROOTSVCMANIFEST
)/milestone
175 ROOTSVCDEVICE
= $
(ROOTSVCMANIFEST
)/device
176 ROOTSVCSYSTEM
= $
(ROOTSVCMANIFEST
)/system
177 ROOTSVCSYSTEMDEVICE
= $
(ROOTSVCSYSTEM
)/device
178 ROOTSVCSYSTEMFILESYSTEM
= $
(ROOTSVCSYSTEM
)/filesystem
179 ROOTSVCSYSTEMSECURITY
= $
(ROOTSVCSYSTEM
)/security
180 ROOTSVCNETWORK
= $
(ROOTSVCMANIFEST
)/network
181 ROOTSVCNETWORKDNS
= $
(ROOTSVCNETWORK
)/dns
182 ROOTSVCNETWORKISCSI
= $
(ROOTSVCNETWORK
)/iscsi
183 ROOTSVCNETWORKLDAP
= $
(ROOTSVCNETWORK
)/ldap
184 ROOTSVCNETWORKNFS
= $
(ROOTSVCNETWORK
)/nfs
185 ROOTSVCNETWORKNIS
= $
(ROOTSVCNETWORK
)/nis
186 ROOTSVCNETWORKROUTING
= $
(ROOTSVCNETWORK
)/routing
187 ROOTSVCNETWORKRPC
= $
(ROOTSVCNETWORK
)/rpc
188 ROOTSVCNETWORKSMB
= $
(ROOTSVCNETWORK
)/smb
189 ROOTSVCNETWORKSECURITY
= $
(ROOTSVCNETWORK
)/security
190 ROOTSVCNETWORKIPSEC
= $
(ROOTSVCNETWORK
)/ipsec
191 ROOTSVCNETWORKSHARES
= $
(ROOTSVCNETWORK
)/shares
192 ROOTSVCSMB
= $
(ROOTSVCNETWORK
)/smb
193 ROOTSVCPLATFORM
= $
(ROOTSVCMANIFEST
)/platform
194 ROOTSVCPLATFORMSUN4U
= $
(ROOTSVCPLATFORM
)/sun4u
195 ROOTSVCPLATFORMSUN4V
= $
(ROOTSVCPLATFORM
)/sun4v
196 ROOTSVCAPPLICATION
= $
(ROOTSVCMANIFEST
)/application
197 ROOTSVCAPPLICATIONMANAGEMENT
= $
(ROOTSVCAPPLICATION
)/management
198 ROOTSVCAPPLICATIONSECURITY
= $
(ROOTSVCAPPLICATION
)/security
199 ROOTSVCAPPLICATIONPRINT
= $
(ROOTSVCAPPLICATION
)/print
202 # Commands Makefiles delivering a manifest are expected to define MANIFEST.
204 # Like ROOTCMDDIR
, any lower
-level Makefiles that put their manifests in a
205 # subdirectory of the manifest directories listed above should reset
206 # ROOTMANIFESTDIR and
use it in their `install
' target. By default we set this
207 # to a bogus value so that it will not conflict with any of the other values
208 # already defined in this Makefile.
210 # The manifest validation of the $SRC/cmd check target is also derived from a
211 # valid MANIFEST setting.
213 ROOTMANIFESTDIR= $(ROOTSVCMANIFEST)/__nonexistent_directory__
214 ROOTMANIFEST= $(MANIFEST:%=$(ROOTMANIFESTDIR)/%)
215 CHKMANIFEST= $(MANIFEST:%.xml=%.xmlchk)
217 # Manifests cannot be checked in parallel, because we are using the global
218 # repository that is in $(SRC)/cmd/svc/seed/global.db. This is a
219 # repository that is built from the manifests in this workspace, whereas
220 # the build machine's repository may be out of sync with these manifests.
221 # Because we are using a private repository
, svccfg
-native must
start up a
222 # private
copy of configd
-native. We cannot have multiple copies of
223 # configd
-native trying to access global.db simultaneously.
225 .NO_PARALLEL
: $
(CHKMANIFEST
)
228 #
For installing
"starter scripts" of services
231 ROOTSVCMETHOD
= $
(SVCMETHOD
:%=$
(ROOTLIBSVCMETHOD
)/%)
233 ROOTSVCBINDIR
= $
(ROOTLIBSVCBIN
)/__nonexistent_directory__
234 ROOTSVCBIN
= $
(SVCBIN
:%=$
(ROOTSVCBINDIR
)/%)
238 #
For programs that are installed in the root filesystem
,
239 # build $
(ROOTFS_PROG
) rather than $
(PROG
)
240 $
(ROOTFS_PROG
) := LDFLAGS
+= -Wl
,-I
/lib
/ld.so
.1
275 $
(ROOTUSRSBIN32
)/%: %
278 $
(ROOTUSRSBIN64
)/%: %
290 $
(ROOTETCDEFAULT
)/%: %.dfl
293 $
(ROOTETCSECLIB
)/%: %
302 $
(ROOTLOCALEDEF
)/%: %
311 $
(ROOTI18NEXT64
)/%: %
314 $
(ROOTLIBSVCMETHOD
)/%: %
317 $
(ROOTLIBSVCBIN
)/%: %
320 $
(ROOTSVCMILESTONE
)/%: %
323 $
(ROOTSVCDEVICE
)/%: %
326 $
(ROOTSVCSYSTEM
)/%: %
329 $
(ROOTSVCSYSTEMDEVICE
)/%: %
332 $
(ROOTSVCSYSTEMFILESYSTEM
)/%: %
335 $
(ROOTSVCSYSTEMSECURITY
)/%: %
338 $
(ROOTSVCNETWORK
)/%: %
341 $
(ROOTSVCNETWORKLDAP
)/%: %
344 $
(ROOTSVCNETWORKNFS
)/%: %
347 $
(ROOTSVCNETWORKNIS
)/%: %
350 $
(ROOTSVCNETWORKRPC
)/%: %
353 $
(ROOTSVCNETWORKSECURITY
)/%: %
356 $
(ROOTSVCNETWORKIPSEC
)/%: %
359 $
(ROOTSVCNETWORKSHARES
)/%: %
362 $
(ROOTSVCNETWORKSMB
)/%: %
365 $
(ROOTSVCAPPLICATION
)/%: %
368 $
(ROOTSVCAPPLICATIONMANAGEMENT
)/%: %
371 $
(ROOTSVCAPPLICATIONSECURITY
)/%: %
374 $
(ROOTSVCAPPLICATIONPRINT
)/%: %
377 $
(ROOTSVCPLATFORM
)/%: %
380 $
(ROOTSVCPLATFORMSUN4U
)/%: %
383 $
(ROOTSVCPLATFORMSUN4V
)/%: %
386 # Install rule
for gprof
, yacc
, and lex dependency
files
387 $
(ROOTSHLIBCCS
)/%: ..
/common
/%
390 $
(ROOTCCSBINLINKDIR
)/%: %
393 $
(ROOTCCSBINLINKDIR64
)/%: %
399 # build rule
for statically linked programs with single source file.
401 $
(LINK.c
) -o $@ $
< $
(LDLIBS
)
404 # Define the majority text domain in this directory.
405 TEXT_DOMAIN
= SUNW_OST_OSCMD
407 CLOBBERFILES
+= $
(DCFILE
)
409 # This flag is
for programs which should
not build a
32-bit binary
410 sparc_64ONLY
= $
(POUND_SIGN
)
411 64ONLY
= $
($
(MACH
)_64ONLY
)