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