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