libefi: import efichar.c for ucs2 support
[unleashed.git] / usr / src / cmd / Makefile.cmd
blob14bb3cd6c3793601e9a43dd657fb07597a70042c
2 # CDDL HEADER START
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]
19 # CDDL HEADER END
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
32 LN= ln
33 SH= sh
34 ECHO= echo
35 MKDIR= mkdir
36 TOUCH= touch
38 FILEMODE= 0555
39 LIBFILEMODE= 0444
41 KRB5DIR= $(ROOT)/usr
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
60 ROOTETC= $(ROOT)/etc
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)
95 LDFLAGS.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
220 $(KRB5BIN)/%: %
221 $(INS.file)
223 $(KRB5SBIN)/%: %
224 $(INS.file)
226 $(KRB5LIB)/%: %
227 $(INS.file)
229 $(ROOTBIN)/%: %
230 $(INS.file)
232 $(ROOTLIB)/%: %
233 $(INS.file)
235 $(ROOTBIN64)/%: %
236 $(INS.file)
238 $(ROOTLIB64)/%: %
239 $(INS.file)
241 $(ROOTBIN32)/%: %
242 $(INS.file)
244 $(ROOTSHLIB)/%: %
245 $(INS.file)
247 $(ROOTSBIN)/%: %
248 $(INS.file)
250 $(ROOTUSRSBIN)/%: %
251 $(INS.file)
253 $(ROOTUSRSBIN32)/%: %
254 $(INS.file)
256 $(ROOTUSRSBIN64)/%: %
257 $(INS.file)
259 $(ROOTETC)/%: %
260 $(INS.file)
262 $(ROOTETCFTPD)/%: %
263 $(INS.file)
265 $(ROOTETCINET)/%: %
266 $(INS.file)
268 $(ROOTETCDEFAULT)/%: %.dfl
269 $(INS.rename)
271 $(ROOTETCSECLIB)/%: %
272 $(INS.file)
274 $(ROOTETCZONES)/%: %
275 $(INS.file)
277 $(ROOTLIBZONES)/%: %
278 $(INS.file)
280 $(ROOTLOCALEDEF)/%: %
281 $(INS.file)
283 $(ROOTCHARMAP)/%: %
284 $(INS.file)
286 $(ROOTI18NEXT)/%: %
287 $(INS.file)
289 $(ROOTI18NEXT64)/%: %
290 $(INS.file)
292 $(ROOTLIBSVCMETHOD)/%: %
293 $(INS.file)
295 $(ROOTLIBSVCBIN)/%: %
296 $(INS.file)
298 $(ROOTSVCMILESTONE)/%: %
299 $(INS.file)
301 $(ROOTSVCDEVICE)/%: %
302 $(INS.file)
304 $(ROOTSVCSYSTEM)/%: %
305 $(INS.file)
307 $(ROOTSVCSYSTEMDEVICE)/%: %
308 $(INS.file)
310 $(ROOTSVCSYSTEMFILESYSTEM)/%: %
311 $(INS.file)
313 $(ROOTSVCSYSTEMSECURITY)/%: %
314 $(INS.file)
316 $(ROOTSVCNETWORK)/%: %
317 $(INS.file)
319 $(ROOTSVCNETWORKLDAP)/%: %
320 $(INS.file)
322 $(ROOTSVCNETWORKNFS)/%: %
323 $(INS.file)
325 $(ROOTSVCNETWORKNIS)/%: %
326 $(INS.file)
328 $(ROOTSVCNETWORKRPC)/%: %
329 $(INS.file)
331 $(ROOTSVCNETWORKSECURITY)/%: %
332 $(INS.file)
334 $(ROOTSVCNETWORKIPSEC)/%: %
335 $(INS.file)
337 $(ROOTSVCNETWORKSHARES)/%: %
338 $(INS.file)
340 $(ROOTSVCNETWORKSMB)/%: %
341 $(INS.file)
343 $(ROOTSVCAPPLICATION)/%: %
344 $(INS.file)
346 $(ROOTSVCAPPLICATIONMANAGEMENT)/%: %
347 $(INS.file)
349 $(ROOTSVCAPPLICATIONSECURITY)/%: %
350 $(INS.file)
352 $(ROOTSVCAPPLICATIONPRINT)/%: %
353 $(INS.file)
355 $(ROOTSVCPLATFORM)/%: %
356 $(INS.file)
358 $(ROOTSVCPLATFORMSUN4U)/%: %
359 $(INS.file)
361 $(ROOTSVCPLATFORMSUN4V)/%: %
362 $(INS.file)
364 # Install rule for gprof, yacc, and lex dependency files
365 $(ROOTSHLIBCCS)/%: ../common/%
366 $(INS.file)
368 $(ROOTVARSMB)/%: %
369 $(INS.file)
371 # build rule for statically linked programs with single source file.
372 %.static: %.c
373 $(LINK.c) -o $@ $< $(LDLIBS)
374 $(POST_PROCESS)
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)