Print this page
XXX Remove nawk(1)
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/Makefile.master
+++ new/usr/src/Makefile.master
1 1 #
2 2 # CDDL HEADER START
3 3 #
4 4 # The contents of this file are subject to the terms of the
5 5 # Common Development and Distribution License (the "License").
6 6 # You may not use this file except in compliance with the License.
7 7 #
8 8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 # or http://www.opensolaris.org/os/licensing.
10 10 # See the License for the specific language governing permissions
11 11 # and limitations under the License.
12 12 #
13 13 # When distributing Covered Code, include this CDDL HEADER in each
14 14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 # If applicable, add the following below this CDDL HEADER, with the
16 16 # fields enclosed by brackets "[]" replaced with your own identifying
17 17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 18 #
19 19 # CDDL HEADER END
20 20 #
21 21
22 22 #
23 23 # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
24 24 # Copyright (c) 2012 by Delphix. All rights reserved.
25 25 #
26 26
27 27 #
28 28 # Makefile.master, global definitions for system source
29 29 #
30 30 ROOT= /proto
31 31
32 32 #
33 33 # RELEASE_BUILD should be cleared for final release builds.
34 34 # NOT_RELEASE_BUILD is exactly what the name implies.
35 35 #
36 36 # INTERNAL_RELEASE_BUILD is a subset of RELEASE_BUILD. It mostly controls
37 37 # identification strings. Enabling RELEASE_BUILD automatically enables
38 38 # INTERNAL_RELEASE_BUILD.
39 39 #
40 40 # EXPORT_RELEASE_BUILD controls whether binaries are built in a form that
41 41 # can be released for export under a binary license. It is orthogonal to
42 42 # the other *RELEASE_BUILD settings. ("#" means do an export release
43 43 # build, "" means do a normal build.)
44 44 #
45 45 # CLOSED_BUILD controls whether we try to build files under
46 46 # usr/closed. ("" means to build closed code, "#" means don't try to
47 47 # build it.) Skipping the closed code implies doing an export release
48 48 # build.
49 49 #
50 50 # STRIP_COMMENTS toggles comment section striping. Generally the same setting
51 51 # as INTERNAL_RELEASE_BUILD.
52 52 #
53 53 # __GNUC toggles the building of ON components using gcc and related tools.
54 54 # Normally set to `#', set it to `' to do gcc build.
55 55 #
56 56 # The declaration POUND_SIGN is always '#'. This is needed to get around the
57 57 # make feature that '#' is always a comment delimiter, even when escaped or
58 58 # quoted. We use this macro expansion method to get POUND_SIGN rather than
59 59 # always breaking out a shell because the general case can cause a noticable
60 60 # slowdown in build times when so many Makefiles include Makefile.master.
61 61 #
62 62 # While the majority of users are expected to override the setting below
63 63 # with an env file (via nightly or bldenv), if you aren't building that way
64 64 # (ie, you're using "ws" or some other bootstrapping method) then you need
65 65 # this definition in order to avoid the subshell invocation mentioned above.
66 66 #
67 67
68 68 PRE_POUND= pre\#
69 69 POUND_SIGN= $(PRE_POUND:pre\%=%)
70 70
71 71 NOT_RELEASE_BUILD=
72 72 INTERNAL_RELEASE_BUILD= $(POUND_SIGN)
73 73 RELEASE_BUILD= $(POUND_SIGN)
74 74 $(RELEASE_BUILD)NOT_RELEASE_BUILD= $(POUND_SIGN)
75 75 $(RELEASE_BUILD)INTERNAL_RELEASE_BUILD=
76 76 PATCH_BUILD= $(POUND_SIGN)
77 77
78 78 # If CLOSED_IS_PRESENT is not set, assume the closed tree is present.
79 79 CLOSED_BUILD_1= $(CLOSED_IS_PRESENT:yes=)
80 80 CLOSED_BUILD= $(CLOSED_BUILD_1:no=$(POUND_SIGN))
81 81
82 82 EXPORT_RELEASE_BUILD= $(POUND_SIGN)
83 83 $(CLOSED_BUILD)EXPORT_RELEASE_BUILD=
84 84
85 85 # SPARC_BLD is '#' for an Intel build.
86 86 # INTEL_BLD is '#' for a Sparc build.
87 87 SPARC_BLD_1= $(MACH:i386=$(POUND_SIGN))
88 88 SPARC_BLD= $(SPARC_BLD_1:sparc=)
89 89 INTEL_BLD_1= $(MACH:sparc=$(POUND_SIGN))
90 90 INTEL_BLD= $(INTEL_BLD_1:i386=)
91 91
92 92 STRIP_COMMENTS= $(INTERNAL_RELEASE_BUILD)
93 93
94 94 # Are we building tonic closedbins? Unless you have used the
95 95 # -O flag to nightly or bldenv, leave the definition of TONICBUILD
96 96 # as $(POUND_SIGN).
97 97 #
98 98 # IF YOU CHANGE CLOSEDROOT, you MUST change install.bin
99 99 # to match the new definition.
100 100 TONICBUILD= $(POUND_SIGN)
101 101 $(TONICBUILD)CLOSEDROOT= $(ROOT)-closed
102 102
103 103
104 104 # The variables below control the compilers used during the build.
105 105 # There are a number of permutations.
106 106 #
107 107 # __GNUC and __SUNC control (and indicate) the primary compiler. Whichever
108 108 # one is not POUND_SIGN is the primary, with the other as the shadow. They
109 109 # may also be used to control entirely compiler-specific Makefile assignments.
110 110 # __SUNC and Sun Studio are the default.
111 111 #
112 112 # __GNUC64 indicates that the 64bit build should use the GNU C compiler.
113 113 # There is no Sun C analogue.
114 114 #
115 115 # The following version-specific options are operative regardless of which
116 116 # compiler is primary, and control the versions of the given compilers to be
117 117 # used. They also allow compiler-version specific Makefile fragments.
118 118 #
119 119
120 120 __GNUC= $(POUND_SIGN)
121 121 $(__GNUC)__SUNC= $(POUND_SIGN)
122 122 __GNUC64= $(__GNUC)
123 123
124 124 # CLOSED is the root of the tree that contains source which isn't released
125 125 # as open source
126 126 CLOSED= $(SRC)/../closed
127 127
128 128 # BUILD_TOOLS is the root of all tools including compilers.
129 129 # ONBLD_TOOLS is the root of all the tools that are part of SUNWonbld.
130 130
131 131 BUILD_TOOLS= /ws/onnv-tools
132 132 ONBLD_TOOLS= $(BUILD_TOOLS)/onbld
133 133
134 134 JAVA_ROOT= /usr/java
135 135
136 136 SFW_ROOT= /usr/sfw
137 137 SFWINCDIR= $(SFW_ROOT)/include
138 138 SFWLIBDIR= $(SFW_ROOT)/lib
139 139 SFWLIBDIR64= $(SFW_ROOT)/lib/$(MACH64)
140 140
141 141 GCC_ROOT= /opt/gcc/4.4.4
142 142 GCCLIBDIR= $(GCC_ROOT)/lib
143 143 GCCLIBDIR64= $(GCC_ROOT)/lib/$(MACH64)
144 144
145 145 DOCBOOK_XSL_ROOT= /usr/share/sgml/docbook/xsl-stylesheets
146 146
147 147 RPCGEN= /usr/bin/rpcgen
148 148 STABS= $(ONBLD_TOOLS)/bin/$(MACH)/stabs
149 149 ELFEXTRACT= $(ONBLD_TOOLS)/bin/$(MACH)/elfextract
150 150 MBH_PATCH= $(ONBLD_TOOLS)/bin/$(MACH)/mbh_patch
151 151 ECHO= echo
152 152 INS= install
153 153 TRUE= true
154 154 SYMLINK= /usr/bin/ln -s
155 155 LN= /usr/bin/ln
156 156 CHMOD= /usr/bin/chmod
↓ open down ↓ |
156 lines elided |
↑ open up ↑ |
157 157 MV= /usr/bin/mv -f
158 158 RM= /usr/bin/rm -f
159 159 CUT= /usr/bin/cut
160 160 NM= /usr/ccs/bin/nm
161 161 DIFF= /usr/bin/diff
162 162 GREP= /usr/bin/grep
163 163 EGREP= /usr/bin/egrep
164 164 ELFWRAP= /usr/bin/elfwrap
165 165 KSH93= /usr/bin/ksh93
166 166 SED= /usr/bin/sed
167 -NAWK= /usr/bin/nawk
167 +AWK= /usr/xpg4/bin/awk
168 168 CP= /usr/bin/cp -f
169 169 MCS= /usr/ccs/bin/mcs
170 170 CAT= /usr/bin/cat
171 171 ELFDUMP= /usr/ccs/bin/elfdump
172 172 M4= /usr/ccs/bin/m4
173 173 STRIP= /usr/ccs/bin/strip
174 174 LEX= /usr/ccs/bin/lex
175 175 FLEX= $(SFW_ROOT)/bin/flex
176 176 YACC= /usr/ccs/bin/yacc
177 177 CPP= /usr/lib/cpp
178 178 JAVAC= $(JAVA_ROOT)/bin/javac
179 179 JAVAH= $(JAVA_ROOT)/bin/javah
180 180 JAVADOC= $(JAVA_ROOT)/bin/javadoc
181 181 RMIC= $(JAVA_ROOT)/bin/rmic
182 182 JAR= $(JAVA_ROOT)/bin/jar
183 183 CTFCONVERT= $(ONBLD_TOOLS)/bin/$(MACH)/ctfconvert
184 184 CTFMERGE= $(ONBLD_TOOLS)/bin/$(MACH)/ctfmerge
185 185 CTFSTABS= $(ONBLD_TOOLS)/bin/$(MACH)/ctfstabs
186 186 CTFSTRIP= $(ONBLD_TOOLS)/bin/$(MACH)/ctfstrip
187 187 NDRGEN= $(ONBLD_TOOLS)/bin/$(MACH)/ndrgen
188 188 GENOFFSETS= $(ONBLD_TOOLS)/bin/genoffsets
189 189 CTFCVTPTBL= $(ONBLD_TOOLS)/bin/ctfcvtptbl
190 190 CTFFINDMOD= $(ONBLD_TOOLS)/bin/ctffindmod
191 191 XREF= $(ONBLD_TOOLS)/bin/xref
192 192 FIND= /usr/bin/find
193 193 PERL= /usr/bin/perl
194 194 PYTHON_26= /usr/bin/python2.6
195 195 PYTHON= $(PYTHON_26)
196 196 SORT= /usr/bin/sort
197 197 TOUCH= /usr/bin/touch
198 198 WC= /usr/bin/wc
199 199 XARGS= /usr/bin/xargs
200 200 ELFEDIT= /usr/bin/elfedit
201 201 ELFSIGN= /usr/bin/elfsign
202 202 DTRACE= /usr/sbin/dtrace -xnolibs
203 203 UNIQ= /usr/bin/uniq
204 204 TAR= /usr/bin/tar
205 205
206 206 FILEMODE= 644
207 207 DIRMODE= 755
208 208
209 209 #
210 210 # The version of the patch makeup table optimized for build-time use. Used
211 211 # during patch builds only.
212 212 $(PATCH_BUILD)PMTMO_FILE=$(SRC)/patch_makeup_table.mo
213 213
214 214 # Declare that nothing should be built in parallel.
215 215 # Individual Makefiles can use the .PARALLEL target to declare otherwise.
216 216 .NO_PARALLEL:
217 217
218 218 # For stylistic checks
219 219 #
220 220 # Note that the X and C checks are not used at this time and may need
221 221 # modification when they are actually used.
222 222 #
223 223 CSTYLE= $(ONBLD_TOOLS)/bin/cstyle
224 224 CSTYLE_TAIL=
225 225 HDRCHK= $(ONBLD_TOOLS)/bin/hdrchk
226 226 HDRCHK_TAIL=
227 227 JSTYLE= $(ONBLD_TOOLS)/bin/jstyle
228 228
229 229 DOT_H_CHECK= \
230 230 @$(ECHO) "checking $<"; $(CSTYLE) $< $(CSTYLE_TAIL); \
231 231 $(HDRCHK) $< $(HDRCHK_TAIL)
232 232
233 233 DOT_X_CHECK= \
234 234 @$(ECHO) "checking $<"; $(RPCGEN) -C -h $< | $(CSTYLE) $(CSTYLE_TAIL); \
235 235 $(RPCGEN) -C -h $< | $(HDRCHK) $< $(HDRCHK_TAIL)
236 236
237 237 DOT_C_CHECK= \
238 238 @$(ECHO) "checking $<"; $(CSTYLE) $< $(CSTYLE_TAIL)
239 239
240 240 MANIFEST_CHECK= \
241 241 @$(ECHO) "checking $<"; \
242 242 SVCCFG_DTD=$(SRC)/cmd/svc/dtd/service_bundle.dtd.1 \
243 243 SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/global.db \
244 244 SVCCFG_CONFIGD_PATH=$(SRC)/cmd/svc/configd/svc.configd-native \
245 245 $(SRC)/cmd/svc/svccfg/svccfg-native validate $<
246 246
247 247 #
248 248 # IMPORTANT:: If you change any of INS.file, INS.dir, INS.rename,
249 249 # INS.link or INS.symlink here, then you must also change the
250 250 # corresponding override definitions in $CLOSED/Makefile.tonic.
251 251 # If you do not do this, then the closedbins build for the OpenSolaris
252 252 # community will break. PS, the gatekeepers will be upset too.
253 253 INS.file= $(RM) $@; $(INS) -s -m $(FILEMODE) -f $(@D) $<
254 254 INS.dir= $(INS) -s -d -m $(DIRMODE) $@
255 255 # installs and renames at once
256 256 #
257 257 INS.rename= $(INS.file); $(MV) $(@D)/$(<F) $@
258 258
259 259 # install a link
260 260 INSLINKTARGET= $<
261 261 INS.link= $(RM) $@; $(LN) $(INSLINKTARGET) $@
262 262 INS.symlink= $(RM) $@; $(SYMLINK) $(INSLINKTARGET) $@
263 263
264 264 #
265 265 # Python bakes the mtime of the .py file into the compiled .pyc and
266 266 # rebuilds if the baked-in mtime != the mtime of the source file
267 267 # (rather than only if it's less than), thus when installing python
268 268 # files we must make certain to not adjust the mtime of the source
269 269 # (.py) file.
270 270 #
271 271 INS.pyfile= $(INS.file); $(TOUCH) -r $< $@
272 272
273 273 # MACH must be set in the shell environment per uname -p on the build host
274 274 # More specific architecture variables should be set in lower makefiles.
275 275 #
276 276 # MACH64 is derived from MACH, and BUILD64 is set to `#' for
277 277 # architectures on which we do not build 64-bit versions.
278 278 # (There are no such architectures at the moment.)
279 279 #
280 280 # Set BUILD64=# in the environment to disable 64-bit amd64
281 281 # builds on i386 machines.
282 282
283 283 MACH64_1= $(MACH:sparc=sparcv9)
284 284 MACH64= $(MACH64_1:i386=amd64)
285 285
286 286 MACH32_1= $(MACH:sparc=sparcv7)
287 287 MACH32= $(MACH32_1:i386=i86)
288 288
289 289 sparc_BUILD64=
290 290 i386_BUILD64=
291 291 BUILD64= $($(MACH)_BUILD64)
292 292
293 293 #
294 294 # C compiler mode. Future compilers may change the default on us,
295 295 # so force extended ANSI mode globally. Lower level makefiles can
296 296 # override this by setting CCMODE.
297 297 #
298 298 CCMODE= -Xa
299 299 CCMODE64= -Xa
300 300
301 301 #
302 302 # C compiler verbose mode. This is so we can enable it globally,
303 303 # but turn it off in the lower level makefiles of things we cannot
304 304 # (or aren't going to) fix.
305 305 #
306 306 CCVERBOSE= -v
307 307
308 308 # set this to the secret flag "-Wc,-Qiselect-v9abiwarn=1" to get warnings
309 309 # from the compiler about places the -xarch=v9 may differ from -xarch=v9c.
310 310 V9ABIWARN=
311 311
312 312 # set this to the secret flag "-Wc,-Qiselect-regsym=0" to disable register
313 313 # symbols (used to detect conflicts between objects that use global registers)
314 314 # we disable this now for safety, and because genunix doesn't link with
315 315 # this feature (the v9 default) enabled.
316 316 #
317 317 # REGSYM is separate since the C++ driver syntax is different.
318 318 CCREGSYM= -Wc,-Qiselect-regsym=0
319 319 CCCREGSYM= -Qoption cg -Qiselect-regsym=0
320 320
321 321 # Prevent the removal of static symbols by the SPARC code generator (cg).
322 322 # The x86 code generator (ube) does not remove such symbols and as such
323 323 # using this workaround is not applicable for x86.
324 324 #
325 325 CCSTATICSYM= -Wc,-Qassembler-ounrefsym=0
326 326 #
327 327 # generate 32-bit addresses in the v9 kernel. Saves memory.
328 328 CCABS32= -Wc,-xcode=abs32
329 329 #
330 330 # generate v9 code which tolerates callers using the v7 ABI, for the sake of
331 331 # system calls.
332 332 CC32BITCALLERS= -_gcc=-massume-32bit-callers
333 333
334 334 # GCC, especially, is increasingly beginning to auto-inline functions and
335 335 # sadly does so separately not under the general -fno-inline-functions
336 336 # Additionally, we wish to prevent optimisations which cause GCC to clone
337 337 # functions -- in particular, these may cause unhelpful symbols to be
338 338 # emitted instead of function names
339 339 CCNOAUTOINLINE= -_gcc=-fno-inline-small-functions \
340 340 -_gcc=-fno-inline-functions-called-once \
341 341 -_gcc=-fno-ipa-cp
342 342
343 343 # One optimization the compiler might perform is to turn this:
344 344 # #pragma weak foo
345 345 # extern int foo;
346 346 # if (&foo)
347 347 # foo = 5;
348 348 # into
349 349 # foo = 5;
350 350 # Since we do some of this (foo might be referenced in common kernel code
351 351 # but provided only for some cpu modules or platforms), we disable this
352 352 # optimization.
353 353 #
354 354 sparc_CCUNBOUND = -Wd,-xsafe=unboundsym
355 355 i386_CCUNBOUND =
356 356 CCUNBOUND = $($(MACH)_CCUNBOUND)
357 357
358 358 #
359 359 # compiler '-xarch' flag. This is here to centralize it and make it
360 360 # overridable for testing.
361 361 sparc_XARCH= -m32
362 362 sparcv9_XARCH= -m64
363 363 i386_XARCH=
364 364 amd64_XARCH= -m64 -Ui386 -U__i386
365 365
366 366 # assembler '-xarch' flag. Different from compiler '-xarch' flag.
367 367 sparc_AS_XARCH= -xarch=v8plus
368 368 sparcv9_AS_XARCH= -xarch=v9
369 369 i386_AS_XARCH=
370 370 amd64_AS_XARCH= -xarch=amd64 -P -Ui386 -U__i386
371 371
372 372 #
373 373 # These flags define what we need to be 'standalone' i.e. -not- part
374 374 # of the rather more cosy userland environment. This basically means
375 375 # the kernel.
376 376 #
377 377 # XX64 future versions of gcc will make -mcmodel=kernel imply -mno-red-zone
378 378 #
379 379 sparc_STAND_FLAGS= -_gcc=-ffreestanding
380 380 sparcv9_STAND_FLAGS= -_gcc=-ffreestanding
381 381 # Disabling MMX also disables 3DNow, disabling SSE also disables all later
382 382 # additions to SSE (SSE2, AVX ,etc.)
383 383 NO_SIMD= -_gcc=-mno-mmx -_gcc=-mno-sse
384 384 i386_STAND_FLAGS= -_gcc=-ffreestanding $(NO_SIMD)
385 385 amd64_STAND_FLAGS= -xmodel=kernel $(NO_SIMD)
386 386
387 387 SAVEARGS= -Wu,-save_args
388 388 amd64_STAND_FLAGS += $(SAVEARGS)
389 389
390 390 STAND_FLAGS_32 = $($(MACH)_STAND_FLAGS)
391 391 STAND_FLAGS_64 = $($(MACH64)_STAND_FLAGS)
392 392
393 393 #
394 394 # disable the incremental linker
395 395 ILDOFF= -xildoff
396 396 #
397 397 XDEPEND= -xdepend
398 398 XFFLAG= -xF=%all
399 399 XESS= -xs
400 400 XSTRCONST= -xstrconst
401 401
402 402 #
403 403 # turn warnings into errors (C)
404 404 CERRWARN = -errtags=yes -errwarn=%all
405 405 CERRWARN += -erroff=E_EMPTY_TRANSLATION_UNIT
406 406 CERRWARN += -erroff=E_STATEMENT_NOT_REACHED
407 407
408 408 CERRWARN += -_gcc=-Wno-missing-braces
409 409 CERRWARN += -_gcc=-Wno-sign-compare
410 410 CERRWARN += -_gcc=-Wno-unknown-pragmas
411 411 CERRWARN += -_gcc=-Wno-unused-parameter
412 412 CERRWARN += -_gcc=-Wno-missing-field-initializers
413 413
414 414 # Unfortunately, this option can misfire very easily and unfixably.
415 415 CERRWARN += -_gcc=-Wno-array-bounds
416 416
417 417 # DEBUG v. -nd make for frequent unused variables, empty conditions, etc. in
418 418 # -nd builds
419 419 $(RELEASE_BUILD)CERRWARN += -_gcc=-Wno-unused
420 420 $(RELEASE_BUILD)CERRWARN += -_gcc=-Wno-empty-body
421 421
422 422 #
423 423 # turn warnings into errors (C++)
424 424 CCERRWARN= -xwe
425 425
426 426 # C99 mode
427 427 C99_ENABLE= -xc99=%all
428 428 C99_DISABLE= -xc99=%none
429 429 C99MODE= $(C99_DISABLE)
430 430 C99LMODE= $(C99MODE:-xc99%=-Xc99%)
431 431
432 432 # In most places, assignments to these macros should be appended with +=
433 433 # (CPPFLAGS.master allows values to be prepended to CPPFLAGS).
434 434 sparc_CFLAGS= $(sparc_XARCH) $(CCSTATICSYM)
435 435 sparcv9_CFLAGS= $(sparcv9_XARCH) -dalign $(CCVERBOSE) $(V9ABIWARN) $(CCREGSYM) \
436 436 $(CCSTATICSYM)
437 437 i386_CFLAGS= $(i386_XARCH)
438 438 amd64_CFLAGS= $(amd64_XARCH)
439 439
440 440 sparc_ASFLAGS= $(sparc_AS_XARCH)
441 441 sparcv9_ASFLAGS=$(sparcv9_AS_XARCH)
442 442 i386_ASFLAGS= $(i386_AS_XARCH)
443 443 amd64_ASFLAGS= $(amd64_AS_XARCH)
444 444
445 445 #
446 446 sparc_COPTFLAG= -xO3
447 447 sparcv9_COPTFLAG= -xO3
448 448 i386_COPTFLAG= -O
449 449 amd64_COPTFLAG= -xO3
450 450
451 451 COPTFLAG= $($(MACH)_COPTFLAG)
452 452 COPTFLAG64= $($(MACH64)_COPTFLAG)
453 453
454 454 # When -g is used, the compiler globalizes static objects
455 455 # (gives them a unique prefix). Disable that.
456 456 CNOGLOBAL= -W0,-noglobal
457 457
458 458 # Direct the Sun Studio compiler to use a static globalization prefix based on the
459 459 # name of the module rather than something unique. Otherwise, objects
460 460 # will not build deterministically, as subsequent compilations of identical
461 461 # source will yeild objects that always look different.
462 462 #
463 463 # In the same spirit, this will also remove the date from the N_OPT stab.
464 464 CGLOBALSTATIC= -W0,-xglobalstatic
465 465
466 466 # Sometimes we want all symbols and types in debugging information even
467 467 # if they aren't used.
468 468 CALLSYMS= -W0,-xdbggen=no%usedonly
469 469
470 470 #
471 471 # Default debug format for Sun Studio 11 is dwarf, so force it to
472 472 # generate stabs.
473 473 #
474 474 DEBUGFORMAT= -xdebugformat=stabs
475 475
476 476 #
477 477 # Flags used to build in debug mode for ctf generation. Bugs in the Devpro
478 478 # compilers currently prevent us from building with cc-emitted DWARF.
479 479 #
480 480 CTF_FLAGS_sparc = -g -Wc,-Qiselect-T1 $(C99MODE) $(CNOGLOBAL) $(CDWARFSTR)
481 481 CTF_FLAGS_i386 = -g $(C99MODE) $(CNOGLOBAL) $(CDWARFSTR)
482 482
483 483 CTF_FLAGS_sparcv9 = $(CTF_FLAGS_sparc)
484 484 CTF_FLAGS_amd64 = $(CTF_FLAGS_i386)
485 485
486 486 # Sun Studio produces broken userland code when saving arguments.
487 487 $(__GNUC)CTF_FLAGS_amd64 += $(SAVEARGS)
488 488
489 489 CTF_FLAGS_32 = $(CTF_FLAGS_$(MACH)) $(DEBUGFORMAT)
490 490 CTF_FLAGS_64 = $(CTF_FLAGS_$(MACH64)) $(DEBUGFORMAT)
491 491 CTF_FLAGS = $(CTF_FLAGS_32)
492 492
493 493 #
494 494 # Flags used with genoffsets
495 495 #
496 496 GOFLAGS = -_noecho \
497 497 $(CALLSYMS) \
498 498 $(CDWARFSTR)
499 499
500 500 OFFSETS_CREATE = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \
501 501 $(CC) $(GOFLAGS) $(CFLAGS) $(CPPFLAGS)
502 502
503 503 OFFSETS_CREATE64 = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \
504 504 $(CC) $(GOFLAGS) $(CFLAGS64) $(CPPFLAGS)
505 505
506 506 #
507 507 # tradeoff time for space (smaller is better)
508 508 #
509 509 sparc_SPACEFLAG = -xspace -W0,-Lt
510 510 sparcv9_SPACEFLAG = -xspace -W0,-Lt
511 511 i386_SPACEFLAG = -xspace
512 512 amd64_SPACEFLAG =
513 513
514 514 SPACEFLAG = $($(MACH)_SPACEFLAG)
515 515 SPACEFLAG64 = $($(MACH64)_SPACEFLAG)
516 516
517 517 #
518 518 # The Sun Studio 11 compiler has changed the behaviour of integer
519 519 # wrap arounds and so a flag is needed to use the legacy behaviour
520 520 # (without this flag panics/hangs could be exposed within the source).
521 521 #
522 522 sparc_IROPTFLAG = -W2,-xwrap_int
523 523 sparcv9_IROPTFLAG = -W2,-xwrap_int
524 524 i386_IROPTFLAG =
525 525 amd64_IROPTFLAG =
526 526
527 527 IROPTFLAG = $($(MACH)_IROPTFLAG)
528 528 IROPTFLAG64 = $($(MACH64)_IROPTFLAG)
529 529
530 530 sparc_XREGSFLAG = -xregs=no%appl
531 531 sparcv9_XREGSFLAG = -xregs=no%appl
532 532 i386_XREGSFLAG =
533 533 amd64_XREGSFLAG =
534 534
535 535 XREGSFLAG = $($(MACH)_XREGSFLAG)
536 536 XREGSFLAG64 = $($(MACH64)_XREGSFLAG)
537 537
538 538 CFLAGS= $(COPTFLAG) $($(MACH)_CFLAGS) $(SPACEFLAG) $(CCMODE) \
539 539 $(ILDOFF) $(CERRWARN) $(C99MODE) $(CCUNBOUND) $(IROPTFLAG) \
540 540 $(CGLOBALSTATIC) $(CCNOAUTOINLINE)
541 541 CFLAGS64= $(COPTFLAG64) $($(MACH64)_CFLAGS) $(SPACEFLAG64) $(CCMODE64) \
542 542 $(ILDOFF) $(CERRWARN) $(C99MODE) $(CCUNBOUND) $(IROPTFLAG64) \
543 543 $(CGLOBALSTATIC) $(CCNOAUTOINLINE)
544 544 #
545 545 # Flags that are used to build parts of the code that are subsequently
546 546 # run on the build machine (also known as the NATIVE_BUILD).
547 547 #
548 548 NATIVE_CFLAGS= $(COPTFLAG) $($(NATIVE_MACH)_CFLAGS) $(CCMODE) \
549 549 $(ILDOFF) $(CERRWARN) $(C99MODE) $($(NATIVE_MACH)_CCUNBOUND) \
550 550 $(IROPTFLAG) $(CGLOBALSTATIC) $(CCNOAUTOINLINE)
551 551
552 552 DTEXTDOM=-DTEXT_DOMAIN=\"$(TEXT_DOMAIN)\" # For messaging.
553 553 DTS_ERRNO=-D_TS_ERRNO
554 554 CPPFLAGS.master=$(DTEXTDOM) $(DTS_ERRNO) \
555 555 $(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4)
556 556 CPPFLAGS.native=$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4)
557 557 CPPFLAGS= $(CPPFLAGS.master)
558 558 AS_CPPFLAGS= $(CPPFLAGS.master)
559 559 JAVAFLAGS= -deprecation
560 560
561 561 #
562 562 # For source message catalogue
563 563 #
564 564 .SUFFIXES: $(SUFFIXES) .i .po
565 565 MSGROOT= $(ROOT)/catalog
566 566 MSGDOMAIN= $(MSGROOT)/$(TEXT_DOMAIN)
567 567 MSGDOMAINPOFILE = $(MSGDOMAIN)/$(POFILE)
568 568 DCMSGDOMAIN= $(MSGROOT)/LC_TIME/$(TEXT_DOMAIN)
569 569 DCMSGDOMAINPOFILE = $(DCMSGDOMAIN)/$(DCFILE:.dc=.po)
570 570
571 571 CLOBBERFILES += $(POFILE) $(POFILES)
572 572 COMPILE.cpp= $(CC) -E -C $(CFLAGS) $(CPPFLAGS)
573 573 XGETTEXT= /usr/bin/xgettext
574 574 XGETFLAGS= -c TRANSLATION_NOTE
575 575 GNUXGETTEXT= /usr/gnu/bin/xgettext
576 576 GNUXGETFLAGS= --add-comments=TRANSLATION_NOTE --keyword=_ \
577 577 --strict --no-location --omit-header
578 578 BUILD.po= $(XGETTEXT) $(XGETFLAGS) -d $(<F) $<.i ;\
579 579 $(RM) $@ ;\
580 580 $(SED) "/^domain/d" < $(<F).po > $@ ;\
581 581 $(RM) $(<F).po $<.i
582 582
583 583 #
584 584 # This is overwritten by local Makefile when PROG is a list.
585 585 #
586 586 POFILE= $(PROG).po
587 587
588 588 sparc_CCFLAGS= -cg92 -compat=4 \
589 589 -Qoption ccfe -messages=no%anachronism \
590 590 $(CCERRWARN)
591 591 sparcv9_CCFLAGS= $(sparcv9_XARCH) -dalign -compat=5 \
592 592 -Qoption ccfe -messages=no%anachronism \
593 593 -Qoption ccfe -features=no%conststrings \
594 594 $(CCCREGSYM) \
595 595 $(CCERRWARN)
596 596 i386_CCFLAGS= -compat=4 \
597 597 -Qoption ccfe -messages=no%anachronism \
598 598 -Qoption ccfe -features=no%conststrings \
599 599 $(CCERRWARN)
600 600 amd64_CCFLAGS= $(amd64_XARCH) -compat=5 \
601 601 -Qoption ccfe -messages=no%anachronism \
602 602 -Qoption ccfe -features=no%conststrings \
603 603 $(CCERRWARN)
604 604
605 605 sparc_CCOPTFLAG= -O
606 606 sparcv9_CCOPTFLAG= -O
607 607 i386_CCOPTFLAG= -O
608 608 amd64_CCOPTFLAG= -O
609 609
610 610 CCOPTFLAG= $($(MACH)_CCOPTFLAG)
611 611 CCOPTFLAG64= $($(MACH64)_CCOPTFLAG)
612 612 CCFLAGS= $(CCOPTFLAG) $($(MACH)_CCFLAGS)
613 613 CCFLAGS64= $(CCOPTFLAG64) $($(MACH64)_CCFLAGS)
614 614
615 615 #
616 616 #
617 617 #
618 618 ELFWRAP_FLAGS =
619 619 ELFWRAP_FLAGS64 = -64
620 620
621 621 #
622 622 # Various mapfiles that are used throughout the build, and delivered to
623 623 # /usr/lib/ld.
624 624 #
625 625 MAPFILE.NED_i386 = $(SRC)/common/mapfiles/common/map.noexdata
626 626 MAPFILE.NED_sparc =
627 627 MAPFILE.NED = $(MAPFILE.NED_$(MACH))
628 628 MAPFILE.PGA = $(SRC)/common/mapfiles/common/map.pagealign
629 629 MAPFILE.NES = $(SRC)/common/mapfiles/common/map.noexstk
630 630 MAPFILE.FLT = $(SRC)/common/mapfiles/common/map.filter
631 631 MAPFILE.LEX = $(SRC)/common/mapfiles/common/map.lex.yy
632 632
633 633 #
634 634 # Generated mapfiles that are compiler specific, and used throughout the
635 635 # build. These mapfiles are not delivered in /usr/lib/ld.
636 636 #
637 637 MAPFILE.NGB_sparc= $(SRC)/common/mapfiles/gen/sparc_cc_map.noexeglobs
638 638 $(__GNUC64)MAPFILE.NGB_sparc= \
639 639 $(SRC)/common/mapfiles/gen/sparc_gcc_map.noexeglobs
640 640 MAPFILE.NGB_sparcv9= $(SRC)/common/mapfiles/gen/sparcv9_cc_map.noexeglobs
641 641 $(__GNUC64)MAPFILE.NGB_sparcv9= \
642 642 $(SRC)/common/mapfiles/gen/sparcv9_gcc_map.noexeglobs
643 643 MAPFILE.NGB_i386= $(SRC)/common/mapfiles/gen/i386_cc_map.noexeglobs
644 644 $(__GNUC64)MAPFILE.NGB_i386= \
645 645 $(SRC)/common/mapfiles/gen/i386_gcc_map.noexeglobs
646 646 MAPFILE.NGB_amd64= $(SRC)/common/mapfiles/gen/amd64_cc_map.noexeglobs
647 647 $(__GNUC64)MAPFILE.NGB_amd64= \
648 648 $(SRC)/common/mapfiles/gen/amd64_gcc_map.noexeglobs
649 649 MAPFILE.NGB = $(MAPFILE.NGB_$(MACH))
650 650
651 651 #
652 652 # A generic interface mapfile name, used by various dynamic objects to define
653 653 # the interfaces and interposers the object must export.
654 654 #
655 655 MAPFILE.INT = mapfile-intf
656 656
657 657 #
658 658 # LDLIBS32 can be set in the environment to override the following assignment.
659 659 # LDLIBS64 can be set to override the assignment made in Makefile.master.64.
660 660 # These environment settings make sure that no libraries are searched outside
661 661 # of the local workspace proto area:
662 662 # LDLIBS32=-YP,$ROOT/lib:$ROOT/usr/lib
663 663 # LDLIBS64=-YP,$ROOT/lib/$MACH64:$ROOT/usr/lib/$MACH64
664 664 #
665 665 LDLIBS32 = $(ENVLDLIBS1) $(ENVLDLIBS2) $(ENVLDLIBS3)
666 666 LDLIBS.cmd = $(LDLIBS32)
667 667 LDLIBS.lib = $(LDLIBS32)
668 668 #
669 669 # Define compilation macros.
670 670 #
671 671 COMPILE.c= $(CC) $(CFLAGS) $(CPPFLAGS) -c
672 672 COMPILE64.c= $(CC) $(CFLAGS64) $(CPPFLAGS) -c
673 673 COMPILE.cc= $(CCC) $(CCFLAGS) $(CPPFLAGS) -c
674 674 COMPILE64.cc= $(CCC) $(CCFLAGS64) $(CPPFLAGS) -c
675 675 COMPILE.s= $(AS) $(ASFLAGS) $(AS_CPPFLAGS)
676 676 COMPILE64.s= $(AS) $(ASFLAGS) $($(MACH64)_AS_XARCH) $(AS_CPPFLAGS)
677 677 COMPILE.d= $(DTRACE) -G -32
678 678 COMPILE64.d= $(DTRACE) -G -64
679 679 COMPILE.b= $(ELFWRAP) $(ELFWRAP_FLAGS$(CLASS))
680 680 COMPILE64.b= $(ELFWRAP) $(ELFWRAP_FLAGS$(CLASS))
681 681
682 682 CLASSPATH= .
683 683 COMPILE.java= $(JAVAC) $(JAVAFLAGS) -classpath $(CLASSPATH)
684 684
685 685 #
686 686 # Link time macros
687 687 #
688 688 CCNEEDED = -lC
689 689 CCEXTNEEDED = -lCrun -lCstd
690 690 $(__GNUC)CCNEEDED = -L$(GCCLIBDIR) -R$(GCCLIBDIR) -lstdc++ -lgcc_s
691 691 $(__GNUC)CCEXTNEEDED = $(CCNEEDED)
692 692
693 693 LINK.c= $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
694 694 LINK64.c= $(CC) $(CFLAGS64) $(CPPFLAGS) $(LDFLAGS)
695 695 NORUNPATH= -norunpath -nolib
696 696 LINK.cc= $(CCC) $(CCFLAGS) $(CPPFLAGS) $(NORUNPATH) \
697 697 $(LDFLAGS) $(CCNEEDED)
698 698 LINK64.cc= $(CCC) $(CCFLAGS64) $(CPPFLAGS) $(NORUNPATH) \
699 699 $(LDFLAGS) $(CCNEEDED)
700 700
701 701 #
702 702 # lint macros
703 703 #
704 704 # Note that the undefine of __PRAGMA_REDEFINE_EXTNAME can be removed once
705 705 # ON is built with a version of lint that has the fix for 4484186.
706 706 #
707 707 ALWAYS_LINT_DEFS = -errtags=yes -s
708 708 ALWAYS_LINT_DEFS += -erroff=E_PTRDIFF_OVERFLOW
709 709 ALWAYS_LINT_DEFS += -erroff=E_ASSIGN_NARROW_CONV
710 710 ALWAYS_LINT_DEFS += -U__PRAGMA_REDEFINE_EXTNAME
711 711 ALWAYS_LINT_DEFS += $(C99LMODE)
712 712 ALWAYS_LINT_DEFS += -errsecurity=$(SECLEVEL)
713 713 ALWAYS_LINT_DEFS += -erroff=E_SEC_CREAT_WITHOUT_EXCL
714 714 ALWAYS_LINT_DEFS += -erroff=E_SEC_FORBIDDEN_WARN_CREAT
715 715 # XX64 -- really only needed for amd64 lint
716 716 ALWAYS_LINT_DEFS += -erroff=E_ASSIGN_INT_TO_SMALL_INT
717 717 ALWAYS_LINT_DEFS += -erroff=E_CAST_INT_CONST_TO_SMALL_INT
718 718 ALWAYS_LINT_DEFS += -erroff=E_CAST_INT_TO_SMALL_INT
719 719 ALWAYS_LINT_DEFS += -erroff=E_CAST_TO_PTR_FROM_INT
720 720 ALWAYS_LINT_DEFS += -erroff=E_COMP_INT_WITH_LARGE_INT
721 721 ALWAYS_LINT_DEFS += -erroff=E_INTEGRAL_CONST_EXP_EXPECTED
722 722 ALWAYS_LINT_DEFS += -erroff=E_PASS_INT_TO_SMALL_INT
723 723 ALWAYS_LINT_DEFS += -erroff=E_PTR_CONV_LOSES_BITS
724 724
725 725 # This forces lint to pick up note.h and sys/note.h from Devpro rather than
726 726 # from the proto area. The note.h that ON delivers would disable NOTE().
727 727 ONLY_LINT_DEFS = -I$(SPRO_VROOT)/prod/include/lint
728 728
729 729 SECLEVEL= core
730 730 LINT.c= $(LINT) $(ONLY_LINT_DEFS) $(LINTFLAGS) $(CPPFLAGS) \
731 731 $(ALWAYS_LINT_DEFS)
732 732 LINT64.c= $(LINT) $(ONLY_LINT_DEFS) $(LINTFLAGS64) $(CPPFLAGS) \
733 733 $(ALWAYS_LINT_DEFS)
734 734 LINT.s= $(LINT.c)
735 735
736 736 # For some future builds, NATIVE_MACH and MACH might be different.
737 737 # Therefore, NATIVE_MACH needs to be redefined in the
738 738 # environment as `uname -p` to override this macro.
739 739 #
740 740 # For now at least, we cross-compile amd64 on i386 machines.
741 741 NATIVE_MACH= $(MACH:amd64=i386)
742 742
743 743 # Define native compilation macros
744 744 #
745 745
746 746 # Base directory where compilers are loaded.
747 747 # Defined here so it can be overridden by developer.
748 748 #
749 749 SPRO_ROOT= $(BUILD_TOOLS)/SUNWspro
750 750 SPRO_VROOT= $(SPRO_ROOT)/SS12
751 751 GNU_ROOT= $(SFW_ROOT)
752 752
753 753 # Till SS12u1 formally becomes the NV CBE, LINT is hard
754 754 # coded to be picked up from the $SPRO_ROOT/sunstudio12.1/
755 755 # location. Impacted variables are sparc_LINT, sparcv9_LINT,
756 756 # i386_LINT, amd64_LINT.
757 757 # Reset them when SS12u1 is rolled out.
758 758 #
759 759
760 760 # Specify platform compiler versions for languages
761 761 # that we use (currently only c and c++).
762 762 #
763 763 sparc_CC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_cc
764 764 $(__GNUC)sparc_CC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_gcc
765 765 sparc_CCC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_CC
766 766 $(__GNUC)sparc_CCC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_g++
767 767 sparc_CPP= /usr/ccs/lib/cpp
768 768 sparc_AS= /usr/ccs/bin/as -xregsym=no
769 769 sparc_LD= /usr/ccs/bin/ld
770 770 sparc_LINT= $(SPRO_ROOT)/sunstudio12.1/bin/lint
771 771
772 772 sparcv9_CC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_cc
773 773 $(__GNUC64)sparcv9_CC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_gcc
774 774 sparcv9_CCC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_CC
775 775 $(__GNUC64)sparcv9_CCC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_g++
776 776 sparcv9_CPP= /usr/ccs/lib/cpp
777 777 sparcv9_AS= /usr/ccs/bin/as -xregsym=no
778 778 sparcv9_LD= /usr/ccs/bin/ld
779 779 sparcv9_LINT= $(SPRO_ROOT)/sunstudio12.1/bin/lint
780 780
781 781 i386_CC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_cc
782 782 $(__GNUC)i386_CC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_gcc
783 783 i386_CCC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_CC
784 784 $(__GNUC)i386_CCC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_g++
785 785 i386_CPP= /usr/ccs/lib/cpp
786 786 i386_AS= /usr/ccs/bin/as
787 787 $(__GNUC)i386_AS= $(ONBLD_TOOLS)/bin/$(MACH)/aw
788 788 i386_LD= /usr/ccs/bin/ld
789 789 i386_LINT= $(SPRO_ROOT)/sunstudio12.1/bin/lint
790 790
791 791 amd64_CC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_cc
792 792 $(__GNUC64)amd64_CC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_gcc
793 793 amd64_CCC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_CC
794 794 $(__GNUC64)amd64_CCC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_g++
795 795 amd64_CPP= /usr/ccs/lib/cpp
796 796 amd64_AS= $(ONBLD_TOOLS)/bin/$(MACH)/aw
797 797 amd64_LD= /usr/ccs/bin/ld
798 798 amd64_LINT= $(SPRO_ROOT)/sunstudio12.1/bin/lint
799 799
800 800 NATIVECC= $($(NATIVE_MACH)_CC)
801 801 NATIVECCC= $($(NATIVE_MACH)_CCC)
802 802 NATIVECPP= $($(NATIVE_MACH)_CPP)
803 803 NATIVEAS= $($(NATIVE_MACH)_AS)
804 804 NATIVELD= $($(NATIVE_MACH)_LD)
805 805 NATIVELINT= $($(NATIVE_MACH)_LINT)
806 806
807 807 #
808 808 # Makefile.master.64 overrides these settings
809 809 #
810 810 CC= $(NATIVECC)
811 811 CCC= $(NATIVECCC)
812 812 CPP= $(NATIVECPP)
813 813 AS= $(NATIVEAS)
814 814 LD= $(NATIVELD)
815 815 LINT= $(NATIVELINT)
816 816
817 817 # The real compilers used for this build
818 818 CW_CC_CMD= $(CC) -_compiler
819 819 CW_CCC_CMD= $(CCC) -_compiler
820 820 REAL_CC= $(CW_CC_CMD:sh)
821 821 REAL_CCC= $(CW_CCC_CMD:sh)
822 822
823 823 # Pass -Y flag to cpp (method of which is release-dependent)
824 824 CCYFLAG= -Y I,
825 825
826 826 BDIRECT= -Bdirect
827 827 BDYNAMIC= -Bdynamic
828 828 BLOCAL= -Blocal
829 829 BNODIRECT= -Bnodirect
830 830 BREDUCE= -Breduce
831 831 BSTATIC= -Bstatic
832 832
833 833 ZDEFS= -zdefs
834 834 ZDIRECT= -zdirect
835 835 ZIGNORE= -zignore
836 836 ZINITFIRST= -zinitfirst
837 837 ZINTERPOSE= -zinterpose
838 838 ZLAZYLOAD= -zlazyload
839 839 ZLOADFLTR= -zloadfltr
840 840 ZMULDEFS= -zmuldefs
841 841 ZNODEFAULTLIB= -znodefaultlib
842 842 ZNODEFS= -znodefs
843 843 ZNODELETE= -znodelete
844 844 ZNODLOPEN= -znodlopen
845 845 ZNODUMP= -znodump
846 846 ZNOLAZYLOAD= -znolazyload
847 847 ZNOLDYNSYM= -znoldynsym
848 848 ZNORELOC= -znoreloc
849 849 ZNOVERSION= -znoversion
850 850 ZRECORD= -zrecord
851 851 ZREDLOCSYM= -zredlocsym
852 852 ZTEXT= -ztext
853 853 ZVERBOSE= -zverbose
854 854
855 855 GSHARED= -G
856 856 CCMT= -mt
857 857
858 858 # Handle different PIC models on different ISAs
859 859 # (May be overridden by lower-level Makefiles)
860 860
861 861 sparc_C_PICFLAGS = -K pic
862 862 sparcv9_C_PICFLAGS = -K pic
863 863 i386_C_PICFLAGS = -K pic
864 864 amd64_C_PICFLAGS = -K pic
865 865 C_PICFLAGS = $($(MACH)_C_PICFLAGS)
866 866 C_PICFLAGS64 = $($(MACH64)_C_PICFLAGS)
867 867
868 868 sparc_C_BIGPICFLAGS = -K PIC
869 869 sparcv9_C_BIGPICFLAGS = -K PIC
870 870 i386_C_BIGPICFLAGS = -K PIC
871 871 amd64_C_BIGPICFLAGS = -K PIC
872 872 C_BIGPICFLAGS = $($(MACH)_C_BIGPICFLAGS)
873 873 C_BIGPICFLAGS64 = $($(MACH64)_C_BIGPICFLAGS)
874 874
875 875 # CC requires there to be no space between '-K' and 'pic' or 'PIC'.
876 876 sparc_CC_PICFLAGS = -Kpic
877 877 sparcv9_CC_PICFLAGS = -KPIC
878 878 i386_CC_PICFLAGS = -Kpic
879 879 amd64_CC_PICFLAGS = -Kpic
880 880 CC_PICFLAGS = $($(MACH)_CC_PICFLAGS)
881 881 CC_PICFLAGS64 = $($(MACH64)_CC_PICFLAGS)
882 882
883 883 AS_PICFLAGS= $(C_PICFLAGS)
884 884 AS_BIGPICFLAGS= $(C_BIGPICFLAGS)
885 885
886 886 #
887 887 # Default label for CTF sections
888 888 #
889 889 CTFCVTFLAGS= -i -L VERSION
890 890
891 891 #
892 892 # Override to pass module-specific flags to ctfmerge. Currently used
893 893 # only by krtld to turn on fuzzy matching.
894 894 #
895 895 CTFMRGFLAGS=
896 896
897 897 CTFCONVERT_O = $(CTFCONVERT) $(CTFCVTFLAGS) $@
898 898
899 899 ELFSIGN_O= $(TRUE)
900 900 ELFSIGN_CRYPTO= $(ELFSIGN_O)
901 901 ELFSIGN_OBJECT= $(ELFSIGN_O)
902 902 $(EXPORT_RELEASE_BUILD)ELFSIGN_O = $(ELFSIGN)
903 903 $(EXPORT_RELEASE_BUILD)ELFSIGN_CFNAME = SUNWosnetCF
904 904 $(EXPORT_RELEASE_BUILD)ELFSIGN_KEY = \
905 905 $(CLOSED)/cmd/cmd-crypto/etc/keys/$(ELFSIGN_CFNAME)
906 906 $(EXPORT_RELEASE_BUILD)ELFSIGN_CERT= \
907 907 $(CLOSED)/cmd/cmd-crypto/etc/certs/$(ELFSIGN_CFNAME)
908 908 $(EXPORT_RELEASE_BUILD)ELFSIGN_SENAME = SUNWosnetSE
909 909 $(EXPORT_RELEASE_BUILD)ELFSIGN_SEKEY = \
910 910 $(CLOSED)/cmd/cmd-crypto/etc/keys/$(ELFSIGN_SENAME)
911 911 $(EXPORT_RELEASE_BUILD)ELFSIGN_SECERT= \
912 912 $(CLOSED)/cmd/cmd-crypto/etc/certs/$(ELFSIGN_SENAME)
913 913 $(EXPORT_RELEASE_BUILD)ELFSIGN_CRYPTO= $(ELFSIGN_O) sign \
914 914 $(ELFSIGN_FORMAT_OPTION) \
915 915 -k $(ELFSIGN_KEY) -c $(ELFSIGN_CERT) -e $@
916 916 $(EXPORT_RELEASE_BUILD)ELFSIGN_OBJECT= $(ELFSIGN_O) sign \
917 917 $(ELFSIGN_FORMAT_OPTION) \
918 918 -k $(ELFSIGN_SEKEY) -c $(ELFSIGN_SECERT) -e $@
919 919
920 920 # Rules (normally from make.rules) and macros which are used for post
921 921 # processing files. Normally, these do stripping of the comment section
922 922 # automatically.
923 923 # RELEASE_CM: Should be editted to reflect the release.
924 924 # POST_PROCESS_O: Post-processing for `.o' files.
925 925 # POST_PROCESS_A: Post-processing for `.a' files (currently null).
926 926 # POST_PROCESS_SO: Post-processing for `.so' files.
927 927 # POST_PROCESS: Post-processing for executable files (no suffix).
928 928 # Note that these macros are not completely generalized as they are to be
929 929 # used with the file name to be processed following.
930 930 #
931 931 # It is left as an exercise to Release Engineering to embellish the generation
932 932 # of the release comment string.
933 933 #
934 934 # If this is a standard development build:
935 935 # compress the comment section (mcs -c)
936 936 # add the standard comment (mcs -a $(RELEASE_CM))
937 937 # add the development specific comment (mcs -a $(DEV_CM))
938 938 #
939 939 # If this is an installation build:
940 940 # delete the comment section (mcs -d)
941 941 # add the standard comment (mcs -a $(RELEASE_CM))
942 942 # add the development specific comment (mcs -a $(DEV_CM))
943 943 #
944 944 # If this is an release build:
945 945 # delete the comment section (mcs -d)
946 946 # add the standard comment (mcs -a $(RELEASE_CM))
947 947 #
948 948 # The following list of macros are used in the definition of RELEASE_CM
949 949 # which is used to label all binaries in the build:
950 950 #
951 951 # RELEASE Specific release of the build, eg: 5.2
952 952 # RELEASE_MAJOR Major version number part of $(RELEASE)
953 953 # RELEASE_MINOR Minor version number part of $(RELEASE)
954 954 # VERSION Version of the build (alpha, beta, Generic)
955 955 # PATCHID If this is a patch this value should contain
956 956 # the patchid value (eg: "Generic 100832-01"), otherwise
957 957 # it will be set to $(VERSION)
958 958 # RELEASE_DATE Date of the Release Build
959 959 # PATCH_DATE Date the patch was created, if this is blank it
960 960 # will default to the RELEASE_DATE
961 961 #
962 962 RELEASE_MAJOR= 5
963 963 RELEASE_MINOR= 11
964 964 RELEASE= $(RELEASE_MAJOR).$(RELEASE_MINOR)
965 965 VERSION= SunOS Development
966 966 PATCHID= $(VERSION)
967 967 RELEASE_DATE= release date not set
968 968 PATCH_DATE= $(RELEASE_DATE)
969 969 RELEASE_CM= "@($(POUND_SIGN))SunOS $(RELEASE) $(PATCHID) $(PATCH_DATE)"
970 970 DEV_CM= "@($(POUND_SIGN))SunOS Internal Development: non-nightly build"
971 971
972 972 PROCESS_COMMENT= @?${MCS} -c -a $(RELEASE_CM) -a $(DEV_CM)
973 973 $(STRIP_COMMENTS)PROCESS_COMMENT= @?${MCS} -d -a $(RELEASE_CM) -a $(DEV_CM)
974 974 $(RELEASE_BUILD)PROCESS_COMMENT= @?${MCS} -d -a $(RELEASE_CM)
975 975
976 976 STRIP_STABS= :
977 977 $(RELEASE_BUILD)STRIP_STABS= $(STRIP) -x $@
978 978
979 979 POST_PROCESS_O= $(PROCESS_COMMENT) $@
980 980 POST_PROCESS_A=
981 981 POST_PROCESS_SO= $(PROCESS_COMMENT) $@ ; $(STRIP_STABS) ; \
982 982 $(ELFSIGN_OBJECT)
983 983 POST_PROCESS= $(PROCESS_COMMENT) $@ ; $(STRIP_STABS) ; \
984 984 $(ELFSIGN_OBJECT)
985 985
986 986 #
987 987 # chk4ubin is a tool that inspects a module for a symbol table
988 988 # ELF section size which can trigger an OBP bug on older platforms.
989 989 # This problem affects only specific sun4u bootable modules.
990 990 #
991 991 CHK4UBIN= $(ONBLD_TOOLS)/bin/$(MACH)/chk4ubin
992 992 CHK4UBINFLAGS=
993 993 CHK4UBINARY= $(CHK4UBIN) $(CHK4UBINFLAGS) $@
994 994
995 995 #
996 996 # PKGARCHIVE specifies the default location where packages should be
997 997 # placed if built.
998 998 #
999 999 $(RELEASE_BUILD)PKGARCHIVESUFFIX= -nd
1000 1000 PKGARCHIVE=$(SRC)/../../packages/$(MACH)/nightly$(PKGARCHIVESUFFIX)
1001 1001
1002 1002 #
1003 1003 # The repositories will be created with these publisher settings. To
1004 1004 # update an image to the resulting repositories, this must match the
1005 1005 # publisher name provided to "pkg set-publisher."
1006 1006 #
1007 1007 PKGPUBLISHER_REDIST= on-nightly
1008 1008 PKGPUBLISHER_NONREDIST= on-extra
1009 1009
1010 1010 # Default build rules which perform comment section post-processing.
1011 1011 #
1012 1012 .c:
1013 1013 $(LINK.c) -o $@ $< $(LDLIBS)
1014 1014 $(POST_PROCESS)
1015 1015 .c.o:
1016 1016 $(COMPILE.c) $(OUTPUT_OPTION) $< $(CTFCONVERT_HOOK)
1017 1017 $(POST_PROCESS_O)
1018 1018 .c.a:
1019 1019 $(COMPILE.c) -o $% $<
1020 1020 $(PROCESS_COMMENT) $%
1021 1021 $(AR) $(ARFLAGS) $@ $%
1022 1022 $(RM) $%
1023 1023 .s.o:
1024 1024 $(COMPILE.s) -o $@ $<
1025 1025 $(POST_PROCESS_O)
1026 1026 .s.a:
1027 1027 $(COMPILE.s) -o $% $<
1028 1028 $(PROCESS_COMMENT) $%
1029 1029 $(AR) $(ARFLAGS) $@ $%
1030 1030 $(RM) $%
1031 1031 .cc:
1032 1032 $(LINK.cc) -o $@ $< $(LDLIBS)
1033 1033 $(POST_PROCESS)
1034 1034 .cc.o:
1035 1035 $(COMPILE.cc) $(OUTPUT_OPTION) $<
1036 1036 $(POST_PROCESS_O)
1037 1037 .cc.a:
1038 1038 $(COMPILE.cc) -o $% $<
1039 1039 $(AR) $(ARFLAGS) $@ $%
1040 1040 $(PROCESS_COMMENT) $%
1041 1041 $(RM) $%
1042 1042 .y:
1043 1043 $(YACC.y) $<
1044 1044 $(LINK.c) -o $@ y.tab.c $(LDLIBS)
1045 1045 $(POST_PROCESS)
1046 1046 $(RM) y.tab.c
1047 1047 .y.o:
1048 1048 $(YACC.y) $<
1049 1049 $(COMPILE.c) -o $@ y.tab.c $(CTFCONVERT_HOOK)
1050 1050 $(POST_PROCESS_O)
1051 1051 $(RM) y.tab.c
1052 1052 .l:
1053 1053 $(RM) $*.c
1054 1054 $(LEX.l) $< > $*.c
1055 1055 $(LINK.c) -o $@ $*.c -ll $(LDLIBS)
1056 1056 $(POST_PROCESS)
1057 1057 $(RM) $*.c
1058 1058 .l.o:
1059 1059 $(RM) $*.c
1060 1060 $(LEX.l) $< > $*.c
1061 1061 $(COMPILE.c) -o $@ $*.c $(CTFCONVERT_HOOK)
1062 1062 $(POST_PROCESS_O)
1063 1063 $(RM) $*.c
1064 1064
1065 1065 .bin.o:
1066 1066 $(COMPILE.b) -o $@ $<
1067 1067 $(POST_PROCESS_O)
1068 1068
1069 1069 .java.class:
1070 1070 $(COMPILE.java) $<
1071 1071
1072 1072 # Bourne and Korn shell script message catalog build rules.
1073 1073 # We extract all gettext strings with sed(1) (being careful to permit
1074 1074 # multiple gettext strings on the same line), weed out the dups, and
1075 1075 # build the catalogue with awk(1).
1076 1076
1077 1077 .sh.po .ksh.po:
1078 1078 $(SED) -n -e ":a" \
1079 1079 -e "h" \
1080 1080 -e "s/.*gettext *\(\"[^\"]*\"\).*/\1/p" \
1081 1081 -e "x" \
1082 1082 -e "s/\(.*\)gettext *\"[^\"]*\"\(.*\)/\1\2/" \
1083 1083 -e "t a" \
1084 1084 $< | sort -u | awk '{ print "msgid\t" $$0 "\nmsgstr" }' > $@
1085 1085
1086 1086 #
1087 1087 # Python and Perl executable and message catalog build rules.
1088 1088 #
1089 1089 .SUFFIXES: .pl .pm .py .pyc
1090 1090
1091 1091 .pl:
1092 1092 $(RM) $@;
1093 1093 $(SED) -e "s@TEXT_DOMAIN@\"$(TEXT_DOMAIN)\"@" $< > $@;
1094 1094 $(CHMOD) +x $@
1095 1095
1096 1096 .py:
1097 1097 $(RM) $@; $(CAT) $< > $@; $(CHMOD) +x $@
1098 1098
1099 1099 .py.pyc:
1100 1100 $(RM) $@
1101 1101 $(PYTHON) -mpy_compile $<
1102 1102 @[ $(<)c = $@ ] || $(MV) $(<)c $@
1103 1103
1104 1104 .py.po:
1105 1105 $(GNUXGETTEXT) $(GNUXGETFLAGS) -d $(<F:%.py=%) $< ;
1106 1106
1107 1107 .pl.po .pm.po:
1108 1108 $(XGETTEXT) $(XGETFLAGS) -d $(<F) $< ;
1109 1109 $(RM) $@ ;
1110 1110 $(SED) "/^domain/d" < $(<F).po > $@ ;
1111 1111 $(RM) $(<F).po
1112 1112
1113 1113 #
1114 1114 # When using xgettext, we want messages to go to the default domain,
1115 1115 # rather than the specified one. This special version of the
1116 1116 # COMPILE.cpp macro effectively prevents expansion of TEXT_DOMAIN,
1117 1117 # causing xgettext to put all messages into the default domain.
1118 1118 #
1119 1119 CPPFORPO=$(COMPILE.cpp:\"$(TEXT_DOMAIN)\"=TEXT_DOMAIN)
1120 1120
1121 1121 .c.i:
1122 1122 $(CPPFORPO) $< > $@
1123 1123
1124 1124 .h.i:
1125 1125 $(CPPFORPO) $< > $@
1126 1126
1127 1127 .y.i:
1128 1128 $(YACC) -d $<
1129 1129 $(CPPFORPO) y.tab.c > $@
1130 1130 $(RM) y.tab.c
1131 1131
1132 1132 .l.i:
1133 1133 $(LEX) $<
1134 1134 $(CPPFORPO) lex.yy.c > $@
1135 1135 $(RM) lex.yy.c
1136 1136
1137 1137 .c.po:
1138 1138 $(CPPFORPO) $< > $<.i
1139 1139 $(BUILD.po)
1140 1140
1141 1141 .y.po:
1142 1142 $(YACC) -d $<
1143 1143 $(CPPFORPO) y.tab.c > $<.i
1144 1144 $(BUILD.po)
1145 1145 $(RM) y.tab.c
1146 1146
1147 1147 .l.po:
1148 1148 $(LEX) $<
1149 1149 $(CPPFORPO) lex.yy.c > $<.i
1150 1150 $(BUILD.po)
1151 1151 $(RM) lex.yy.c
1152 1152
1153 1153 #
1154 1154 # Rules to perform stylistic checks
1155 1155 #
1156 1156 .SUFFIXES: .x .xml .check .xmlchk
1157 1157
1158 1158 .h.check:
1159 1159 $(DOT_H_CHECK)
1160 1160
1161 1161 .x.check:
1162 1162 $(DOT_X_CHECK)
1163 1163
1164 1164 .xml.xmlchk:
1165 1165 $(MANIFEST_CHECK)
1166 1166
1167 1167 #
1168 1168 # Rules to process ONC+ Source partial files
1169 1169 #
1170 1170 %_onc_plus: %
1171 1171 @$(ECHO) "extracting code from $< ... "
1172 1172 sed -n -e '/ONC_PLUS EXTRACT START/,/ONC_PLUS EXTRACT END/p' $< > $@
1173 1173
1174 1174 #
1175 1175 # Include rules to render automated sccs get rules "safe".
1176 1176 #
1177 1177 include $(SRC)/Makefile.noget
↓ open down ↓ |
1000 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX