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 (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
24 # Copyright (c) 2012 by Delphix. All rights reserved.
25 # Copyright 2014 Garrett D'Amore <garrett@damore.org>
26 # Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
27 # Copyright 2015 Gary Mills
28 # Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
29 # Copyright 2016 Toomas Soome <tsoome@me.com>
32 include $(SRC)/Makefile.cfgparam
35 # Makefile.master, global definitions for system source
40 # Adjunct root, containing an additional proto area to be used for headers
46 # Adjunct for building things that run on the build machine.
51 # RELEASE_BUILD should be cleared for final release builds.
52 # NOT_RELEASE_BUILD is exactly what the name implies.
56 RELEASE_BUILD= $(POUND_SIGN)
57 $(RELEASE_BUILD)NOT_RELEASE_BUILD= $(POUND_SIGN)
58 PATCH_BUILD= $(POUND_SIGN)
60 # SPARC_BLD is '#' for an Intel build.
61 # INTEL_BLD is '#' for a Sparc build.
62 SPARC_BLD_1= $(MACH:i386=$(POUND_SIGN))
63 SPARC_BLD= $(SPARC_BLD_1:sparc=)
64 INTEL_BLD_1= $(MACH:sparc=$(POUND_SIGN))
65 INTEL_BLD= $(INTEL_BLD_1:i386=)
67 # Allow build-time "configuration" to enable or disable some things.
68 # The default is POUND_SIGN, meaning "not enabled".
69 ENABLE_PERL64= $(POUND_SIGN)
71 # BUILD_TOOLS is the root of all tools including compilers.
72 # ONBLD_TOOLS is the root of all the tools that are part of SUNWonbld.
75 ONBLD_TOOLS= $(BUILD_TOOLS)/onbld
77 GCC_ROOT= /opt/gcc/4.4.4
78 GCCLIBDIR= $(GCC_ROOT)/lib
79 GCCLIBDIR64= $(GCC_ROOT)/lib/$(MACH64)
81 DOCBOOK_XSL_ROOT= /usr/share/sgml/docbook/xsl-stylesheets
83 RPCGEN= /usr/bin/rpcgen
84 STABS= $(ONBLD_TOOLS)/bin/$(MACH)/stabs
85 ELFEXTRACT= $(ONBLD_TOOLS)/bin/$(MACH)/elfextract
86 MBH_PATCH= $(SRCTOP)/tools/mbh_patch/obj/mbh_patch
87 BTXLD= $(ONBLD_TOOLS)/bin/$(MACH)/btxld
91 SYMLINK= /usr/bin/ln -s
100 EGREP= /usr/bin/egrep
101 ELFWRAP= /usr/bin/elfwrap
102 KSH93= /usr/bin/ksh93
106 MCS= /usr/ccs/bin/mcs
108 ELFDUMP= /usr/ccs/bin/elfdump
110 STRIP= /usr/ccs/bin/strip
111 LEX= /usr/ccs/bin/lex
114 YACC= /usr/ccs/bin/yacc
116 CTFCONVERT= $(ONBLD_TOOLS)/bin/$(MACH)/ctfconvert
117 CTFDIFF= $(ONBLD_TOOLS)/bin/$(MACH)/ctfdiff
118 CTFMERGE= $(ONBLD_TOOLS)/bin/$(MACH)/ctfmerge
119 CTFSTABS= $(ONBLD_TOOLS)/bin/$(MACH)/ctfstabs
120 CTFSTRIP= $(ONBLD_TOOLS)/bin/$(MACH)/ctfstrip
121 NDRGEN= $(ONBLD_TOOLS)/bin/$(MACH)/ndrgen
122 GENOFFSETS= $(ONBLD_TOOLS)/bin/genoffsets
127 PERL_ARCH= i86pc-solaris-64int
128 PERL_ARCH64= i86pc-solaris-64
129 $(SPARC_BLD)PERL_ARCH= sun4-solaris-64int
130 $(SPARC_BLD)PERL_ARCH64= sun4-solaris-64
133 PYTHON= /usr/bin/python$(PYTHON_VERSION)
135 TOUCH= /usr/bin/touch
137 XARGS= /usr/bin/xargs
138 ELFEDIT= /usr/bin/elfedit
139 DTRACE= /usr/sbin/dtrace -xnolibs
142 ASTBINDIR= /usr/ast/bin
143 MSGCC= $(ASTBINDIR)/msgcc
144 MSGFMT= /usr/bin/msgfmt -s
149 # Declare that nothing should be built in parallel.
150 # Individual Makefiles can use the .PARALLEL target to declare otherwise.
153 # For stylistic checks
155 # Note that the X and C checks are not used at this time and may need
156 # modification when they are actually used.
158 CSTYLE= $(ONBLD_TOOLS)/bin/cstyle
160 HDRCHK= $(ONBLD_TOOLS)/bin/hdrchk
164 @$(ECHO) "checking $<"; $(CSTYLE) $< $(CSTYLE_TAIL); \
165 $(HDRCHK) $< $(HDRCHK_TAIL)
168 @$(ECHO) "checking $<"; $(RPCGEN) -C -h $< | $(CSTYLE) $(CSTYLE_TAIL); \
169 $(RPCGEN) -C -h $< | $(HDRCHK) $< $(HDRCHK_TAIL)
172 @$(ECHO) "checking $<"; $(CSTYLE) $< $(CSTYLE_TAIL)
175 @$(ECHO) "checking $<"; \
176 SVCCFG_DTD=$(SRC)/cmd/svc/dtd/service_bundle.dtd.1 \
177 SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/global.db \
178 SVCCFG_CONFIGD_PATH=$(SRC)/cmd/svc/configd/svc.configd-native \
179 $(SRC)/cmd/svc/svccfg/svccfg-native validate $<
181 INS.file= $(INS) -m $(FILEMODE) $< $@
182 INS.dir= $(INS) -d -m $(DIRMODE) $@
183 # installs and renames at once
185 INS.rename= $(INS.file)
189 INS.link= $(RM) $@; $(LN) $(INSLINKTARGET) $@
190 INS.symlink= $(RM) $@; $(SYMLINK) $(INSLINKTARGET) $@
193 # Python bakes the mtime of the .py file into the compiled .pyc and
194 # rebuilds if the baked-in mtime != the mtime of the source file
195 # (rather than only if it's less than), thus when installing python
196 # files we must make certain to not adjust the mtime of the source
199 INS.pyfile= $(RM) $@; $(SED) -e "1s:^\#!@PYTHON@:\#!$(PYTHON):" < $< > $@; $(CHMOD) $(FILEMODE) $@; $(TOUCH) -r $< $@
201 # MACH must be set in the shell environment per uname -p on the build host
202 # More specific architecture variables should be set in lower makefiles.
204 # MACH64 is derived from MACH, and BUILD64 is set to `#' for
205 # architectures on which we do not build 64-bit versions.
206 # (There are no such architectures at the moment.)
208 # Set BUILD64=# in the environment to disable 64-bit amd64
209 # builds on i386 machines.
211 MACH64_1= $(MACH:sparc=sparcv9)
212 MACH64= $(MACH64_1:i386=amd64)
214 MACH32_1= $(MACH:sparc=sparcv7)
215 MACH32= $(MACH32_1:i386=i86)
219 BUILD64= $($(MACH)_BUILD64)
222 # generate 32-bit addresses in the v9 kernel. Saves memory.
223 CCABS32= -fno-pic -mcmodel=medlow
225 # generate v9 code which tolerates callers using the v7 ABI, for the sake of
227 CC32BITCALLERS= -massume-32bit-callers
229 # GCC, especially, is increasingly beginning to auto-inline functions and
230 # sadly does so separately not under the general -fno-inline-functions
231 # Additionally, we wish to prevent optimisations which cause GCC to clone
232 # functions -- in particular, these may cause unhelpful symbols to be
233 # emitted instead of function names
234 CCNOAUTOINLINE= -fno-inline-small-functions \
235 -fno-inline-functions-called-once \
239 # compiler architecture flags.
241 sparc_XARCH= -m32 -mcpu=v8 -mno-v8plus
242 sparcv9_XARCH= -m64 -mcpu=v9
243 i386_XARCH= -m32 -march=pentiumpro
244 amd64_XARCH= -m64 -Ui386 -U__i386 -mtune=opteron
246 # assembler architecture flags. Different from compiler architecture flags.
247 sparc_AS_XARCH= -xarch=v8plus -Dsparc -D__sparc -D__sparcv8
248 sparcv9_AS_XARCH= -xarch=v9 -Dsparc -D__sparc -D__sparcv9
249 i386_AS_XARCH= -m32 -Di386 -D__i386
250 amd64_AS_XARCH= -m64 -Ui386 -U__i386 -D__x86_64 -D__amd64
253 # These flags define what we need to be 'standalone' i.e. -not- part
254 # of the rather more cosy userland environment. This basically means
257 # XX64 future versions of gcc will make -mcmodel=kernel imply -mno-red-zone
259 sparc_STAND_FLAGS= -ffreestanding
260 sparcv9_STAND_FLAGS= -ffreestanding
261 # Disabling MMX also disables 3DNow, disabling SSE also disables all later
262 # additions to SSE (SSE2, AVX ,etc.)
263 NO_SIMD= -mno-mmx -mno-sse
264 i386_STAND_FLAGS= -ffreestanding $(NO_SIMD)
265 amd64_STAND_FLAGS= -ffreestanding -mno-red-zone \
266 -mcmodel=kernel $(NO_SIMD)
268 SAVEARGS= -msave-args
269 amd64_STAND_FLAGS += $(SAVEARGS)
271 STAND_FLAGS_32 = $($(MACH)_STAND_FLAGS)
272 STAND_FLAGS_64 = $($(MACH64)_STAND_FLAGS)
275 # turn warnings into errors (C)
276 CERRWARN = -Wall -Wextra -Werror
278 CERRWARN += -Wno-missing-braces
279 CERRWARN += -Wno-sign-compare
280 CERRWARN += -Wno-unknown-pragmas
281 CERRWARN += -Wno-unused-parameter
282 CERRWARN += -Wno-missing-field-initializers
284 # Unfortunately, this option can misfire very easily and unfixably.
285 CERRWARN += -Wno-array-bounds
287 # DEBUG v. -nd make for frequent unused variables, empty conditions, etc. in
289 $(RELEASE_BUILD)CERRWARN += -Wno-unused
290 $(RELEASE_BUILD)CERRWARN += -Wno-empty-body
293 # turn warnings into errors (C++)
297 C99_ENABLE= -std=gnu99
298 C99_DISABLE= -std=gnu89
299 C99MODE= $(C99_DISABLE)
301 # In most places, assignments to these macros should be appended with +=
302 # (CPPFLAGS.first allows values to be prepended to CPPFLAGS).
303 sparc_CFLAGS= $(sparc_XARCH)
304 sparcv9_CFLAGS= $(sparcv9_XARCH)
305 i386_CFLAGS= $(i386_XARCH)
306 amd64_CFLAGS= $(amd64_XARCH)
308 sparc_ASFLAGS= $(sparc_AS_XARCH)
309 sparcv9_ASFLAGS=$(sparcv9_AS_XARCH)
310 i386_ASFLAGS= $(i386_AS_XARCH)
311 amd64_ASFLAGS= $(amd64_AS_XARCH)
314 sparc_COPTFLAG= -fno-strict-aliasing \
315 -fno-unit-at-a-time \
316 -fno-optimize-sibling-calls \
318 sparcv9_COPTFLAG= -fno-strict-aliasing \
319 -fno-unit-at-a-time \
320 -fno-optimize-sibling-calls \
323 amd64_COPTFLAG= -fno-strict-aliasing \
324 -fno-unit-at-a-time \
325 -fno-optimize-sibling-calls \
328 COPTFLAG= $($(MACH)_COPTFLAG)
329 COPTFLAG64= $($(MACH64)_COPTFLAG)
331 # Sometimes we want all symbols and types in debugging information even
332 # if they aren't used.
333 CALLSYMS= -fno-eliminate-unused-debug-symbols \
334 -fno-eliminate-unused-debug-types
337 # Flags used to build in debug mode for ctf generation. Bugs in the Devpro
338 # compilers currently prevent us from building with cc-emitted DWARF.
340 CTF_FLAGS_sparc = -g -Wc,-Qiselect-T1 $(C99MODE) $(CDWARFSTR)
341 CTF_FLAGS_i386 = -g $(C99MODE) $(CDWARFSTR)
343 CTF_FLAGS_sparcv9 = $(CTF_FLAGS_sparc)
344 CTF_FLAGS_amd64 = $(CTF_FLAGS_i386)
346 CTF_FLAGS_amd64 += $(SAVEARGS)
348 CTF_FLAGS_32 = $(CTF_FLAGS_$(MACH))
349 CTF_FLAGS_64 = $(CTF_FLAGS_$(MACH64))
350 CTF_FLAGS = $(CTF_FLAGS_32)
353 # Flags used with genoffsets
355 GOFLAGS = $(CALLSYMS) \
358 OFFSETS_CREATE = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \
359 $(CC) $(GOFLAGS) $(CFLAGS) $(CPPFLAGS)
361 OFFSETS_CREATE64 = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \
362 $(CC) $(GOFLAGS) $(CFLAGS64) $(CPPFLAGS)
364 sparc_XREGSFLAG = -mno-app-regs
365 sparcv9_XREGSFLAG = -mno-app-regs
369 XREGSFLAG = $($(MACH)_XREGSFLAG)
370 XREGSFLAG64 = $($(MACH64)_XREGSFLAG)
372 # dmake SOURCEDEBUG=yes ... enables source-level debugging information, and
373 # avoids stripping it.
374 SOURCEDEBUG = $(POUND_SIGN)
375 SRCDBGBLD = $(SOURCEDEBUG:yes=)
378 # These variables are intended ONLY for use by developers to safely pass extra
379 # flags to the compilers without unintentionally overriding Makefile-set
380 # flags. They should NEVER be set to any value in a Makefile.
382 # They come last in the associated FLAGS variable such that they can
383 # explicitly override things if necessary, there are gaps in this, but it's
384 # the best we can manage.
387 CUSERFLAGS64 = $(CUSERFLAGS)
389 CCUSERFLAGS64 = $(CCUSERFLAGS)
393 $(SRCDBGBLD)CSOURCEDEBUGFLAGS = -g
394 $(SRCDBGBLD)CCSOURCEDEBUGFLAGS = -g
396 CFLAGS= $(COPTFLAG) $($(MACH)_CFLAGS) \
397 $(CERRWARN) $(C99MODE) \
398 $(CCNOAUTOINLINE) $(CSOURCEDEBUGFLAGS) \
400 CFLAGS64= $(COPTFLAG64) $($(MACH64)_CFLAGS) \
401 $(CERRWARN) $(C99MODE) \
402 $(CCNOAUTOINLINE) $(CSOURCEDEBUGFLAGS) \
406 # Flags that are used to build parts of the code that are subsequently
407 # run on the build machine (also known as the NATIVE_BUILD).
409 NATIVE_CFLAGS= $(COPTFLAG) $($(NATIVE_MACH)_CFLAGS) \
410 $(CERRWARN) $(C99MODE) \
412 $(CSOURCEDEBUGFLAGS) $(CUSERFLAGS)
414 DTEXTDOM=-DTEXT_DOMAIN=\"$(TEXT_DOMAIN)\" # For messaging.
415 CPPFLAGS.first= # Please keep empty. Only lower makefiles should set this.
416 CPPFLAGS.master=$(DTEXTDOM) \
417 $(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4) \
418 $(ADJUNCT_PROTO:%=-I%/usr/include)
419 CPPFLAGS.native=$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) \
420 $(ENVCPPFLAGS4) -I$(NATIVE_ADJUNCT)/include
421 CPPFLAGS= $(CPPFLAGS.first) $(CPPFLAGS.master)
422 AS_CPPFLAGS= $(CPPFLAGS.first) $(CPPFLAGS.master)
425 # For source message catalogue
427 .SUFFIXES: $(SUFFIXES) .i .po
428 MSGROOT= $(ROOT)/catalog
429 MSGDOMAIN= $(MSGROOT)/$(TEXT_DOMAIN)
430 MSGDOMAINPOFILE = $(MSGDOMAIN)/$(POFILE)
431 DCMSGDOMAIN= $(MSGROOT)/LC_TIME/$(TEXT_DOMAIN)
432 DCMSGDOMAINPOFILE = $(DCMSGDOMAIN)/$(DCFILE:.dc=.po)
434 CLOBBERFILES += $(POFILE) $(POFILES)
435 COMPILE.cpp= $(CC) -xc -E -C $(CFLAGS) $(CPPFLAGS)
436 XGETTEXT= /usr/bin/xgettext
437 XGETFLAGS= -c TRANSLATION_NOTE
438 BUILD.po= $(XGETTEXT) $(XGETFLAGS) -d $(<F) $<.i ;\
440 $(SED) "/^domain/d" < $(<F).po > $@ ;\
444 # This is overwritten by local Makefile when PROG is a list.
448 sparc_CCFLAGS= -m32 mcpu=v8 mno-v8plus \
451 sparcv9_CCFLAGS= $(sparcv9_XARCH) \
453 i386_CCFLAGS= $(CCERRWARN)
454 amd64_CCFLAGS= $(amd64_XARCH) \
458 sparcv9_CCOPTFLAG= -O
462 CCOPTFLAG= $($(MACH)_CCOPTFLAG)
463 CCOPTFLAG64= $($(MACH64)_CCOPTFLAG)
464 CCFLAGS= $(CCOPTFLAG) $($(MACH)_CCFLAGS) $(CCSOURCEDEBUGFLAGS) \
466 CCFLAGS64= $(CCOPTFLAG64) $($(MACH64)_CCFLAGS) $(CCSOURCEDEBUGFLAGS) \
473 ELFWRAP_FLAGS64 = -64
476 # Various mapfiles that are used throughout the build, and delivered to
479 MAPFILE.PGA = $(SRC)/common/mapfiles/common/map.pagealign
480 MAPFILE.FLT = $(SRC)/common/mapfiles/common/map.filter
481 MAPFILE.LEX = $(SRC)/common/mapfiles/common/map.lex.yy
484 # Generated mapfiles that are compiler specific, and used throughout the
485 # build. These mapfiles are not delivered in /usr/lib/ld.
487 MAPFILE.NGB_sparc= $(SRC)/common/mapfiles/gen/sparc_gcc_map.noexeglobs
488 MAPFILE.NGB_sparcv9= $(SRC)/common/mapfiles/gen/sparcv9_gcc_map.noexeglobs
489 MAPFILE.NGB_i386= $(SRC)/common/mapfiles/gen/i386_gcc_map.noexeglobs
490 MAPFILE.NGB_amd64= $(SRC)/common/mapfiles/gen/amd64_gcc_map.noexeglobs
491 MAPFILE.NGB = $(MAPFILE.NGB_$(MACH))
494 # A generic interface mapfile name, used by various dynamic objects to define
495 # the interfaces and interposers the object must export.
497 MAPFILE.INT = mapfile-intf
500 # LDLIBS32 and LDLIBS64 can be set in the environment to override the following
503 LDLIBS32 = $(ENVLDLIBS1) $(ENVLDLIBS2) $(ENVLDLIBS3)
504 LDLIBS32 += $(ADJUNCT_PROTO:%=-L%/usr/lib -L%/lib)
505 LDLIBS.cmd = $(LDLIBS32)
506 LDLIBS.lib = $(LDLIBS32)
508 LDLIBS64 = $(ENVLDLIBS1:%=%/$(MACH64)) \
509 $(ENVLDLIBS2:%=%/$(MACH64)) \
510 $(ENVLDLIBS3:%=%/$(MACH64))
511 LDLIBS64 += $(ADJUNCT_PROTO:%=-L%/usr/lib/$(MACH64) -L%/lib/$(MACH64))
514 # Define compilation macros.
516 COMPILE.c= $(CC) $(CFLAGS) $(CPPFLAGS) -c
517 COMPILE64.c= $(CC) $(CFLAGS64) $(CPPFLAGS) -c
518 COMPILE.cc= $(CCC) $(CCFLAGS) $(CPPFLAGS) -c
519 COMPILE64.cc= $(CCC) $(CCFLAGS64) $(CPPFLAGS) -c
520 COMPILE.s= $(AS) $(ASFLAGS) $(AS_CPPFLAGS)
521 COMPILE64.s= $(AS) $(ASFLAGS) $($(MACH64)_AS_XARCH) $(AS_CPPFLAGS)
522 COMPILE.d= $(DTRACE) -G -32
523 COMPILE64.d= $(DTRACE) -G -64
524 COMPILE.b= $(ELFWRAP) $(ELFWRAP_FLAGS$(CLASS))
525 COMPILE64.b= $(ELFWRAP) $(ELFWRAP_FLAGS$(CLASS))
530 CCNEEDED = -L$(GCCLIBDIR) -lstdc++ -lgcc_s
531 CCEXTNEEDED = $(CCNEEDED)
533 LINK.c= $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
534 LINK64.c= $(CC) $(CFLAGS64) $(CPPFLAGS) $(LDFLAGS)
535 LINK.cc= $(CCC) $(CCFLAGS) $(CPPFLAGS) \
536 $(LDFLAGS) $(CCNEEDED)
537 LINK64.cc= $(CCC) $(CCFLAGS64) $(CPPFLAGS) \
538 $(LDFLAGS) $(CCNEEDED)
542 # For some future builds, NATIVE_MACH and MACH might be different.
543 # Therefore, NATIVE_MACH needs to be redefined in the
544 # environment as `uname -p` to override this macro.
546 # For now at least, we cross-compile amd64 on i386 machines.
547 NATIVE_MACH= $(MACH:amd64=i386)
549 # Define native compilation macros
552 # Base directory where compilers are located.
553 # Defined here so it can be overridden by developers.
557 BASIC_CC_ARGS= -fident \
559 -fno-inline-functions \
562 -fdiagnostics-show-option \
565 # The SPARC ldd and std instructions require 8-byte alignment of their
566 # address operand. gcc correctly uses them only when the ABI requires
567 # 8-byte alignment; unfortunately we have a number of pieces of buggy code
568 # that does not conform to the ABI. This flag makes gcc work more like
569 # Studio with -xmemalign=4.
570 $(SPARC_BLD)BASIC_CC_ARGS += mno-integer-ldd-std
572 BASIC_CC_ARGS += -D__sun
574 BASIC_AS_ARGS= -x assembler-with-cpp \
577 -Wa,--fatal-warnings \
578 -Wa,--traditional-format \
581 # Specify platform compiler versions for languages
582 # that we use (currently only c and c++).
584 sparc_CC= $(SRC)/tools/scripts/gcc-wrap.sh $(GCC_ROOT)/bin/gcc $(BASIC_CC_ARGS)
585 sparc_CCC= $(SRC)/tools/scripts/gcc-wrap.sh $(GCC_ROOT)/bin/g++ $(BASIC_CC_ARGS)
586 sparc_CPP= $(GCC_ROOT)/bin/cpp
587 sparc_AS= /usr/ccs/bin/as -xregsym=no
588 sparc_LD= /usr/ccs/bin/ld
590 sparcv9_CC= $(SRC)/tools/scripts/gcc-wrap.sh $(GCC_ROOT)/bin/gcc $(BASIC_CC_ARGS)
591 sparcv9_CCC= $(SRC)/tools/scripts/gcc-wrap.sh $(GCC_ROOT)/bin/g++ $(BASIC_CC_ARGS)
592 sparcv9_CPP= $(GCC_ROOT)/bin/cpp
593 sparcv9_AS= /usr/ccs/bin/as -xregsym=no
594 sparcv9_LD= /usr/ccs/bin/ld
596 i386_CC= $(SRC)/tools/scripts/gcc-wrap.sh $(GCC_ROOT)/bin/gcc $(BASIC_CC_ARGS)
597 i386_CCC= $(SRC)/tools/scripts/gcc-wrap.sh $(GCC_ROOT)/bin/g++ $(BASIC_CC_ARGS)
598 i386_CPP= $(GCC_ROOT)/bin/cpp
599 i386_AS= $(GCC_ROOT)/bin/gcc $(BASIC_AS_ARGS)
600 i386_LD= /usr/ccs/bin/ld
602 amd64_CC= $(SRC)/tools/scripts/gcc-wrap.sh $(GCC_ROOT)/bin/gcc $(BASIC_CC_ARGS)
603 amd64_CCC= $(SRC)/tools/scripts/gcc-wrap.sh $(GCC_ROOT)/bin/g++ $(BASIC_CC_ARGS)
604 amd64_CPP= $(GCC_ROOT)/bin/cpp
605 amd64_AS= $(GCC_ROOT)/bin/gcc $(BASIC_AS_ARGS)
606 amd64_LD= /usr/ccs/bin/ld
608 NATIVECC= $($(NATIVE_MACH)_CC)
609 NATIVECCC= $($(NATIVE_MACH)_CCC)
610 NATIVECPP= $($(NATIVE_MACH)_CPP)
611 NATIVEAS= $($(NATIVE_MACH)_AS)
612 NATIVELD= $($(NATIVE_MACH)_LD)
615 # Makefile.master.64 overrides these settings
626 LD_BDYNAMIC= -Bdynamic
628 LD_BNODIRECT= -Bnodirect
632 BDIRECT= $(LD_BDIRECT:%=-Wl,%)
633 BDYNAMIC= $(LD_BDYNAMIC:%=-Wl,%)
634 BLOCAL= $(LD_BLOCAL:%=-Wl,%)
635 BNODIRECT= $(LD_BNODIRECT:%=-Wl,%)
636 BREDUCE= $(LD_BREDUCE:%=-Wl,%)
637 BSTATIC= $(LD_BSTATIC:%=-Wl,%)
642 LD_ZINITFIRST= -zinitfirst
643 LD_ZINTERPOSE= -zinterpose
644 LD_ZLAZYLOAD= -zlazyload
645 LD_ZLOADFLTR= -zloadfltr
647 LD_ZNODELETE= -znodelete
648 LD_ZNODLOPEN= -znodlopen
650 LD_ZNOLAZYLOAD= -znolazyload
651 LD_ZNOLDYNSYM= -znoldynsym
652 LD_ZNORELOC= -znoreloc
653 LD_ZNOVERSION= -znoversion
657 ZDEFS= $(LD_ZDEFS:%=-Wl,%)
658 ZDIRECT= $(LD_ZDIRECT:%=-Wl,%)
659 ZIGNORE= $(LD_ZIGNORE:%=-Wl,%)
660 ZINITFIRST= $(LD_ZINITFIRST:%=-Wl,%)
661 ZINTERPOSE= $(LD_ZINTERPOSE:%=-Wl,%)
662 ZLAZYLOAD= $(LD_ZLAZYLOAD:%=-Wl,%)
663 ZLOADFLTR= $(LD_ZLOADFLTR:%=-Wl,%)
664 ZNODEFS= $(LD_ZNODEFS:%=-Wl,%)
665 ZNODELETE= $(LD_ZNODELETE:%=-Wl,%)
666 ZNODLOPEN= $(LD_ZNODLOPEN:%=-Wl,%)
667 ZNODUMP= $(LD_ZNODUMP:%=-Wl,%)
668 ZNOLAZYLOAD= $(LD_ZNOLAZYLOAD:%=-Wl,%)
669 ZNOLDYNSYM= $(LD_ZNOLDYNSYM:%=-Wl,%)
670 NORELOC= $(LD_ZNORELOC:%=-Wl,%)
671 ZNOVERSION= $(LD_ZNOVERSION:%=-Wl,%)
672 ZRECORD= $(LD_ZRECORD:%=-Wl,%)
673 ZTEXT= $(LD_ZTEXT:%=-Wl,%)
677 # Handle different PIC models on different ISAs
678 # (May be overridden by lower-level Makefiles)
680 sparc_C_PICFLAGS = -fpic
681 sparcv9_C_PICFLAGS = -fpic
682 i386_C_PICFLAGS = -fpic
683 amd64_C_PICFLAGS = -fpic
684 C_PICFLAGS = $($(MACH)_C_PICFLAGS)
685 C_PICFLAGS64 = $($(MACH64)_C_PICFLAGS)
687 sparc_C_BIGPICFLAGS = -fPIC
688 sparcv9_C_BIGPICFLAGS = -fPIC
689 i386_C_BIGPICFLAGS = -fPIC
690 amd64_C_BIGPICFLAGS = -fPIC
691 C_BIGPICFLAGS = $($(MACH)_C_BIGPICFLAGS)
692 C_BIGPICFLAGS64 = $($(MACH64)_C_BIGPICFLAGS)
694 # CC requires there to be no space between '-K' and 'pic' or 'PIC'.
695 sparc_CC_PICFLAGS = -fpic
696 sparcv9_CC_PICFLAGS = -fPIC
697 i386_CC_PICFLAGS = -fpic
698 amd64_CC_PICFLAGS = -fpic
699 CC_PICFLAGS = $($(MACH)_CC_PICFLAGS)
700 CC_PICFLAGS64 = $($(MACH64)_CC_PICFLAGS)
706 # Default label for CTF sections
708 CTFCVTFLAGS= -i -L VERSION
711 # Override to pass module-specific flags to ctfmerge. Currently used only by
712 # krtld to turn on fuzzy matching, and source-level debugging to inhibit
717 CTFCONVERT_O = $(CTFCONVERT) $(CTFCVTFLAGS) $@
719 # Rules (normally from make.rules) and macros which are used for post
720 # processing files. Normally, these do stripping of the comment section
722 # RELEASE_CM: Should be editted to reflect the release.
723 # POST_PROCESS_O: Post-processing for `.o' files.
724 # POST_PROCESS_A: Post-processing for `.a' files (currently null).
725 # POST_PROCESS_SO: Post-processing for `.so' files.
726 # POST_PROCESS: Post-processing for executable files (no suffix).
727 # Note that these macros are not completely generalized as they are to be
728 # used with the file name to be processed following.
730 # It is left as an exercise to Release Engineering to embellish the generation
731 # of the release comment string.
733 # If this is a standard development build:
734 # compress the comment section (mcs -c)
735 # add the standard comment (mcs -a $(RELEASE_CM))
736 # add the development specific comment (mcs -a $(DEV_CM))
738 # If this is an installation build:
739 # delete the comment section (mcs -d)
740 # add the standard comment (mcs -a $(RELEASE_CM))
741 # add the development specific comment (mcs -a $(DEV_CM))
743 # If this is an release build:
744 # delete the comment section (mcs -d)
745 # add the standard comment (mcs -a $(RELEASE_CM))
747 # The following list of macros are used in the definition of RELEASE_CM
748 # which is used to label all binaries in the build:
750 # RELEASE Specific release of the build, eg: 5.2
751 # RELEASE_MAJOR Major version number part of $(RELEASE)
752 # RELEASE_MINOR Minor version number part of $(RELEASE)
753 # VERSION Version of the build (alpha, beta, Generic)
754 # PATCHID If this is a patch this value should contain
755 # the patchid value (eg: "Generic 100832-01"), otherwise
756 # it will be set to $(VERSION)
757 # RELEASE_DATE Date of the Release Build
758 # PATCH_DATE Date the patch was created, if this is blank it
759 # will default to the RELEASE_DATE
764 RELEASE= $(RELEASE_MAJOR).$(RELEASE_MINOR)
765 VERSION= $(SYSNAME) Development
767 RELEASE_DATE= release date not set
768 PATCH_DATE= $(RELEASE_DATE)
769 RELEASE_CM= "$(SYSNAME) $(RELEASE) $(PATCHID) $(PATCH_DATE)"
770 DEV_CM= "$(SYSNAME) Development: non-nightly build"
772 PROCESS_COMMENT= @?${MCS} -d -a $(RELEASE_CM) -a $(DEV_CM)
773 $(RELEASE_BUILD)PROCESS_COMMENT= @?${MCS} -d -a $(RELEASE_CM)
775 STRIP_STABS= $(STRIP) -x $@
776 $(SRCDBGBLD)STRIP_STABS= :
780 POST_PROCESS_SO= $(PROCESS_COMMENT) $@ ; $(STRIP_STABS) ; \
782 POST_PROCESS= $(PROCESS_COMMENT) $@ ; $(STRIP_STABS) ; \
786 # chk4ubin is a tool that inspects a module for a symbol table
787 # ELF section size which can trigger an OBP bug on older platforms.
788 # This problem affects only specific sun4u bootable modules.
790 CHK4UBIN= $(ONBLD_TOOLS)/bin/$(MACH)/chk4ubin
792 CHK4UBINARY= $(CHK4UBIN) $(CHK4UBINFLAGS) $@
795 # PKGARCHIVE specifies the default location where packages should be
798 PKGARCHIVE=$(SRC)/../../packages/$(MACH)/nightly
801 # The repositories will be created with these publisher settings. To
802 # update an image to the resulting repositories, this must match the
803 # publisher name provided to "pkg set-publisher."
805 PKGPUBLISHER= unleashed
807 # Default build rules which perform comment section post-processing.
810 $(LINK.c) -o $@ $< $(LDLIBS)
813 $(COMPILE.c) $(OUTPUT_OPTION) $< $(CTFCONVERT_HOOK)
816 $(COMPILE.c) -o $% $<
817 $(PROCESS_COMMENT) $%
818 $(AR) $(ARFLAGS) $@ $%
821 $(COMPILE.s) -o $@ $<
824 $(COMPILE.s) -o $% $<
825 $(PROCESS_COMMENT) $%
826 $(AR) $(ARFLAGS) $@ $%
829 $(LINK.cc) -o $@ $< $(LDLIBS)
832 $(COMPILE.cc) $(OUTPUT_OPTION) $<
835 $(COMPILE.cc) -o $% $<
836 $(AR) $(ARFLAGS) $@ $%
837 $(PROCESS_COMMENT) $%
841 $(LINK.c) -o $@ y.tab.c $(LDLIBS)
846 $(COMPILE.c) -o $@ y.tab.c $(CTFCONVERT_HOOK)
852 $(LINK.c) -o $@ $*.c -ll $(LDLIBS)
858 $(COMPILE.c) -o $@ $*.c $(CTFCONVERT_HOOK)
863 $(COMPILE.b) -o $@ $<
869 # Bourne and Korn shell script message catalog build rules.
870 # We extract all gettext strings with sed(1) (being careful to permit
871 # multiple gettext strings on the same line), weed out the dups, and
872 # build the catalogue with awk(1).
877 -e "s/.*gettext *\(\"[^\"]*\"\).*/\1/p" \
879 -e "s/\(.*\)gettext *\"[^\"]*\"\(.*\)/\1\2/" \
881 $< | sort -u | $(AWK) '{ print "msgid\t" $$0 "\nmsgstr" }' > $@
884 # Python and Perl executable and message catalog build rules.
886 .SUFFIXES: .pl .pm .py .pyc
890 $(SED) -e "s@TEXT_DOMAIN@\"$(TEXT_DOMAIN)\"@" $< > $@;
894 $(RM) $@; $(SED) -e "1s:^\#!@PYTHON@:\#!$(PYTHON):" < $< > $@; $(CHMOD) +x $@
898 $(PYTHON) -mpy_compile $<
899 @[ $(<)c = $@ ] || $(MV) $(<)c $@
902 $(XGETTEXT) $(XGETFLAGS) -d $(<F) $< ;
904 $(SED) "/^domain/d" < $(<F).po > $@ ;
908 # When using xgettext, we want messages to go to the default domain,
909 # rather than the specified one. This special version of the
910 # COMPILE.cpp macro effectively prevents expansion of TEXT_DOMAIN,
911 # causing xgettext to put all messages into the default domain.
913 CPPFORPO=$(COMPILE.cpp:\"$(TEXT_DOMAIN)\"=TEXT_DOMAIN)
923 $(CPPFORPO) y.tab.c > $@
928 $(CPPFORPO) lex.yy.c > $@
932 $(CPPFORPO) $< > $<.i
936 $(CPPFORPO) $< > $<.i
941 $(CPPFORPO) y.tab.c > $<.i
947 $(CPPFORPO) lex.yy.c > $<.i
952 # Rules to perform stylistic checks
954 .SUFFIXES: .x .xml .check .xmlchk