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 ROOTBIN32= $(ROOTBIN)/$(MACH32)
69 ROOTBIN64= $(ROOTBIN)/$(MACH64)
70 ROOTCMDDIR64= $(ROOTCMDDIR)/$(MACH64)
71 ROOTLIB64= $(ROOTLIB)/$(MACH64)
72 ROOTUSRSBIN32= $(ROOTUSRSBIN)/$(MACH32)
73 ROOTUSRSBIN64= $(ROOTUSRSBIN)/$(MACH64)
74 ROOTMAN= $(ROOT)/usr/share/man
75 ROOTMAN1= $(ROOTMAN)/man1
76 ROOTMAN3= $(ROOTMAN)/man3
77 ROOTMAN8= $(ROOTMAN)/man8
78 ROOTVARSMB= $(ROOT)/var/smb
82 # Like ROOTLIBDIR in $(SRC)/Makefile.lib, any lower-level Makefiles that
83 # put their binaries in a non-standard location should reset this and use
84 # $(ROOTCMD) in their `install' target. By default we
set this to a bogus
85 # value so that it will
not conflict with any of the other values already
86 # defined in this Makefile.
88 ROOTCMDDIR
= $
(ROOT
)/__nonexistent_directory__
90 ISAEXEC
= $
(ROOT
)/usr
/lib
/isaexec
91 PLATEXEC
= $
(ROOT
)/usr
/lib
/platexec
93 LDLIBS
= $
(LDLIBS.
cmd)
96 $
(BDIRECT
) $
(ENVLDFLAGS1
) $
(ENVLDFLAGS2
) $
(ENVLDFLAGS3
) \
97 $
(MAPFILE.PGA
:%=-Wl
,-M
%)
99 LDFLAGS
= $
(LDFLAGS.
cmd)
102 KRB5PROG
= $
(PROG
:%=$
(KRB5BIN
)/%)
103 KRB5SBINPROG
= $
(PROG
:%=$
(KRB5SBIN
)/%)
104 KRB5LIBPROG
= $
(PROG
:%=$
(KRB5LIB
)/%)
106 ROOTPROG
= $
(PROG
:%=$
(ROOTBIN
)/%)
107 ROOTCMD
= $
(PROG
:%=$
(ROOTCMDDIR
)/%)
108 ROOTSHFILES
= $
(SHFILES
:%=$
(ROOTBIN
)/%)
109 ROOTLIBPROG
= $
(PROG
:%=$
(ROOTLIB
)/%)
110 ROOTLIBSHFILES
= $
(SHFILES
:%=$
(ROOTLIB
)/%)
111 ROOTSHLIBPROG
= $
(PROG
:%=$
(ROOTSHLIB
)/%)
112 ROOTSBINPROG
= $
(PROG
:%=$
(ROOTSBIN
)/%)
113 ROOTUSRSBINPROG
=$
(PROG
:%=$
(ROOTUSRSBIN
)/%)
114 ROOTUSRSBINSCRIPT
=$
(SCRIPT
:%=$
(ROOTUSRSBIN
)/%)
115 ROOTLOCALEPROG
= $
(PROG
:%=$
(ROOTLOCALEDEF
)/%)
116 ROOTPROG64
= $
(PROG
:%=$
(ROOTBIN64
)/%)
117 ROOTPROG32
= $
(PROG
:%=$
(ROOTBIN32
)/%)
118 ROOTCMD64
= $
(PROG
:%=$
(ROOTCMDDIR64
)/%)
119 ROOTUSRSBINPROG32
= $
(PROG
:%=$
(ROOTUSRSBIN32
)/%)
120 ROOTUSRSBINPROG64
= $
(PROG
:%=$
(ROOTUSRSBIN64
)/%)
121 ROOTMAN1FILES
= $
(MAN1FILES
:%=$
(ROOTMAN1
)/%)
122 $
(ROOTMAN1FILES
) := FILEMODE
= 444
123 ROOTMAN3FILES
= $
(MAN3FILES
:%=$
(ROOTMAN3
)/%)
124 $
(ROOTMAN3FILES
) := FILEMODE
= 444
125 ROOTMAN8FILES
= $
(MAN8FILES
:%=$
(ROOTMAN8
)/%)
126 $
(ROOTMAN8FILES
) := FILEMODE
= 444
128 ROOTETCDEFAULT
= $
(ROOTETC
)/default
129 ROOTETCDEFAULTFILES
= $
(DEFAULTFILES
:%.dfl
=$
(ROOTETCDEFAULT
)/%)
130 $
(ROOTETCDEFAULTFILES
) := FILEMODE
= 0644
132 ROOTETCSECFILES
= $
(ETCSECFILES
:%=$
(ROOTETCSECURITY
)/%)
133 $
(ROOTETCSECFILES
) := FILEMODE
= 0644
135 ROOTETCSECLIBFILES
= $
(ETCSECLIBFILES
:%=$
(ROOTETCSECLIB
)/%)
137 ROOTETCZONESFILES
= $
(ETCZONESFILES
:%=$
(ROOTETCZONES
)/%)
138 $
(ROOTETCZONESFILES
) := FILEMODE
= 0444
140 ROOTLIBZONESFILES
= $
(LIBZONESFILES
:%=$
(ROOTLIBZONES
)/%)
141 $
(ROOTLIBZONESFILES
) := FILEMODE
= 0555
144 # Directories
for smf
(5) service manifests and profiles.
146 ROOTSVC
= $
(ROOT
)/lib
/svc
147 ROOTETCSVC
= $
(ROOT
)/etc
/svc
149 ROOTSVCMANIFEST
= $
(ROOTSVC
)/manifest
150 ROOTSVCPROFILE
= $
(ROOTETCSVC
)/profile
152 ROOTSVCMILESTONE
= $
(ROOTSVCMANIFEST
)/milestone
153 ROOTSVCDEVICE
= $
(ROOTSVCMANIFEST
)/device
154 ROOTSVCSYSTEM
= $
(ROOTSVCMANIFEST
)/system
155 ROOTSVCSYSTEMDEVICE
= $
(ROOTSVCSYSTEM
)/device
156 ROOTSVCSYSTEMFILESYSTEM
= $
(ROOTSVCSYSTEM
)/filesystem
157 ROOTSVCSYSTEMSECURITY
= $
(ROOTSVCSYSTEM
)/security
158 ROOTSVCNETWORK
= $
(ROOTSVCMANIFEST
)/network
159 ROOTSVCNETWORKDNS
= $
(ROOTSVCNETWORK
)/dns
160 ROOTSVCNETWORKISCSI
= $
(ROOTSVCNETWORK
)/iscsi
161 ROOTSVCNETWORKLDAP
= $
(ROOTSVCNETWORK
)/ldap
162 ROOTSVCNETWORKNFS
= $
(ROOTSVCNETWORK
)/nfs
163 ROOTSVCNETWORKNIS
= $
(ROOTSVCNETWORK
)/nis
164 ROOTSVCNETWORKROUTING
= $
(ROOTSVCNETWORK
)/routing
165 ROOTSVCNETWORKRPC
= $
(ROOTSVCNETWORK
)/rpc
166 ROOTSVCNETWORKSMB
= $
(ROOTSVCNETWORK
)/smb
167 ROOTSVCNETWORKSECURITY
= $
(ROOTSVCNETWORK
)/security
168 ROOTSVCNETWORKIPSEC
= $
(ROOTSVCNETWORK
)/ipsec
169 ROOTSVCNETWORKSHARES
= $
(ROOTSVCNETWORK
)/shares
170 ROOTSVCSMB
= $
(ROOTSVCNETWORK
)/smb
171 ROOTSVCPLATFORM
= $
(ROOTSVCMANIFEST
)/platform
172 ROOTSVCPLATFORMSUN4U
= $
(ROOTSVCPLATFORM
)/sun4u
173 ROOTSVCPLATFORMSUN4V
= $
(ROOTSVCPLATFORM
)/sun4v
174 ROOTSVCAPPLICATION
= $
(ROOTSVCMANIFEST
)/application
175 ROOTSVCAPPLICATIONMANAGEMENT
= $
(ROOTSVCAPPLICATION
)/management
176 ROOTSVCAPPLICATIONSECURITY
= $
(ROOTSVCAPPLICATION
)/security
177 ROOTSVCAPPLICATIONPRINT
= $
(ROOTSVCAPPLICATION
)/print
180 # Commands Makefiles delivering a manifest are expected to define MANIFEST.
182 # Like ROOTCMDDIR
, any lower
-level Makefiles that put their manifests in a
183 # subdirectory of the manifest directories listed above should reset
184 # ROOTMANIFESTDIR and
use it in their `install
' target. By default we set this
185 # to a bogus value so that it will not conflict with any of the other values
186 # already defined in this Makefile.
188 # The manifest validation of the $SRC/cmd check target is also derived from a
189 # valid MANIFEST setting.
191 ROOTMANIFESTDIR= $(ROOTSVCMANIFEST)/__nonexistent_directory__
192 ROOTMANIFEST= $(MANIFEST:%=$(ROOTMANIFESTDIR)/%)
193 CHKMANIFEST= $(MANIFEST:%.xml=%.xmlchk)
195 # Manifests cannot be checked in parallel, because we are using the global
196 # repository that is in $(SRC)/cmd/svc/seed/global.db. This is a
197 # repository that is built from the manifests in this workspace, whereas
198 # the build machine's repository may be out of sync with these manifests.
199 # Because we are using a private repository
, svccfg
-native must
start up a
200 # private
copy of configd
-native. We cannot have multiple copies of
201 # configd
-native trying to access global.db simultaneously.
203 .NO_PARALLEL
: $
(CHKMANIFEST
)
206 #
For installing
"starter scripts" of services
209 ROOTSVCMETHOD
= $
(SVCMETHOD
:%=$
(ROOTLIBSVCMETHOD
)/%)
211 ROOTSVCBINDIR
= $
(ROOTLIBSVCBIN
)/__nonexistent_directory__
212 ROOTSVCBIN
= $
(SVCBIN
:%=$
(ROOTSVCBINDIR
)/%)
216 #
For programs that are installed in the root filesystem
,
217 # build $
(ROOTFS_PROG
) rather than $
(PROG
)
218 $
(ROOTFS_PROG
) := LDFLAGS
+= -Wl
,-I
/lib
/ld.so
.1
253 $
(ROOTUSRSBIN32
)/%: %
256 $
(ROOTUSRSBIN64
)/%: %
268 $
(ROOTETCDEFAULT
)/%: %.dfl
271 $
(ROOTETCSECLIB
)/%: %
280 $
(ROOTLOCALEDEF
)/%: %
289 $
(ROOTI18NEXT64
)/%: %
292 $
(ROOTLIBSVCMETHOD
)/%: %
295 $
(ROOTLIBSVCBIN
)/%: %
298 $
(ROOTSVCMILESTONE
)/%: %
301 $
(ROOTSVCDEVICE
)/%: %
304 $
(ROOTSVCSYSTEM
)/%: %
307 $
(ROOTSVCSYSTEMDEVICE
)/%: %
310 $
(ROOTSVCSYSTEMFILESYSTEM
)/%: %
313 $
(ROOTSVCSYSTEMSECURITY
)/%: %
316 $
(ROOTSVCNETWORK
)/%: %
319 $
(ROOTSVCNETWORKLDAP
)/%: %
322 $
(ROOTSVCNETWORKNFS
)/%: %
325 $
(ROOTSVCNETWORKNIS
)/%: %
328 $
(ROOTSVCNETWORKRPC
)/%: %
331 $
(ROOTSVCNETWORKSECURITY
)/%: %
334 $
(ROOTSVCNETWORKIPSEC
)/%: %
337 $
(ROOTSVCNETWORKSHARES
)/%: %
340 $
(ROOTSVCNETWORKSMB
)/%: %
343 $
(ROOTSVCAPPLICATION
)/%: %
346 $
(ROOTSVCAPPLICATIONMANAGEMENT
)/%: %
349 $
(ROOTSVCAPPLICATIONSECURITY
)/%: %
352 $
(ROOTSVCAPPLICATIONPRINT
)/%: %
355 $
(ROOTSVCPLATFORM
)/%: %
358 $
(ROOTSVCPLATFORMSUN4U
)/%: %
361 $
(ROOTSVCPLATFORMSUN4V
)/%: %
364 # Install rule
for gprof
, yacc
, and lex dependency
files
365 $
(ROOTSHLIBCCS
)/%: ..
/common
/%
371 # build rule
for statically linked programs with single source file.
373 $
(LINK.c
) -o $@ $
< $
(LDLIBS
)
376 # Define the majority text domain in this directory.
377 TEXT_DOMAIN
= SUNW_OST_OSCMD
379 CLOBBERFILES
+= $
(DCFILE
)
381 # This flag is
for programs which should
not build a
32-bit binary
382 sparc_64ONLY
= $
(POUND_SIGN
)
383 64ONLY
= $
($
(MACH
)_64ONLY
)