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