dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / cmd / Makefile.cmd
blob0ea78cc08f38de0d755c24111f965e064e5ecb95
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 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)
100 LDFLAGS.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.
142 INS.ccsbinlink= \
143 $(RM) $(ROOTCCSBINPROG); \
144 $(SYMLINK) ../../bin/$(PROG) $(ROOTCCSBINPROG)
146 INS.ccsbinlink64= \
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
242 $(KRB5BIN)/%: %
243 $(INS.file)
245 $(KRB5SBIN)/%: %
246 $(INS.file)
248 $(KRB5LIB)/%: %
249 $(INS.file)
251 $(ROOTBIN)/%: %
252 $(INS.file)
254 $(ROOTLIB)/%: %
255 $(INS.file)
257 $(ROOTBIN64)/%: %
258 $(INS.file)
260 $(ROOTLIB64)/%: %
261 $(INS.file)
263 $(ROOTBIN32)/%: %
264 $(INS.file)
266 $(ROOTSHLIB)/%: %
267 $(INS.file)
269 $(ROOTSBIN)/%: %
270 $(INS.file)
272 $(ROOTUSRSBIN)/%: %
273 $(INS.file)
275 $(ROOTUSRSBIN32)/%: %
276 $(INS.file)
278 $(ROOTUSRSBIN64)/%: %
279 $(INS.file)
281 $(ROOTETC)/%: %
282 $(INS.file)
284 $(ROOTETCFTPD)/%: %
285 $(INS.file)
287 $(ROOTETCINET)/%: %
288 $(INS.file)
290 $(ROOTETCDEFAULT)/%: %.dfl
291 $(INS.rename)
293 $(ROOTETCSECLIB)/%: %
294 $(INS.file)
296 $(ROOTETCZONES)/%: %
297 $(INS.file)
299 $(ROOTLIBZONES)/%: %
300 $(INS.file)
302 $(ROOTLOCALEDEF)/%: %
303 $(INS.file)
305 $(ROOTCHARMAP)/%: %
306 $(INS.file)
308 $(ROOTI18NEXT)/%: %
309 $(INS.file)
311 $(ROOTI18NEXT64)/%: %
312 $(INS.file)
314 $(ROOTLIBSVCMETHOD)/%: %
315 $(INS.file)
317 $(ROOTLIBSVCBIN)/%: %
318 $(INS.file)
320 $(ROOTSVCMILESTONE)/%: %
321 $(INS.file)
323 $(ROOTSVCDEVICE)/%: %
324 $(INS.file)
326 $(ROOTSVCSYSTEM)/%: %
327 $(INS.file)
329 $(ROOTSVCSYSTEMDEVICE)/%: %
330 $(INS.file)
332 $(ROOTSVCSYSTEMFILESYSTEM)/%: %
333 $(INS.file)
335 $(ROOTSVCSYSTEMSECURITY)/%: %
336 $(INS.file)
338 $(ROOTSVCNETWORK)/%: %
339 $(INS.file)
341 $(ROOTSVCNETWORKLDAP)/%: %
342 $(INS.file)
344 $(ROOTSVCNETWORKNFS)/%: %
345 $(INS.file)
347 $(ROOTSVCNETWORKNIS)/%: %
348 $(INS.file)
350 $(ROOTSVCNETWORKRPC)/%: %
351 $(INS.file)
353 $(ROOTSVCNETWORKSECURITY)/%: %
354 $(INS.file)
356 $(ROOTSVCNETWORKIPSEC)/%: %
357 $(INS.file)
359 $(ROOTSVCNETWORKSHARES)/%: %
360 $(INS.file)
362 $(ROOTSVCNETWORKSMB)/%: %
363 $(INS.file)
365 $(ROOTSVCAPPLICATION)/%: %
366 $(INS.file)
368 $(ROOTSVCAPPLICATIONMANAGEMENT)/%: %
369 $(INS.file)
371 $(ROOTSVCAPPLICATIONSECURITY)/%: %
372 $(INS.file)
374 $(ROOTSVCAPPLICATIONPRINT)/%: %
375 $(INS.file)
377 $(ROOTSVCPLATFORM)/%: %
378 $(INS.file)
380 $(ROOTSVCPLATFORMSUN4U)/%: %
381 $(INS.file)
383 $(ROOTSVCPLATFORMSUN4V)/%: %
384 $(INS.file)
386 # Install rule for gprof, yacc, and lex dependency files
387 $(ROOTSHLIBCCS)/%: ../common/%
388 $(INS.file)
390 $(ROOTCCSBINLINKDIR)/%: %
391 $(INS.ccsbinlink)
393 $(ROOTCCSBINLINKDIR64)/%: %
394 $(INS.ccsbinlink64)
396 $(ROOTVARSMB)/%: %
397 $(INS.file)
399 # build rule for statically linked programs with single source file.
400 %.static: %.c
401 $(LINK.c) -o $@ $< $(LDLIBS)
402 $(POST_PROCESS)
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)