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