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