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.
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.
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]
23 # Copyright 2010 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
27 # Makefile.master, global definitions for system source
32 # RELEASE_BUILD should be cleared for final release builds.
33 # NOT_RELEASE_BUILD is exactly what the name implies.
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.
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.)
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
49 # STRIP_COMMENTS toggles comment section striping. Generally the same setting
50 # as INTERNAL_RELEASE_BUILD.
52 # __GNUC toggles the building of ON components using gcc and related tools.
53 # Normally set to `#', set it to `' to do gcc build.
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. We use this macro expansion method to get POUND_SIGN rather than
58 # always breaking out a shell because the general case can cause a noticable
59 # slowdown in build times when so many Makefiles include Makefile.master.
61 # While the majority of users are expected to override the setting below
62 # with an env file (via nightly or bldenv), if you aren't building that way
63 # (ie, you're using "ws" or some other bootstrapping method) then you need
64 # this definition in order to avoid the subshell invocation mentioned above.
68 POUND_SIGN= $(PRE_POUND:pre\%=%)
71 INTERNAL_RELEASE_BUILD= $(POUND_SIGN)
72 RELEASE_BUILD= $(POUND_SIGN)
73 $(RELEASE_BUILD)NOT_RELEASE_BUILD= $(POUND_SIGN)
74 $(RELEASE_BUILD)INTERNAL_RELEASE_BUILD=
75 PATCH_BUILD= $(POUND_SIGN)
77 # If CLOSED_IS_PRESENT is not set, assume the closed tree is present.
78 CLOSED_BUILD_1= $(CLOSED_IS_PRESENT:yes=)
79 CLOSED_BUILD= $(CLOSED_BUILD_1:no=$(POUND_SIGN))
81 EXPORT_RELEASE_BUILD= $(POUND_SIGN)
82 $(CLOSED_BUILD)EXPORT_RELEASE_BUILD=
84 # SPARC_BLD is '#' for an Intel build.
85 # INTEL_BLD is '#' for a Sparc build.
86 SPARC_BLD_1= $(MACH:i386=$(POUND_SIGN))
87 SPARC_BLD= $(SPARC_BLD_1:sparc=)
88 INTEL_BLD_1= $(MACH:sparc=$(POUND_SIGN))
89 INTEL_BLD= $(INTEL_BLD_1:i386=)
91 STRIP_COMMENTS= $(INTERNAL_RELEASE_BUILD)
93 # set __GNUC= in the environment to build 32-bit with the gcc compiler.
94 # The default is to use the Sun Studio compiler for all processor types.
97 # set __GNUC64= in the environment to build 64-bit with the gcc compiler.
98 # Inherit the __GNUC value by default, and if that is set to $(POUND_SIGN)
99 # then this means use the Sun Studio compiler.
102 # set __SSNEXT= in the enviroment to build with the 'next' release of
103 # the Sun Studio compiler. This will cause command line options specific
104 # to the 'next' version of the Sun Studio compiler to be used.
105 __SSNEXT= $(POUND_SIGN)
107 # CLOSED is the root of the tree that contains source which isn't released
109 CLOSED= $(SRC)/../closed
111 # BUILD_TOOLS is the root of all tools including compilers.
112 # ONBLD_TOOLS is the root of all the tools that are part of SUNWonbld.
114 BUILD_TOOLS= /ws/onnv-tools
115 ONBLD_TOOLS= $(BUILD_TOOLS)/onbld
120 SFWINCDIR= $(SFW_ROOT)/include
121 SFWLIBDIR= $(SFW_ROOT)/lib
122 SFWLIBDIR64= $(SFW_ROOT)/lib/$(MACH64)
124 RPCGEN= /usr/bin/rpcgen
125 STABS= $(ONBLD_TOOLS)/bin/$(MACH)/stabs
126 ELFEXTRACT= $(ONBLD_TOOLS)/bin/$(MACH)/elfextract
127 MBH_PATCH= $(ONBLD_TOOLS)/bin/$(MACH)/mbh_patch
131 SYMLINK= /usr/bin/ln -s
133 CHMOD= /usr/bin/chmod
140 EGREP= /usr/bin/egrep
141 ELFWRAP= /usr/bin/elfwrap
142 KSH93= /usr/bin/ksh93
146 MCS= /usr/ccs/bin/mcs
148 ELFDUMP= /usr/ccs/bin/elfdump
150 STRIP= /usr/ccs/bin/strip
151 LEX= /usr/ccs/bin/lex
152 FLEX= $(SFW_ROOT)/bin/flex
153 YACC= /usr/ccs/bin/yacc
155 JAVAC= $(JAVA_ROOT)/bin/javac
156 JAVAH= $(JAVA_ROOT)/bin/javah
157 JAVADOC= $(JAVA_ROOT)/bin/javadoc
158 RMIC= $(JAVA_ROOT)/bin/rmic
159 JAR= $(JAVA_ROOT)/bin/jar
160 CTFCONVERT= $(ONBLD_TOOLS)/bin/$(MACH)/ctfconvert
161 CTFMERGE= $(ONBLD_TOOLS)/bin/$(MACH)/ctfmerge
162 CTFSTABS= $(ONBLD_TOOLS)/bin/$(MACH)/ctfstabs
163 NDRGEN= $(ONBLD_TOOLS)/bin/$(MACH)/ndrgen
164 GENOFFSETS= $(ONBLD_TOOLS)/bin/genoffsets
165 CTFCVTPTBL= $(ONBLD_TOOLS)/bin/ctfcvtptbl
166 CTFFINDMOD= $(ONBLD_TOOLS)/bin/ctffindmod
167 XREF= $(ONBLD_TOOLS)/bin/xref
170 PYTHON= /usr/bin/python2.4
172 TOUCH= /usr/bin/touch
174 XARGS= /usr/bin/xargs
175 ELFEDIT= /usr/bin/elfedit
176 ELFSIGN= /usr/bin/elfsign
177 DTRACE= /usr/sbin/dtrace
184 # The version of the patch makeup table optimized for build-time use. Used
185 # during patch builds only.
186 $(PATCH_BUILD)PMTMO_FILE=$(SRC)/patch_makeup_table.mo
188 # Declare that nothing should be built in parallel.
189 # Individual Makefiles can use the .PARALLEL target to declare otherwise.
192 # For stylistic checks
194 # Note that the X and C checks are not used at this time and may need
195 # modification when they are actually used.
197 CSTYLE= $(ONBLD_TOOLS)/bin/cstyle
199 HDRCHK= $(ONBLD_TOOLS)/bin/hdrchk
201 JSTYLE= $(ONBLD_TOOLS)/bin/jstyle
204 @$(ECHO) "checking $<"; $(CSTYLE) $< $(CSTYLE_TAIL); \
205 $(HDRCHK) $< $(HDRCHK_TAIL)
208 @$(ECHO) "checking $<"; $(RPCGEN) -C -h $< | $(CSTYLE) $(CSTYLE_TAIL); \
209 $(RPCGEN) -C -h $< | $(HDRCHK) $< $(HDRCHK_TAIL)
212 @$(ECHO) "checking $<"; $(CSTYLE) $< $(CSTYLE_TAIL)
215 @$(ECHO) "checking $<"; \
216 SVCCFG_DTD=$(SRC)/cmd/svc/dtd/service_bundle.dtd.1 \
217 SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/global.db \
218 SVCCFG_CONFIGD_PATH=$(SRC)/cmd/svc/configd/svc.configd-native \
219 $(SRC)/cmd/svc/svccfg/svccfg-native validate $<
221 INS.file= $(RM) $@; $(INS) -s -m $(FILEMODE) -f $(@D) $<
222 INS.dir= $(INS) -s -d -m $(DIRMODE) $@
223 # installs and renames at once
225 INS.rename= $(INS.file); $(MV) $(@D)/$(<F) $@
229 INS.link= $(RM) $@; $(LN) $(INSLINKTARGET) $@
231 # Python bakes the mtime of the .py file into the compiled .pyc and
232 # rebuilds if the baked-in mtime != the mtime of the source file
233 # (rather than only if it's less than), thus when installing python
234 # files we must make certain to not adjust the mtime of the source
237 INS.pyfile= $(INS.file); $(TOUCH) -r $< $@
239 # MACH must be set in the shell environment per uname -p on the build host
240 # More specific architecture variables should be set in lower makefiles.
242 # MACH64 is derived from MACH, and BUILD64 is set to `#' for
243 # architectures on which we do not build 64-bit versions.
244 # (There are no such architectures at the moment.)
246 # Set BUILD64=# in the environment to disable 64-bit amd64
247 # builds on i386 machines.
249 MACH64_1= $(MACH:sparc=sparcv9)
250 MACH64= $(MACH64_1:i386=amd64)
252 MACH32_1= $(MACH:sparc=sparcv7)
253 MACH32= $(MACH32_1:i386=i86)
257 BUILD64= $($(MACH)_BUILD64)
260 # C compiler mode. Future compilers may change the default on us,
261 # so force extended ANSI mode globally. Lower level makefiles can
262 # override this by setting CCMODE.
268 # C compiler verbose mode. This is so we can enable it globally,
269 # but turn it off in the lower level makefiles of things we cannot
270 # (or aren't going to) fix.
274 # set this to the secret flag "-Wc,-Qiselect-v9abiwarn=1" to get warnings
275 # from the compiler about places the -xarch=v9 may differ from -xarch=v9c.
278 # set this to the secret flag "-Wc,-Qiselect-regsym=0" to disable register
279 # symbols (used to detect conflicts between objects that use global registers)
280 # we disable this now for safety, and because genunix doesn't link with
281 # this feature (the v9 default) enabled.
283 # REGSYM is separate since the C++ driver syntax is different.
284 CCREGSYM= -Wc,-Qiselect-regsym=0
285 CCCREGSYM= -Qoption cg -Qiselect-regsym=0
287 # Prevent the removal of static symbols by the SPARC code generator (cg).
288 # The x86 code generator (ube) does not remove such symbols and as such
289 # using this workaround is not applicable for x86.
291 CCSTATICSYM= -Wc,-Qassembler-ounrefsym=0
293 # generate 32-bit addresses in the v9 kernel. Saves memory.
294 CCABS32= -Wc,-xcode=abs32
296 # One optimization the compiler might perform is to turn this:
303 # Since we do some of this (foo might be referenced in common kernel code
304 # but provided only for some cpu modules or platforms), we disable this
307 sparc_CCUNBOUND = -Wd,-xsafe=unboundsym
309 CCUNBOUND = $($(MACH)_CCUNBOUND)
312 # compiler '-xarch' flag. This is here to centralize it and make it
313 # overridable for testing.
317 amd64_XARCH= -m64 -Ui386 -U__i386
319 # assembler '-xarch' flag. Different from compiler '-xarch' flag.
320 sparc_AS_XARCH= -xarch=v8plus
321 sparcv9_AS_XARCH= -xarch=v9
323 amd64_AS_XARCH= -xarch=amd64 -P -Ui386 -U__i386
326 # These flags define what we need to be 'standalone' i.e. -not- part
327 # of the rather more cosy userland environment. This basically means
330 # XX64 future versions of gcc will make -mcmodel=kernel imply -mno-red-zone
332 sparc_STAND_FLAGS= -_gcc=-ffreestanding
333 sparcv9_STAND_FLAGS= -_gcc=-ffreestanding
334 i386_STAND_FLAGS= -_gcc=-ffreestanding
335 amd64_STAND_FLAGS= -xmodel=kernel
337 SAVEARGS= -Wu,-save_args
338 amd64_STAND_FLAGS += $(SAVEARGS)
340 STAND_FLAGS_32 = $($(MACH)_STAND_FLAGS)
341 STAND_FLAGS_64 = $($(MACH64)_STAND_FLAGS)
344 # disable the incremental linker
350 XSTRCONST= -xstrconst
353 # turn warnings into errors (C)
354 CERRWARN = -errtags=yes -errwarn=%all
355 CERRWARN += -erroff=E_EMPTY_TRANSLATION_UNIT
356 CERRWARN += -erroff=E_STATEMENT_NOT_REACHED
359 # turn warnings into errors (C++)
363 C99_ENABLE= -xc99=%all
364 C99_DISABLE= -xc99=%none
365 C99MODE= $(C99_DISABLE)
366 C99LMODE= $(C99MODE:-xc99%=-Xc99%)
368 # In most places, assignments to these macros should be appended with +=
369 # (CPPFLAGS.master allows values to be prepended to CPPFLAGS).
370 sparc_CFLAGS= $(sparc_XARCH) $(CCSTATICSYM)
371 sparcv9_CFLAGS= $(sparcv9_XARCH) -dalign $(CCVERBOSE) $(V9ABIWARN) $(CCREGSYM) \
373 i386_CFLAGS= $(i386_XARCH)
374 amd64_CFLAGS= $(amd64_XARCH)
376 sparc_ASFLAGS= $(sparc_AS_XARCH)
377 sparcv9_ASFLAGS=$(sparcv9_AS_XARCH)
378 i386_ASFLAGS= $(i386_AS_XARCH)
379 amd64_ASFLAGS= $(amd64_AS_XARCH)
383 sparcv9_COPTFLAG= -xO3
387 COPTFLAG= $($(MACH)_COPTFLAG)
388 COPTFLAG64= $($(MACH64)_COPTFLAG)
390 # When -g is used, the compiler globalizes static objects
391 # (gives them a unique prefix). Disable that.
392 CNOGLOBAL= -W0,-noglobal
394 # Direct the Sun Studio compiler to use a static globalization prefix based on the
395 # name of the module rather than something unique. Otherwise, objects
396 # will not build deterministically, as subsequent compilations of identical
397 # source will yeild objects that always look different.
399 # In the same spirit, this will also remove the date from the N_OPT stab.
400 CGLOBALSTATIC= -W0,-xglobalstatic
402 # Normally, gcc uses indirect DWARF strings to save space. However,
403 # this causes relocations that ctfconvert cannot handle. Disable this.
404 CDWARFSTR= -_gcc=-fno-dwarf2-indirect-strings
406 # Sometimes we want all symbols and types in debugging information even
407 # if they aren't used.
408 CALLSYMS= -W0,-xdbggen=no%usedonly
411 # Default debug format for Sun Studio 11 is dwarf, so force it to
414 DEBUGFORMAT= -xdebugformat=stabs
417 # Flags used to build in debug mode for ctf generation. Bugs in the Devpro
418 # compilers currently prevent us from building with cc-emitted DWARF.
420 CTF_FLAGS_sparc = -g -Wc,-Qiselect-T1 $(C99MODE) $(CNOGLOBAL) $(CDWARFSTR)
421 CTF_FLAGS_i386 = -g $(C99MODE) $(CNOGLOBAL) $(CDWARFSTR)
422 CTF_FLAGS = $(CTF_FLAGS_$(MACH)) $(DEBUGFORMAT)
425 # Flags used with genoffsets
431 OFFSETS_CREATE = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \
432 $(CC) $(GOFLAGS) $(CFLAGS) $(CPPFLAGS)
434 OFFSETS_CREATE64 = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \
435 $(CC) $(GOFLAGS) $(CFLAGS64) $(CPPFLAGS)
438 # tradeoff time for space (smaller is better)
440 sparc_SPACEFLAG = -xspace -W0,-Lt
441 sparcv9_SPACEFLAG = -xspace -W0,-Lt
442 i386_SPACEFLAG = -xspace
445 SPACEFLAG = $($(MACH)_SPACEFLAG)
446 SPACEFLAG64 = $($(MACH64)_SPACEFLAG)
449 # The Sun Studio 11 compiler has changed the behaviour of integer
450 # wrap arounds and so a flag is needed to use the legacy behaviour
451 # (without this flag panics/hangs could be exposed within the source).
453 sparc_IROPTFLAG = -W2,-xwrap_int
454 sparcv9_IROPTFLAG = -W2,-xwrap_int
458 IROPTFLAG = $($(MACH)_IROPTFLAG)
459 IROPTFLAG64 = $($(MACH64)_IROPTFLAG)
461 sparc_XREGSFLAG = -xregs=no%appl
462 sparcv9_XREGSFLAG = -xregs=no%appl
466 XREGSFLAG = $($(MACH)_XREGSFLAG)
467 XREGSFLAG64 = $($(MACH64)_XREGSFLAG)
469 CFLAGS= $(COPTFLAG) $($(MACH)_CFLAGS) $(SPACEFLAG) $(CCMODE) \
470 $(ILDOFF) $(CERRWARN) $(C99MODE) $(CCUNBOUND) $(IROPTFLAG) \
472 CFLAGS64= $(COPTFLAG64) $($(MACH64)_CFLAGS) $(SPACEFLAG64) $(CCMODE64) \
473 $(ILDOFF) $(CERRWARN) $(C99MODE) $(CCUNBOUND) $(IROPTFLAG64) \
476 # Flags that are used to build parts of the code that are subsequently
477 # run on the build machine (also known as the NATIVE_BUILD).
479 NATIVE_CFLAGS= $(COPTFLAG) $($(NATIVE_MACH)_CFLAGS) $(CCMODE) \
480 $(ILDOFF) $(CERRWARN) $(C99MODE) $($(NATIVE_MACH)_CCUNBOUND) \
481 $(IROPTFLAG) $(CGLOBALSTATIC)
483 DTEXTDOM=-DTEXT_DOMAIN=\"$(TEXT_DOMAIN)\" # For messaging.
484 DTS_ERRNO=-D_TS_ERRNO
485 CPPFLAGS.master=$(DTEXTDOM) $(DTS_ERRNO) \
486 $(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4)
487 CPPFLAGS= $(CPPFLAGS.master)
488 AS_CPPFLAGS= $(CPPFLAGS.master)
489 JAVAFLAGS= -deprecation
492 # For source message catalogue
494 .SUFFIXES: $(SUFFIXES) .i .po
495 MSGROOT= $(ROOT)/catalog
496 MSGDOMAIN= $(MSGROOT)/$(TEXT_DOMAIN)
497 MSGDOMAINPOFILE = $(MSGDOMAIN)/$(POFILE)
498 DCMSGDOMAIN= $(MSGROOT)/LC_TIME/$(TEXT_DOMAIN)
499 DCMSGDOMAINPOFILE = $(DCMSGDOMAIN)/$(DCFILE:.dc=.po)
501 CLOBBERFILES += $(POFILE) $(POFILES)
502 COMPILE.cpp= $(CC) -E -C $(CFLAGS) $(CPPFLAGS)
503 XGETTEXT= /usr/bin/xgettext
504 XGETFLAGS= -c TRANSLATION_NOTE
505 GNUXGETTEXT= /usr/gnu/bin/xgettext
506 GNUXGETFLAGS= --add-comments=TRANSLATION_NOTE --keyword=_ \
507 --strict --no-location --omit-header
508 BUILD.po= $(XGETTEXT) $(XGETFLAGS) -d $(<F) $<.i ;\
510 $(SED) "/^domain/d" < $(<F).po > $@ ;\
514 # This is overwritten by local Makefile when PROG is a list.
518 sparc_CCFLAGS= -cg92 -compat=4 \
519 -Qoption ccfe -messages=no%anachronism \
521 sparcv9_CCFLAGS= $(sparcv9_XARCH) -dalign -compat=5 \
522 -Qoption ccfe -messages=no%anachronism \
523 -Qoption ccfe -features=no%conststrings \
526 i386_CCFLAGS= -compat=4 \
527 -Qoption ccfe -messages=no%anachronism \
528 -Qoption ccfe -features=no%conststrings \
530 amd64_CCFLAGS= $(amd64_XARCH) -compat=5 \
531 -Qoption ccfe -messages=no%anachronism \
532 -Qoption ccfe -features=no%conststrings \
536 sparcv9_CCOPTFLAG= -O
540 CCOPTFLAG= $($(MACH)_CCOPTFLAG)
541 CCOPTFLAG64= $($(MACH64)_CCOPTFLAG)
542 CCFLAGS= $(CCOPTFLAG) $($(MACH)_CCFLAGS)
543 CCFLAGS64= $(CCOPTFLAG64) $($(MACH64)_CCFLAGS)
549 ELFWRAP_FLAGS64 = -64
552 # Various mapfiles that are used throughout the build, and delivered to
555 MAPFILE.NED_i386 = $(SRC)/common/mapfiles/i386/map.noexdata
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
564 # Generated mapfiles that are compiler specific, and used throughout the
565 # build. These mapfiles are not delivered in /usr/lib/ld.
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))
582 # A generic interface mapfile name, used by various dynamic objects to define
583 # the interfaces and interposers the object must export.
585 MAPFILE.INT = mapfile-intf
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
595 LDLIBS32 = $(ENVLDLIBS1) $(ENVLDLIBS2) $(ENVLDLIBS3)
596 LDLIBS.cmd = $(LDLIBS32)
597 LDLIBS.lib = $(LDLIBS32)
599 # Define compilation macros.
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 COMPILE.b= $(ELFWRAP) $(ELFWRAP_FLAGS$(CLASS))
610 COMPILE64.b= $(ELFWRAP) $(ELFWRAP_FLAGS$(CLASS))
613 COMPILE.java= $(JAVAC) $(JAVAFLAGS) -classpath $(CLASSPATH)
619 $(__GNUC)CCNEEDED = -L$(SFWLIBDIR) -R$(SFWLIBDIR) -lstdc++ -lgcc_s
621 LINK.c= $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
622 LINK64.c= $(CC) $(CFLAGS64) $(CPPFLAGS) $(LDFLAGS)
623 NORUNPATH= -norunpath -nolib
624 LINK.cc= $(CCC) $(CCFLAGS) $(CPPFLAGS) $(NORUNPATH) \
625 $(LDFLAGS) $(CCNEEDED)
626 LINK64.cc= $(CCC) $(CCFLAGS64) $(CPPFLAGS) $(NORUNPATH) \
627 $(LDFLAGS) $(CCNEEDED)
632 # Note that the undefine of __PRAGMA_REDEFINE_EXTNAME can be removed once
633 # ON is built with a version of lint that has the fix for 4484186.
635 ALWAYS_LINT_DEFS = -errtags=yes -s
636 ALWAYS_LINT_DEFS += -erroff=E_PTRDIFF_OVERFLOW
637 ALWAYS_LINT_DEFS += -erroff=E_ASSIGN_NARROW_CONV
638 ALWAYS_LINT_DEFS += -U__PRAGMA_REDEFINE_EXTNAME
639 ALWAYS_LINT_DEFS += $(C99LMODE)
640 ALWAYS_LINT_DEFS += -errsecurity=$(SECLEVEL)
641 ALWAYS_LINT_DEFS += -erroff=E_SEC_CREAT_WITHOUT_EXCL
642 ALWAYS_LINT_DEFS += -erroff=E_SEC_FORBIDDEN_WARN_CREAT
643 # XX64 -- really only needed for amd64 lint
644 ALWAYS_LINT_DEFS += -erroff=E_ASSIGN_INT_TO_SMALL_INT
645 ALWAYS_LINT_DEFS += -erroff=E_CAST_INT_CONST_TO_SMALL_INT
646 ALWAYS_LINT_DEFS += -erroff=E_CAST_INT_TO_SMALL_INT
647 ALWAYS_LINT_DEFS += -erroff=E_CAST_TO_PTR_FROM_INT
648 ALWAYS_LINT_DEFS += -erroff=E_COMP_INT_WITH_LARGE_INT
649 ALWAYS_LINT_DEFS += -erroff=E_INTEGRAL_CONST_EXP_EXPECTED
650 ALWAYS_LINT_DEFS += -erroff=E_PASS_INT_TO_SMALL_INT
651 ALWAYS_LINT_DEFS += -erroff=E_PTR_CONV_LOSES_BITS
653 # This forces lint to pick up note.h and sys/note.h from Devpro rather than
654 # from the proto area. The note.h that ON delivers would disable NOTE().
655 ONLY_LINT_DEFS = -I$(SPRO_VROOT)/prod/include/lint
658 LINT.c= $(LINT) $(ONLY_LINT_DEFS) $(LINTFLAGS) $(CPPFLAGS) \
660 LINT64.c= $(LINT) $(ONLY_LINT_DEFS) $(LINTFLAGS64) $(CPPFLAGS) \
664 # For some future builds, NATIVE_MACH and MACH might be different.
665 # Therefore, NATIVE_MACH needs to be redefined in the
666 # environment as `uname -p` to override this macro.
668 # For now at least, we cross-compile amd64 on i386 machines.
669 NATIVE_MACH= $(MACH:amd64=i386)
671 # Define native compilation macros
674 # Base directory where compilers are loaded.
675 # Defined here so it can be overridden by developer.
677 SPRO_ROOT= $(BUILD_TOOLS)/SUNWspro
678 SPRO_VROOT= $(SPRO_ROOT)/SS12
679 GNU_ROOT= $(SFW_ROOT)
681 # Specify platform compiler versions for languages
682 # that we use (currently only c and c++).
684 sparc_CC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_cc
685 $(__GNUC)sparc_CC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_gcc
686 sparc_CCC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_CC
687 $(__GNUC)sparc_CCC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_g++
688 sparc_CPP= /usr/ccs/lib/cpp
689 sparc_AS= /usr/ccs/bin/as -xregsym=no
690 sparc_LD= /usr/ccs/bin/ld
691 sparc_LINT= $(SPRO_VROOT)/bin/lint
693 sparcv9_CC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_cc
694 $(__GNUC64)sparcv9_CC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_gcc
695 sparcv9_CCC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_CC
696 $(__GNUC64)sparcv9_CCC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_g++
697 sparcv9_CPP= /usr/ccs/lib/cpp
698 sparcv9_AS= /usr/ccs/bin/as -xregsym=no
699 sparcv9_LD= /usr/ccs/bin/ld
700 sparcv9_LINT= $(SPRO_VROOT)/bin/lint
702 # We compile 32-bit objects with cc by default
703 i386_CC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_cc
704 $(__GNUC)i386_CC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_gcc
705 i386_CCC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_CC
706 $(__GNUC)i386_CCC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_g++
707 i386_CPP= /usr/ccs/lib/cpp
708 i386_AS= /usr/ccs/bin/as
709 $(__GNUC)i386_AS= $(ONBLD_TOOLS)/bin/$(MACH)/aw
710 i386_LD= /usr/ccs/bin/ld
711 i386_LINT= $(SPRO_VROOT)/bin/lint
713 # We compile 64-bit objects with gcc
714 amd64_CC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_cc
715 $(__GNUC64)amd64_CC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_gcc
716 amd64_CCC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_CC
717 $(__GNUC64)amd64_CCC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_g++
718 amd64_CPP= /usr/ccs/lib/cpp
719 amd64_AS= $(ONBLD_TOOLS)/bin/$(MACH)/aw
720 amd64_LD= /usr/ccs/bin/ld
721 amd64_LINT= $(SPRO_VROOT)/bin/lint
723 NATIVECC= $($(NATIVE_MACH)_CC)
724 NATIVECCC= $($(NATIVE_MACH)_CCC)
725 NATIVECPP= $($(NATIVE_MACH)_CPP)
726 NATIVEAS= $($(NATIVE_MACH)_AS)
727 NATIVELD= $($(NATIVE_MACH)_LD)
728 NATIVELINT= $($(NATIVE_MACH)_LINT)
731 # Makefile.master.64 overrides these settings
740 # The real compilers used for this build
741 CW_CC_CMD= $(CC) -_compiler
742 CW_CCC_CMD= $(CCC) -_compiler
743 REAL_CC= $(CW_CC_CMD:sh)
744 REAL_CCC= $(CW_CCC_CMD:sh)
746 # Pass -Y flag to cpp (method of which is release-dependent)
752 BNODIRECT= -Bnodirect
759 ZINITFIRST= -zinitfirst
760 ZINTERPOSE= -zinterpose
761 ZLAZYLOAD= -zlazyload
762 ZLOADFLTR= -zloadfltr
764 ZNODEFAULTLIB= -znodefaultlib
766 ZNODELETE= -znodelete
767 ZNODLOPEN= -znodlopen
769 ZNOLAZYLOAD= -znolazyload
770 ZNOLDYNSYM= -znoldynsym
772 ZNOVERSION= -znoversion
774 ZREDLOCSYM= -zredlocsym
781 # Handle different PIC models on different ISAs
782 # (May be overridden by lower-level Makefiles)
784 sparc_C_PICFLAGS = -K pic
785 sparcv9_C_PICFLAGS = -K pic
786 i386_C_PICFLAGS = -K pic
787 amd64_C_PICFLAGS = -K pic
788 C_PICFLAGS = $($(MACH)_C_PICFLAGS)
789 C_PICFLAGS64 = $($(MACH64)_C_PICFLAGS)
791 sparc_C_BIGPICFLAGS = -K PIC
792 sparcv9_C_BIGPICFLAGS = -K PIC
793 i386_C_BIGPICFLAGS = -K PIC
794 amd64_C_BIGPICFLAGS = -K PIC
795 C_BIGPICFLAGS = $($(MACH)_C_BIGPICFLAGS)
796 C_BIGPICFLAGS64 = $($(MACH64)_C_BIGPICFLAGS)
798 # CC requires there to be no space between '-K' and 'pic' or 'PIC'.
799 sparc_CC_PICFLAGS = -Kpic
800 sparcv9_CC_PICFLAGS = -KPIC
801 i386_CC_PICFLAGS = -Kpic
802 amd64_CC_PICFLAGS = -Kpic
803 CC_PICFLAGS = $($(MACH)_CC_PICFLAGS)
804 CC_PICFLAGS64 = $($(MACH64)_CC_PICFLAGS)
806 AS_PICFLAGS= $(C_PICFLAGS)
807 AS_BIGPICFLAGS= $(C_BIGPICFLAGS)
810 # Default label for CTF sections
812 CTFCVTFLAGS= -i -L VERSION
815 # Override to pass module-specific flags to ctfmerge. Currently used
816 # only by krtld to turn on fuzzy matching.
820 CTFCONVERT_O = $(CTFCONVERT) $(CTFCVTFLAGS) $@
823 ELFSIGN_CRYPTO= $(ELFSIGN_O)
824 ELFSIGN_OBJECT= $(ELFSIGN_O)
825 $(EXPORT_RELEASE_BUILD)ELFSIGN_O = $(ELFSIGN)
826 $(EXPORT_RELEASE_BUILD)ELFSIGN_CFNAME = SUNWosnetCF
827 $(EXPORT_RELEASE_BUILD)ELFSIGN_KEY = \
828 $(CLOSED)/cmd/cmd-crypto/etc/keys/$(ELFSIGN_CFNAME)
829 $(EXPORT_RELEASE_BUILD)ELFSIGN_CERT= \
830 $(CLOSED)/cmd/cmd-crypto/etc/certs/$(ELFSIGN_CFNAME)
831 $(EXPORT_RELEASE_BUILD)ELFSIGN_SENAME = SUNWosnetSE
832 $(EXPORT_RELEASE_BUILD)ELFSIGN_SEKEY = \
833 $(CLOSED)/cmd/cmd-crypto/etc/keys/$(ELFSIGN_SENAME)
834 $(EXPORT_RELEASE_BUILD)ELFSIGN_SECERT= \
835 $(CLOSED)/cmd/cmd-crypto/etc/certs/$(ELFSIGN_SENAME)
836 $(EXPORT_RELEASE_BUILD)ELFSIGN_CRYPTO= $(ELFSIGN_O) sign \
837 $(ELFSIGN_FORMAT_OPTION) \
838 -k $(ELFSIGN_KEY) -c $(ELFSIGN_CERT) -e $@
839 $(EXPORT_RELEASE_BUILD)ELFSIGN_OBJECT= $(ELFSIGN_O) sign \
840 $(ELFSIGN_FORMAT_OPTION) \
841 -k $(ELFSIGN_SEKEY) -c $(ELFSIGN_SECERT) -e $@
843 # Rules (normally from make.rules) and macros which are used for post
844 # processing files. Normally, these do stripping of the comment section
846 # RELEASE_CM: Should be editted to reflect the release.
847 # POST_PROCESS_O: Post-processing for `.o' files.
848 # POST_PROCESS_A: Post-processing for `.a' files (currently null).
849 # POST_PROCESS_SO: Post-processing for `.so' files.
850 # POST_PROCESS: Post-processing for executable files (no suffix).
851 # Note that these macros are not completely generalized as they are to be
852 # used with the file name to be processed following.
854 # It is left as an exercise to Release Engineering to embellish the generation
855 # of the release comment string.
857 # If this is a standard development build:
858 # compress the comment section (mcs -c)
859 # add the standard comment (mcs -a $(RELEASE_CM))
860 # add the development specific comment (mcs -a $(DEV_CM))
862 # If this is an installation build:
863 # delete the comment section (mcs -d)
864 # add the standard comment (mcs -a $(RELEASE_CM))
865 # add the development specific comment (mcs -a $(DEV_CM))
867 # If this is an release build:
868 # delete the comment section (mcs -d)
869 # add the standard comment (mcs -a $(RELEASE_CM))
871 # The following list of macros are used in the definition of RELEASE_CM
872 # which is used to label all binaries in the build:
874 # RELEASE Specific release of the build, eg: 5.2
875 # RELEASE_MAJOR Major version number part of $(RELEASE)
876 # RELEASE_MINOR Minor version number part of $(RELEASE)
877 # VERSION Version of the build (alpha, beta, Generic)
878 # PATCHID If this is a patch this value should contain
879 # the patchid value (eg: "Generic 100832-01"), otherwise
880 # it will be set to $(VERSION)
881 # RELEASE_DATE Date of the Release Build
882 # PATCH_DATE Date the patch was created, if this is blank it
883 # will default to the RELEASE_DATE
887 RELEASE= $(RELEASE_MAJOR).$(RELEASE_MINOR)
888 VERSION= SunOS Development
890 RELEASE_DATE= release date not set
891 PATCH_DATE= $(RELEASE_DATE)
892 RELEASE_CM= "@($(POUND_SIGN))SunOS $(RELEASE) $(PATCHID) $(PATCH_DATE)"
893 DEV_CM= "@($(POUND_SIGN))SunOS Internal Development: non-nightly build"
895 PROCESS_COMMENT= @?${MCS} -c -a $(RELEASE_CM) -a $(DEV_CM)
896 $(STRIP_COMMENTS)PROCESS_COMMENT= @?${MCS} -d -a $(RELEASE_CM) -a $(DEV_CM)
897 $(RELEASE_BUILD)PROCESS_COMMENT= @?${MCS} -d -a $(RELEASE_CM)
900 $(RELEASE_BUILD)STRIP_STABS= $(STRIP) -x $@
902 POST_PROCESS_O= $(PROCESS_COMMENT) $@
904 POST_PROCESS_SO= $(PROCESS_COMMENT) $@ ; $(STRIP_STABS) ; \
906 POST_PROCESS= $(PROCESS_COMMENT) $@ ; $(STRIP_STABS) ; \
910 # chk4ubin is a tool that inspects a module for a symbol table
911 # ELF section size which can trigger an OBP bug on older platforms.
912 # This problem affects only specific sun4u bootable modules.
914 CHK4UBIN= $(ONBLD_TOOLS)/bin/$(MACH)/chk4ubin
916 CHK4UBINARY= $(CHK4UBIN) $(CHK4UBINFLAGS) $@
919 # PKGARCHIVE specifies the default location where packages should be
922 $(RELEASE_BUILD)PKGARCHIVESUFFIX= -nd
923 PKGARCHIVE=$(SRC)/../../packages/$(MACH)/nightly$(PKGARCHIVESUFFIX)
926 # The repositories will be created with these publisher settings. To
927 # update an image to the resulting repositories, this must match the
928 # publisher name provided to "pkg set-publisher."
930 PKGPUBLISHER_REDIST= on-nightly
931 PKGPUBLISHER_NONREDIST= on-extra
933 # Default build rules which perform comment section post-processing.
936 $(LINK.c) -o $@ $< $(LDLIBS)
939 $(COMPILE.c) $(OUTPUT_OPTION) $< $(CTFCONVERT_HOOK)
942 $(COMPILE.c) -o $% $<
943 $(PROCESS_COMMENT) $%
944 $(AR) $(ARFLAGS) $@ $%
947 $(COMPILE.s) -o $@ $<
950 $(COMPILE.s) -o $% $<
951 $(PROCESS_COMMENT) $%
952 $(AR) $(ARFLAGS) $@ $%
955 $(LINK.cc) -o $@ $< $(LDLIBS)
958 $(COMPILE.cc) $(OUTPUT_OPTION) $<
961 $(COMPILE.cc) -o $% $<
962 $(AR) $(ARFLAGS) $@ $%
963 $(PROCESS_COMMENT) $%
967 $(LINK.c) -o $@ y.tab.c $(LDLIBS)
972 $(COMPILE.c) -o $@ y.tab.c $(CTFCONVERT_HOOK)
978 $(LINK.c) -o $@ $*.c -ll $(LDLIBS)
984 $(COMPILE.c) -o $@ $*.c $(CTFCONVERT_HOOK)
989 $(COMPILE.b) -o $@ $<
995 # Bourne and Korn shell script message catalog build rules.
996 # We extract all gettext strings with sed(1) (being careful to permit
997 # multiple gettext strings on the same line), weed out the dups, and
998 # build the catalogue with awk(1).
1003 -e "s/.*gettext *\(\"[^\"]*\"\).*/\1/p" \
1005 -e "s/\(.*\)gettext *\"[^\"]*\"\(.*\)/\1\2/" \
1007 $< | sort -u | awk '{ print "msgid\t" $$0 "\nmsgstr" }' > $@
1010 # Python and Perl executable and message catalog build rules.
1012 .SUFFIXES: .pl .pm .py .pyc
1016 $(SED) -e "s@TEXT_DOMAIN@\"$(TEXT_DOMAIN)\"@" $< > $@;
1020 $(RM) $@; $(CAT) $< > $@; $(CHMOD) +x $@
1024 $(PYTHON) -mpy_compile $<
1025 @[ $(<)c = $@ ] || $(MV) $(<)c $@
1028 $(GNUXGETTEXT) $(GNUXGETFLAGS) -d $(<F:%.py=%) $< ;
1031 $(XGETTEXT) $(XGETFLAGS) -d $(<F) $< ;
1033 $(SED) "/^domain/d" < $(<F).po > $@ ;
1037 # When using xgettext, we want messages to go to the default domain,
1038 # rather than the specified one. This special version of the
1039 # COMPILE.cpp macro effectively prevents expansion of TEXT_DOMAIN,
1040 # causing xgettext to put all messages into the default domain.
1042 CPPFORPO=$(COMPILE.cpp:\"$(TEXT_DOMAIN)\"=TEXT_DOMAIN)
1052 $(CPPFORPO) y.tab.c > $@
1057 $(CPPFORPO) lex.yy.c > $@
1061 $(CPPFORPO) $< > $<.i
1066 $(CPPFORPO) y.tab.c > $<.i
1072 $(CPPFORPO) lex.yy.c > $<.i
1077 # Rules to perform stylistic checks
1079 .SUFFIXES: .x .xml .check .xmlchk
1091 # Rules to process ONC+ Source partial files
1094 @$(ECHO) "extracting code from $< ... "
1095 sed -n -e '/ONC_PLUS EXTRACT START/,/ONC_PLUS EXTRACT END/p' $< > $@
1098 # Include rules to render automated sccs get rules "safe".
1100 include $(SRC)/Makefile.noget