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
56 ROOTPKGBIN= $(ROOT)/usr/sadm/install/bin
57 ROOTCLASS_SCR_DIR= $(ROOT)/usr/sadm/install/scripts
58 ROOTADMIN_SRC_DIR= $(ROOT)/var/sadm/install/admin
60 ROOTSHLIBCCS= $(ROOTSHLIB)/ccs
61 ROOTSBIN= $(ROOT)/sbin
62 ROOTUSRSBIN= $(ROOT)/usr/sbin
65 ROOTETCSECURITY= $(ROOTETC)/security
66 ROOTETCSECLIB= $(ROOTETCSECURITY)/lib
67 ROOTETCZONES= $(ROOTETC)/zones
69 ROOTETCFTPD= $(ROOT)/etc/ftpd
70 ROOTETCINET= $(ROOT)/etc/inet
71 ROOTCCSBIN= $(ROOT)/usr/ccs/bin
72 ROOTCCSBIN64= $(ROOTCCSBIN)/$(MACH64)
73 ROOTCCSBINLINKDIR= $(ROOT)/../../bin
74 ROOTCCSBINLINKDIR64= $(ROOT)../../../bin/$(MACH)
75 ROOTCCSLIB= $(ROOT)/usr/ccs/lib
76 ROOTBIN32= $(ROOTBIN)/$(MACH32)
77 ROOTBIN64= $(ROOTBIN)/$(MACH64)
78 ROOTCMDDIR64= $(ROOTCMDDIR)/$(MACH64)
79 ROOTLIB64= $(ROOTLIB)/$(MACH64)
80 ROOTUSRSBIN32= $(ROOTUSRSBIN)/$(MACH32)
81 ROOTUSRSBIN64= $(ROOTUSRSBIN)/$(MACH64)
82 ROOTMAN= $(ROOT)/usr/share/man
83 ROOTMAN1= $(ROOTMAN)/man1
84 ROOTMAN1M= $(ROOTMAN)/man1m
85 ROOTMAN3= $(ROOTMAN)/man3
86 ROOTVARSMB= $(ROOT)/var/smb
90 # Like ROOTLIBDIR in $(SRC)/Makefile.lib, any lower-level Makefiles that
91 # put their binaries in a non-standard location should reset this and use
92 # $(ROOTCMD) in their `install' target. By default we
set this to a bogus
93 # value so that it will
not conflict with any of the other values already
94 # defined in this Makefile.
96 ROOTCMDDIR
= $
(ROOT
)/__nonexistent_directory__
98 ROOTSHAUDIO
= $
(ROOT
)/usr
/share
/audio
99 ROOTAUDIOSAMP
= $
(ROOTSHAUDIO
)/samples
100 ROOTAUDIOSAMPAU
=$
(ROOTAUDIOSAMP
)/au
102 ISAEXEC
= $
(ROOT
)/usr
/lib
/isaexec
103 PLATEXEC
= $
(ROOT
)/usr
/lib
/platexec
105 LDLIBS
= $
(LDLIBS.
cmd)
108 $
(BDIRECT
) $
(ENVLDFLAGS1
) $
(ENVLDFLAGS2
) $
(ENVLDFLAGS3
) \
109 $
(MAPFILE.PGA
:%=-Wl
,-M
%)
111 LDFLAGS
= $
(LDFLAGS.
cmd)
114 KRB5PROG
= $
(PROG
:%=$
(KRB5BIN
)/%)
115 KRB5SBINPROG
= $
(PROG
:%=$
(KRB5SBIN
)/%)
116 KRB5LIBPROG
= $
(PROG
:%=$
(KRB5LIB
)/%)
118 ROOTPROG
= $
(PROG
:%=$
(ROOTBIN
)/%)
119 ROOTCMD
= $
(PROG
:%=$
(ROOTCMDDIR
)/%)
120 ROOTSHFILES
= $
(SHFILES
:%=$
(ROOTBIN
)/%)
121 ROOTLIBPROG
= $
(PROG
:%=$
(ROOTLIB
)/%)
122 ROOTLIBSHFILES
= $
(SHFILES
:%=$
(ROOTLIB
)/%)
123 ROOTSHLIBPROG
= $
(PROG
:%=$
(ROOTSHLIB
)/%)
124 ROOTSBINPROG
= $
(PROG
:%=$
(ROOTSBIN
)/%)
125 ROOTPKGBINPROG
= $
(PROG
:%=$
(ROOTPKGBIN
)/%)
126 ROOTCLASS_SCR_FILES
= $
(SCRIPTS
:%=$
(ROOTCLASS_SCR_DIR
)/%)
127 ROOTUSRSBINPROG
=$
(PROG
:%=$
(ROOTUSRSBIN
)/%)
128 ROOTUSRSBINSCRIPT
=$
(SCRIPT
:%=$
(ROOTUSRSBIN
)/%)
129 ROOTETCPROG
= $
(PROG
:%=$
(ROOTETC
)/%)
130 ROOTCCSBINPROG
= $
(PROG
:%=$
(ROOTCCSBIN
)/%)
131 ROOTCCSBINPROG64
= $
(PROG
:%=$
(ROOTCCSBIN64
)/%)
132 ROOTCCSBINLINK
=$
(PROG
:%= $
(ROOTCCSBINLINKDIR
)/%)
133 ROOTCCSBINLINK64
=$
(PROG
:%=$
(ROOTCCSBINLINKDIR64
)/%)
134 ROOTLOCALEPROG
= $
(PROG
:%=$
(ROOTLOCALEDEF
)/%)
135 ROOTPROG64
= $
(PROG
:%=$
(ROOTBIN64
)/%)
136 ROOTPROG32
= $
(PROG
:%=$
(ROOTBIN32
)/%)
137 ROOTCMD64
= $
(PROG
:%=$
(ROOTCMDDIR64
)/%)
138 ROOTUSRSBINPROG32
= $
(PROG
:%=$
(ROOTUSRSBIN32
)/%)
139 ROOTUSRSBINPROG64
= $
(PROG
:%=$
(ROOTUSRSBIN64
)/%)
140 ROOTMAN1FILES
= $
(MAN1FILES
:%=$
(ROOTMAN1
)/%)
141 $
(ROOTMAN1FILES
) := FILEMODE
= 444
142 ROOTMAN1MFILES
= $
(MAN1MFILES
:%=$
(ROOTMAN1M
)/%)
143 $
(ROOTMAN1MFILES
) := FILEMODE
= 444
144 ROOTMAN3FILES
= $
(MAN3FILES
:%=$
(ROOTMAN3
)/%)
145 $
(ROOTMAN3FILES
) := FILEMODE
= 444
147 # Symlink rules
for /usr
/ccs
/bin commands. Note
, those commands under
148 # the rule of the linker area
, are controlled by a different
set of
149 # rules defined in $
(SRC
)/cmd/sgs
/Makefile.var.
152 $
(RM
) $
(ROOTCCSBINPROG
); \
153 $
(SYMLINK
) ..
/..
/bin
/$
(PROG
) $
(ROOTCCSBINPROG
)
156 $
(RM
) $
(ROOTCCSBINPROG64
); \
157 $
(SYMLINK
) ..
/..
/..
/bin
/$
(MACH64
)/$
(PROG
) $
(ROOTCCSBINPROG64
)
159 ROOTETCDEFAULT
= $
(ROOTETC
)/default
160 ROOTETCDEFAULTFILES
= $
(DEFAULTFILES
:%.dfl
=$
(ROOTETCDEFAULT
)/%)
161 $
(ROOTETCDEFAULTFILES
) := FILEMODE
= 0644
163 ROOTETCSECFILES
= $
(ETCSECFILES
:%=$
(ROOTETCSECURITY
)/%)
164 $
(ROOTETCSECFILES
) := FILEMODE
= 0644
166 ROOTETCSECLIBFILES
= $
(ETCSECLIBFILES
:%=$
(ROOTETCSECLIB
)/%)
168 ROOTETCZONESFILES
= $
(ETCZONESFILES
:%=$
(ROOTETCZONES
)/%)
169 $
(ROOTETCZONESFILES
) := FILEMODE
= 0444
171 ROOTLIBZONESFILES
= $
(LIBZONESFILES
:%=$
(ROOTLIBZONES
)/%)
172 $
(ROOTLIBZONESFILES
) := FILEMODE
= 0555
174 ROOTADMIN_SRC_FILE
= $
(ADMINFILE
:%=$
(ROOTADMIN_SRC_DIR
)/%)
175 $
(ROOTADMIN_SRC_FILE
) := FILEMODE
= 0444
178 # Directories
for smf
(5) service manifests and profiles.
180 ROOTSVC
= $
(ROOT
)/lib
/svc
181 ROOTETCSVC
= $
(ROOT
)/etc
/svc
183 ROOTSVCMANIFEST
= $
(ROOTSVC
)/manifest
184 ROOTSVCPROFILE
= $
(ROOTETCSVC
)/profile
186 ROOTSVCMILESTONE
= $
(ROOTSVCMANIFEST
)/milestone
187 ROOTSVCDEVICE
= $
(ROOTSVCMANIFEST
)/device
188 ROOTSVCSYSTEM
= $
(ROOTSVCMANIFEST
)/system
189 ROOTSVCSYSTEMDEVICE
= $
(ROOTSVCSYSTEM
)/device
190 ROOTSVCSYSTEMFILESYSTEM
= $
(ROOTSVCSYSTEM
)/filesystem
191 ROOTSVCSYSTEMSECURITY
= $
(ROOTSVCSYSTEM
)/security
192 ROOTSVCNETWORK
= $
(ROOTSVCMANIFEST
)/network
193 ROOTSVCNETWORKDNS
= $
(ROOTSVCNETWORK
)/dns
194 ROOTSVCNETWORKISCSI
= $
(ROOTSVCNETWORK
)/iscsi
195 ROOTSVCNETWORKLDAP
= $
(ROOTSVCNETWORK
)/ldap
196 ROOTSVCNETWORKNFS
= $
(ROOTSVCNETWORK
)/nfs
197 ROOTSVCNETWORKNIS
= $
(ROOTSVCNETWORK
)/nis
198 ROOTSVCNETWORKROUTING
= $
(ROOTSVCNETWORK
)/routing
199 ROOTSVCNETWORKRPC
= $
(ROOTSVCNETWORK
)/rpc
200 ROOTSVCNETWORKSMB
= $
(ROOTSVCNETWORK
)/smb
201 ROOTSVCNETWORKSECURITY
= $
(ROOTSVCNETWORK
)/security
202 ROOTSVCNETWORKIPSEC
= $
(ROOTSVCNETWORK
)/ipsec
203 ROOTSVCNETWORKSHARES
= $
(ROOTSVCNETWORK
)/shares
204 ROOTSVCSMB
= $
(ROOTSVCNETWORK
)/smb
205 ROOTSVCPLATFORM
= $
(ROOTSVCMANIFEST
)/platform
206 ROOTSVCPLATFORMSUN4U
= $
(ROOTSVCPLATFORM
)/sun4u
207 ROOTSVCPLATFORMSUN4V
= $
(ROOTSVCPLATFORM
)/sun4v
208 ROOTSVCAPPLICATION
= $
(ROOTSVCMANIFEST
)/application
209 ROOTSVCAPPLICATIONMANAGEMENT
= $
(ROOTSVCAPPLICATION
)/management
210 ROOTSVCAPPLICATIONSECURITY
= $
(ROOTSVCAPPLICATION
)/security
211 ROOTSVCAPPLICATIONPRINT
= $
(ROOTSVCAPPLICATION
)/print
214 # Commands Makefiles delivering a manifest are expected to define MANIFEST.
216 # Like ROOTCMDDIR
, any lower
-level Makefiles that put their manifests in a
217 # subdirectory of the manifest directories listed above should reset
218 # ROOTMANIFESTDIR and
use it in their `install
' target. By default we set this
219 # to a bogus value so that it will not conflict with any of the other values
220 # already defined in this Makefile.
222 # The manifest validation of the $SRC/cmd check target is also derived from a
223 # valid MANIFEST setting.
225 ROOTMANIFESTDIR= $(ROOTSVCMANIFEST)/__nonexistent_directory__
226 ROOTMANIFEST= $(MANIFEST:%=$(ROOTMANIFESTDIR)/%)
227 CHKMANIFEST= $(MANIFEST:%.xml=%.xmlchk)
229 # Manifests cannot be checked in parallel, because we are using the global
230 # repository that is in $(SRC)/cmd/svc/seed/global.db. This is a
231 # repository that is built from the manifests in this workspace, whereas
232 # the build machine's repository may be out of sync with these manifests.
233 # Because we are using a private repository
, svccfg
-native must
start up a
234 # private
copy of configd
-native. We cannot have multiple copies of
235 # configd
-native trying to access global.db simultaneously.
237 .NO_PARALLEL
: $
(CHKMANIFEST
)
240 #
For installing
"starter scripts" of services
243 ROOTSVCMETHOD
= $
(SVCMETHOD
:%=$
(ROOTLIBSVCMETHOD
)/%)
245 ROOTSVCBINDIR
= $
(ROOTLIBSVCBIN
)/__nonexistent_directory__
246 ROOTSVCBIN
= $
(SVCBIN
:%=$
(ROOTSVCBINDIR
)/%)
250 #
For programs that are installed in the root filesystem
,
251 # build $
(ROOTFS_PROG
) rather than $
(PROG
)
252 $
(ROOTFS_PROG
) := LDFLAGS
+= -Wl
,-I
/lib
/ld.so
.1
284 $
(ROOTCLASS_SCR_DIR
)/%: %
287 $
(ROOTADMIN_SRC_DIR
)/%: %
296 $
(ROOTUSRSBIN32
)/%: %
299 $
(ROOTUSRSBIN64
)/%: %
311 $
(ROOTETCDEFAULT
)/%: %.dfl
314 $
(ROOTETCSECLIB
)/%: %
323 $
(ROOTLOCALEDEF
)/%: %
332 $
(ROOTI18NEXT64
)/%: %
335 $
(ROOTLIBSVCMETHOD
)/%: %
338 $
(ROOTLIBSVCBIN
)/%: %
341 $
(ROOTSVCMILESTONE
)/%: %
344 $
(ROOTSVCDEVICE
)/%: %
347 $
(ROOTSVCSYSTEM
)/%: %
350 $
(ROOTSVCSYSTEMDEVICE
)/%: %
353 $
(ROOTSVCSYSTEMFILESYSTEM
)/%: %
356 $
(ROOTSVCSYSTEMSECURITY
)/%: %
359 $
(ROOTSVCNETWORK
)/%: %
362 $
(ROOTSVCNETWORKLDAP
)/%: %
365 $
(ROOTSVCNETWORKNFS
)/%: %
368 $
(ROOTSVCNETWORKNIS
)/%: %
371 $
(ROOTSVCNETWORKRPC
)/%: %
374 $
(ROOTSVCNETWORKSECURITY
)/%: %
377 $
(ROOTSVCNETWORKIPSEC
)/%: %
380 $
(ROOTSVCNETWORKSHARES
)/%: %
383 $
(ROOTSVCNETWORKSMB
)/%: %
386 $
(ROOTSVCAPPLICATION
)/%: %
389 $
(ROOTSVCAPPLICATIONMANAGEMENT
)/%: %
392 $
(ROOTSVCAPPLICATIONSECURITY
)/%: %
395 $
(ROOTSVCAPPLICATIONPRINT
)/%: %
398 $
(ROOTSVCPLATFORM
)/%: %
401 $
(ROOTSVCPLATFORMSUN4U
)/%: %
404 $
(ROOTSVCPLATFORMSUN4V
)/%: %
407 # Install rule
for gprof
, yacc
, and lex dependency
files
408 $
(ROOTSHLIBCCS
)/%: ..
/common
/%
411 $
(ROOTCCSBINLINKDIR
)/%: %
414 $
(ROOTCCSBINLINKDIR64
)/%: %
420 # build rule
for statically linked programs with single source file.
422 $
(LINK.c
) -o $@ $
< $
(LDLIBS
)
425 # Define the majority text domain in this directory.
426 TEXT_DOMAIN
= SUNW_OST_OSCMD
428 CLOBBERFILES
+= $
(DCFILE
)
430 # This flag is
for programs which should
not build a
32-bit binary
431 sparc_64ONLY
= $
(POUND_SIGN
)
432 64ONLY
= $
($
(MACH
)_64ONLY
)