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