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 GNUC_ROOT= /opt/gcc/4.4.4
78 GCCLIBDIR= $(GNUC_ROOT)/lib
79 GCCLIBDIR64= $(GNUC_ROOT)/lib/$(MACH64)
81 DOCBOOK_XSL_ROOT= /usr/share/sgml/docbook/xsl-stylesheets
83 RPCGEN= /usr/bin/rpcgen
84 ELFEXTRACT= $(ONBLD_TOOLS)/bin/$(MACH)/elfextract
85 MBH_PATCH= $(SRCTOP)/tools/mbh_patch/obj/mbh_patch
86 BTXLD= $(ONBLD_TOOLS)/bin/$(MACH)/btxld
87 # echo(1) and true(1) are specified without absolute paths, so that the shell
88 # spawned by make(1) may use the built-in versions. This is minimally
89 # problematic, as the shell spawned by make(1) is known and under control, the
90 # only risk being if the shell falls back to $PATH.
92 # We specifically want an echo(1) that does interpolation of escape sequences,
93 # which ksh93, /bin/sh, and bash will all provide.
97 SYMLINK= /usr/bin/ln -s
100 CHMOD= /usr/bin/chmod
107 EGREP= /usr/bin/egrep
108 ELFWRAP= /usr/bin/elfwrap
109 KSH93= /usr/bin/ksh93
115 ELFDUMP= /usr/bin/elfdump
117 STRIP= /usr/bin/strip
122 CPP= $(GNUC_ROOT)/cpp
123 ANSI_CPP= $(GNUC_ROOT)/bin/cpp
124 CTFCONVERT= /usr/bin/ctfconvert
125 CTFDIFF= /usr/bin/ctfdiff
126 CTFMERGE= /usr/bin/ctfmerge
127 CTFSTABS= $(ONBLD_TOOLS)/bin/$(MACH)/ctfstabs
128 CTFSTRIP= $(ONBLD_TOOLS)/bin/$(MACH)/ctfstrip
129 NDRGEN= $(ONBLD_TOOLS)/bin/$(MACH)/ndrgen
130 GENOFFSETS= $(ONBLD_TOOLS)/bin/genoffsets
135 PERL_ARCH= i86pc-solaris-64int
136 PERL_ARCH64= i86pc-solaris-64
137 $(SPARC_BLD)PERL_ARCH= sun4-solaris-64int
138 $(SPARC_BLD)PERL_ARCH64= sun4-solaris-64
142 PYTHON= /usr/bin/python$(PYTHON_VERSION)
146 PYTHON3= /usr/bin/python$(PYTHON3_VERSION)
148 TOUCH= /usr/bin/touch
150 XARGS= /usr/bin/xargs
151 ELFEDIT= /usr/bin/elfedit
152 DTRACE= /usr/sbin/dtrace -xnolibs
155 ASTBINDIR= /usr/ast/bin
156 MSGCC= $(ASTBINDIR)/msgcc
157 MSGFMT= /usr/bin/msgfmt -s
162 # Declare that nothing should be built in parallel.
163 # Individual Makefiles can use the .PARALLEL target to declare otherwise.
166 # For stylistic checks
168 # Note that the X and C checks are not used at this time and may need
169 # modification when they are actually used.
171 CSTYLE= $(ONBLD_TOOLS)/bin/cstyle
173 HDRCHK= $(ONBLD_TOOLS)/bin/hdrchk
177 @$(ECHO) "checking $<"; $(CSTYLE) $< $(CSTYLE_TAIL); \
178 $(HDRCHK) $< $(HDRCHK_TAIL)
181 @$(ECHO) "checking $<"; $(RPCGEN) -C -h $< | $(CSTYLE) $(CSTYLE_TAIL); \
182 $(RPCGEN) -C -h $< | $(HDRCHK) $< $(HDRCHK_TAIL)
185 @$(ECHO) "checking $<"; $(CSTYLE) $< $(CSTYLE_TAIL)
188 @$(ECHO) "checking $<"; \
189 SVCCFG_DTD=$(SRC)/cmd/svc/dtd/service_bundle.dtd.1 \
190 SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/global.db \
191 SVCCFG_CONFIGD_PATH=$(SRC)/cmd/svc/configd/svc.configd-native \
192 $(SRC)/cmd/svc/svccfg/svccfg-native validate $<
194 INS.file= $(INS) -m $(FILEMODE) $< $@
195 INS.dir= $(INS) -d -m $(DIRMODE) $@
196 # installs and renames at once
198 INS.rename= $(INS.file)
202 INS.link= $(RM) $@; $(LN) $(INSLINKTARGET) $@
203 INS.symlink= $(RM) $@; $(SYMLINK) $(INSLINKTARGET) $@
206 # Python bakes the mtime of the .py file into the compiled .pyc and
207 # rebuilds if the baked-in mtime != the mtime of the source file
208 # (rather than only if it's less than), thus when installing python
209 # files we must make certain to not adjust the mtime of the source
212 INS.pyfile= $(RM) $@; $(SED) -e "1s:^\#!@PYTHON@:\#!$(PYTHON):" < $< > $@; $(CHMOD) $(FILEMODE) $@; $(TOUCH) -r $< $@
214 # MACH must be set in the shell environment per uname -p on the build host
215 # More specific architecture variables should be set in lower makefiles.
217 # MACH64 is derived from MACH, and BUILD64 is set to `#' for
218 # architectures on which we do not build 64-bit versions.
219 # (There are no such architectures at the moment.)
221 # Set BUILD64=# in the environment to disable 64-bit amd64
222 # builds on i386 machines.
224 MACH64_1= $(MACH:sparc=sparcv9)
225 MACH64= $(MACH64_1:i386=amd64)
227 MACH32_1= $(MACH:sparc=sparcv7)
228 MACH32= $(MACH32_1:i386=i386)
232 BUILD64= $($(MACH)_BUILD64)
235 # generate 32-bit addresses in the v9 kernel. Saves memory.
236 CCABS32= -fno-pic -mcmodel=medlow
238 # generate v9 code which tolerates callers using the v7 ABI, for the sake of
240 CC32BITCALLERS= -massume-32bit-callers
242 # GCC, especially, is increasingly beginning to auto-inline functions and
243 # sadly does so separately not under the general -fno-inline-functions
244 # Additionally, we wish to prevent optimisations which cause GCC to clone
245 # functions -- in particular, these may cause unhelpful symbols to be
246 # emitted instead of function names
247 CCNOAUTOINLINE= -fno-inline-small-functions \
248 -fno-inline-functions-called-once \
252 # compiler architecture flags.
254 sparc_XARCH= -m32 -mcpu=v8 -mno-v8plus
255 sparcv9_XARCH= -m64 -mcpu=v9
256 i386_XARCH= -m32 -march=pentiumpro
257 amd64_XARCH= -m64 -Ui386 -U__i386 -mtune=opteron
259 # assembler architecture flags. Different from compiler architecture flags.
260 sparc_AS_XARCH= -xarch=v8plus -Dsparc -D__sparc -D__sparcv8
261 sparcv9_AS_XARCH= -xarch=v9 -Dsparc -D__sparc -D__sparcv9
262 i386_AS_XARCH= -m32 -Di386 -D__i386
263 amd64_AS_XARCH= -m64 -Ui386 -U__i386 -D__x86_64 -D__amd64
266 # These flags define what we need to be 'standalone' i.e. -not- part
267 # of the rather more cosy userland environment. This basically means
270 # XX64 future versions of gcc will make -mcmodel=kernel imply -mno-red-zone
272 sparc_STAND_FLAGS= -ffreestanding
273 sparcv9_STAND_FLAGS= -ffreestanding
274 # Disabling MMX also disables 3DNow, disabling SSE also disables all later
275 # additions to SSE (SSE2, AVX ,etc.)
276 NO_SIMD= -mno-mmx -mno-sse
277 i386_STAND_FLAGS= -ffreestanding $(NO_SIMD)
278 amd64_STAND_FLAGS= -ffreestanding -mno-red-zone \
279 -mcmodel=kernel $(NO_SIMD)
281 SAVEARGS= -msave-args
282 amd64_STAND_FLAGS += $(SAVEARGS)
284 STAND_FLAGS_32 = $($(MACH)_STAND_FLAGS)
285 STAND_FLAGS_64 = $($(MACH64)_STAND_FLAGS)
288 # turn warnings into errors (C)
289 CERRWARN = -Wall -Wextra -Werror
291 CERRWARN += -Wno-missing-braces
292 CERRWARN += -Wno-sign-compare
293 CERRWARN += -Wno-unknown-pragmas
294 CERRWARN += -Wno-unused-parameter
295 CERRWARN += -Wno-missing-field-initializers
297 # Unfortunately, this option can misfire very easily and unfixably.
298 CERRWARN += -Wno-array-bounds
300 # DEBUG v. -nd make for frequent unused variables, empty conditions, etc. in
302 $(RELEASE_BUILD)CERRWARN += -Wno-unused
303 $(RELEASE_BUILD)CERRWARN += -Wno-empty-body
306 # turn warnings into errors (C++)
310 CSTD_GNU89= -std=gnu89
311 CSTD_GNU99= -std=gnu99
314 # In most places, assignments to these macros should be appended with +=
315 # (CPPFLAGS.first allows values to be prepended to CPPFLAGS).
316 sparc_CFLAGS= $(sparc_XARCH)
317 sparcv9_CFLAGS= $(sparcv9_XARCH)
318 i386_CFLAGS= $(i386_XARCH)
319 amd64_CFLAGS= $(amd64_XARCH)
321 sparc_ASFLAGS= $(sparc_AS_XARCH)
322 sparcv9_ASFLAGS=$(sparcv9_AS_XARCH)
323 i386_ASFLAGS= $(i386_AS_XARCH)
324 amd64_ASFLAGS= $(amd64_AS_XARCH)
327 sparc_COPTFLAG= -fno-strict-aliasing \
328 -fno-unit-at-a-time \
329 -fno-optimize-sibling-calls \
331 sparcv9_COPTFLAG= -fno-strict-aliasing \
332 -fno-unit-at-a-time \
333 -fno-optimize-sibling-calls \
336 amd64_COPTFLAG= -fno-strict-aliasing \
337 -fno-unit-at-a-time \
338 -fno-optimize-sibling-calls \
341 COPTFLAG= $($(MACH)_COPTFLAG)
342 COPTFLAG64= $($(MACH64)_COPTFLAG)
344 # Sometimes we want all symbols and types in debugging information even
345 # if they aren't used.
346 CALLSYMS= -fno-eliminate-unused-debug-symbols \
347 -fno-eliminate-unused-debug-types
350 # Flags used to build in debug mode for ctf generation. Bugs in the Devpro
351 # compilers currently prevent us from building with cc-emitted DWARF.
353 CTF_FLAGS_sparc = -g -Wc,-Qiselect-T1 $(CSTD) $(CDWARFSTR)
354 CTF_FLAGS_i386 = -g $(CSTD) $(CDWARFSTR)
356 CTF_FLAGS_sparcv9 = $(CTF_FLAGS_sparc)
357 CTF_FLAGS_amd64 = $(CTF_FLAGS_i386)
359 CTF_FLAGS_amd64 += $(SAVEARGS)
361 CTF_FLAGS_32 = $(CTF_FLAGS_$(MACH))
362 CTF_FLAGS_64 = $(CTF_FLAGS_$(MACH64))
363 CTF_FLAGS = $(CTF_FLAGS_32)
366 # Flags used with genoffsets
368 GOFLAGS = $(CALLSYMS) \
371 OFFSETS_CREATE = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \
372 $(CC) $(GOFLAGS) $(CFLAGS) $(CPPFLAGS)
374 OFFSETS_CREATE64 = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \
375 $(CC) $(GOFLAGS) $(CFLAGS64) $(CPPFLAGS)
377 sparc_XREGSFLAG = -mno-app-regs
378 sparcv9_XREGSFLAG = -mno-app-regs
382 XREGSFLAG = $($(MACH)_XREGSFLAG)
383 XREGSFLAG64 = $($(MACH64)_XREGSFLAG)
385 # dmake SOURCEDEBUG=yes ... enables source-level debugging information, and
386 # avoids stripping it.
387 SOURCEDEBUG = $(POUND_SIGN)
388 SRCDBGBLD = $(SOURCEDEBUG:yes=)
391 # These variables are intended ONLY for use by developers to safely pass extra
392 # flags to the compilers without unintentionally overriding Makefile-set
393 # flags. They should NEVER be set to any value in a Makefile.
395 # They come last in the associated FLAGS variable such that they can
396 # explicitly override things if necessary, there are gaps in this, but it's
397 # the best we can manage.
400 CUSERFLAGS64 = $(CUSERFLAGS)
402 CCUSERFLAGS64 = $(CCUSERFLAGS)
406 $(SRCDBGBLD)CSOURCEDEBUGFLAGS = -g
407 $(SRCDBGBLD)CCSOURCEDEBUGFLAGS = -g
409 CFLAGS= $(COPTFLAG) $($(MACH)_CFLAGS) \
410 $(CERRWARN) $(CSTD) \
411 $(CCNOAUTOINLINE) $(CSOURCEDEBUGFLAGS) \
413 CFLAGS64= $(COPTFLAG64) $($(MACH64)_CFLAGS) \
414 $(CERRWARN) $(CSTD) \
415 $(CCNOAUTOINLINE) $(CSOURCEDEBUGFLAGS) \
419 # Flags that are used to build parts of the code that are subsequently
420 # run on the build machine (also known as the NATIVE_BUILD).
422 NATIVE_CFLAGS= $(COPTFLAG) $($(NATIVE_MACH)_CFLAGS) \
423 $(CERRWARN) $(CSTD) \
425 $(CSOURCEDEBUGFLAGS) $(CUSERFLAGS)
427 DTEXTDOM=-DTEXT_DOMAIN=\"$(TEXT_DOMAIN)\" # For messaging.
428 CPPFLAGS.first= # Please keep empty. Only lower makefiles should set this.
429 CPPFLAGS.master=$(DTEXTDOM) \
430 $(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4) \
431 $(ADJUNCT_PROTO:%=-I%/usr/include)
432 CPPFLAGS.native=$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) \
433 $(ENVCPPFLAGS4) -I$(NATIVE_ADJUNCT)/include
434 CPPFLAGS= $(CPPFLAGS.first) $(CPPFLAGS.master)
435 AS_CPPFLAGS= $(CPPFLAGS.first) $(CPPFLAGS.master)
438 # For source message catalogue
440 .SUFFIXES: $(SUFFIXES) .i .po
441 MSGROOT= $(ROOT)/catalog
442 MSGDOMAIN= $(MSGROOT)/$(TEXT_DOMAIN)
443 MSGDOMAINPOFILE = $(MSGDOMAIN)/$(POFILE)
444 DCMSGDOMAIN= $(MSGROOT)/LC_TIME/$(TEXT_DOMAIN)
445 DCMSGDOMAINPOFILE = $(DCMSGDOMAIN)/$(DCFILE:.dc=.po)
447 CLOBBERFILES += $(POFILE) $(POFILES)
448 COMPILE.cpp= $(CC) -xc -E -C $(CFLAGS) $(CPPFLAGS)
449 XGETTEXT= /usr/bin/xgettext
450 XGETFLAGS= -c TRANSLATION_NOTE
451 BUILD.po= $(XGETTEXT) $(XGETFLAGS) -d $(<F) $<.i ;\
453 $(SED) "/^domain/d" < $(<F).po > $@ ;\
457 # This is overwritten by local Makefile when PROG is a list.
461 sparc_CCFLAGS= -m32 mcpu=v8 mno-v8plus \
464 sparcv9_CCFLAGS= $(sparcv9_XARCH) \
466 i386_CCFLAGS= $(CCERRWARN)
467 amd64_CCFLAGS= $(amd64_XARCH) \
471 sparcv9_CCOPTFLAG= -O
475 CCOPTFLAG= $($(MACH)_CCOPTFLAG)
476 CCOPTFLAG64= $($(MACH64)_CCOPTFLAG)
477 CCFLAGS= $(CCOPTFLAG) $($(MACH)_CCFLAGS) $(CCSOURCEDEBUGFLAGS) \
479 CCFLAGS64= $(CCOPTFLAG64) $($(MACH64)_CCFLAGS) $(CCSOURCEDEBUGFLAGS) \
486 ELFWRAP_FLAGS64 = -64
489 # Various mapfiles that are used throughout the build, and delivered to
492 MAPFILE.PGA = $(SRC)/common/mapfiles/common/map.pagealign
493 MAPFILE.FLT = $(SRC)/common/mapfiles/common/map.filter
494 MAPFILE.LEX = $(SRC)/common/mapfiles/common/map.lex.yy
497 # Generated mapfiles that are compiler specific, and used throughout the
498 # build. These mapfiles are not delivered in /usr/lib/ld.
500 MAPFILE.NGB_sparc= $(SRC)/common/mapfiles/gen/sparc_gcc_map.noexeglobs
501 MAPFILE.NGB_sparcv9= $(SRC)/common/mapfiles/gen/sparcv9_gcc_map.noexeglobs
502 MAPFILE.NGB_i386= $(SRC)/common/mapfiles/gen/i386_gcc_map.noexeglobs
503 MAPFILE.NGB_amd64= $(SRC)/common/mapfiles/gen/amd64_gcc_map.noexeglobs
504 MAPFILE.NGB = $(MAPFILE.NGB_$(MACH))
507 # A generic interface mapfile name, used by various dynamic objects to define
508 # the interfaces and interposers the object must export.
510 MAPFILE.INT = mapfile-intf
513 # LDLIBS32 and LDLIBS64 can be set in the environment to override the following
516 LDLIBS32 = $(ENVLDLIBS1) $(ENVLDLIBS2) $(ENVLDLIBS3)
517 LDLIBS32 += $(ADJUNCT_PROTO:%=-L%/usr/lib -L%/lib)
518 LDLIBS.cmd = $(LDLIBS32)
519 LDLIBS.lib = $(LDLIBS32)
521 LDLIBS64 = $(ENVLDLIBS1:%=%/$(MACH64)) \
522 $(ENVLDLIBS2:%=%/$(MACH64)) \
523 $(ENVLDLIBS3:%=%/$(MACH64))
524 LDLIBS64 += $(ADJUNCT_PROTO:%=-L%/usr/lib/$(MACH64) -L%/lib/$(MACH64))
527 # Define compilation macros.
529 COMPILE.c= $(CC) $(CFLAGS) $(CPPFLAGS) -c
530 COMPILE64.c= $(CC) $(CFLAGS64) $(CPPFLAGS) -c
531 COMPILE.cc= $(CCC) $(CCFLAGS) $(CPPFLAGS) -c
532 COMPILE64.cc= $(CCC) $(CCFLAGS64) $(CPPFLAGS) -c
533 COMPILE.s= $(AS) $(ASFLAGS) $(AS_CPPFLAGS)
534 COMPILE64.s= $(AS) $(ASFLAGS) $($(MACH64)_AS_XARCH) $(AS_CPPFLAGS)
535 COMPILE.d= $(DTRACE) -G -32
536 COMPILE64.d= $(DTRACE) -G -64
537 COMPILE.b= $(ELFWRAP) $(ELFWRAP_FLAGS$(CLASS))
538 COMPILE64.b= $(ELFWRAP) $(ELFWRAP_FLAGS$(CLASS))
543 CCNEEDED = -L$(GCCLIBDIR) -lstdc++ -lgcc_s
544 CCEXTNEEDED = $(CCNEEDED)
546 LINK.c= $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
547 LINK64.c= $(CC) $(CFLAGS64) $(CPPFLAGS) $(LDFLAGS)
548 LINK.cc= $(CCC) $(CCFLAGS) $(CPPFLAGS) \
549 $(LDFLAGS) $(CCNEEDED)
550 LINK64.cc= $(CCC) $(CCFLAGS64) $(CPPFLAGS) \
551 $(LDFLAGS) $(CCNEEDED)
555 # For some future builds, NATIVE_MACH and MACH might be different.
556 # Therefore, NATIVE_MACH needs to be redefined in the
557 # environment as `uname -p` to override this macro.
559 # For now at least, we cross-compile amd64 on i386 machines.
560 NATIVE_MACH= $(MACH:amd64=i386)
562 # Define native compilation macros
565 # Base directory where compilers are located.
566 # Defined here so it can be overridden by developers.
570 BASIC_CC_ARGS= -fident \
572 -fno-inline-functions \
575 -fdiagnostics-show-option \
578 # The SPARC ldd and std instructions require 8-byte alignment of their
579 # address operand. gcc correctly uses them only when the ABI requires
580 # 8-byte alignment; unfortunately we have a number of pieces of buggy code
581 # that does not conform to the ABI. This flag makes gcc work more like
582 # Studio with -xmemalign=4.
583 $(SPARC_BLD)BASIC_CC_ARGS += mno-integer-ldd-std
585 BASIC_CC_ARGS += -D__sun
587 BASIC_AS_ARGS= -x assembler-with-cpp \
590 -Wa,--fatal-warnings \
591 -Wa,--traditional-format \
594 # Specify platform compiler versions for languages
595 # that we use (currently only c and c++).
597 sparc_CC= /usr/libexec/unleashed/gcc-wrap $(GNUC_ROOT)/bin/gcc $(BASIC_CC_ARGS)
598 sparc_CCC= /usr/libexec/unleashed/gcc-wrap $(GNUC_ROOT)/bin/g++ $(BASIC_CC_ARGS)
599 sparc_CPP= $(GNUC_ROOT)/bin/cpp
600 sparc_AS= /usr/bin/as -xregsym=no
601 sparc_LD= /usr/bin/ld
603 sparcv9_CC= /usr/libexec/unleashed/gcc-wrap $(GNUC_ROOT)/bin/gcc $(BASIC_CC_ARGS)
604 sparcv9_CCC= /usr/libexec/unleashed/gcc-wrap $(GNUC_ROOT)/bin/g++ $(BASIC_CC_ARGS)
605 sparcv9_CPP= $(GNUC_ROOT)/bin/cpp
606 sparcv9_AS= /usr/bin/as -xregsym=no
607 sparcv9_LD= /usr/bin/ld
609 i386_CC= /usr/libexec/unleashed/gcc-wrap $(GNUC_ROOT)/bin/gcc $(BASIC_CC_ARGS)
610 i386_CCC= /usr/libexec/unleashed/gcc-wrap $(GNUC_ROOT)/bin/g++ $(BASIC_CC_ARGS)
611 i386_CPP= $(GNUC_ROOT)/bin/cpp
612 i386_AS= $(GNUC_ROOT)/bin/gcc $(BASIC_AS_ARGS)
615 amd64_CC= /usr/libexec/unleashed/gcc-wrap $(GNUC_ROOT)/bin/gcc $(BASIC_CC_ARGS)
616 amd64_CCC= /usr/libexec/unleashed/gcc-wrap $(GNUC_ROOT)/bin/g++ $(BASIC_CC_ARGS)
617 amd64_CPP= $(GNUC_ROOT)/bin/cpp
618 amd64_AS= $(GNUC_ROOT)/bin/gcc $(BASIC_AS_ARGS)
619 amd64_LD= /usr/bin/ld
621 NATIVECC= $($(NATIVE_MACH)_CC)
622 NATIVECCC= $($(NATIVE_MACH)_CCC)
623 NATIVECPP= $($(NATIVE_MACH)_CPP)
624 NATIVEAS= $($(NATIVE_MACH)_AS)
625 NATIVELD= $($(NATIVE_MACH)_LD)
628 # Makefile.master.64 overrides these settings
639 LD_BDYNAMIC= -Bdynamic
641 LD_BNODIRECT= -Bnodirect
645 BDIRECT= $(LD_BDIRECT:%=-Wl,%)
646 BDYNAMIC= $(LD_BDYNAMIC:%=-Wl,%)
647 BLOCAL= $(LD_BLOCAL:%=-Wl,%)
648 BNODIRECT= $(LD_BNODIRECT:%=-Wl,%)
649 BREDUCE= $(LD_BREDUCE:%=-Wl,%)
650 BSTATIC= $(LD_BSTATIC:%=-Wl,%)
655 LD_ZINITFIRST= -zinitfirst
656 LD_ZINTERPOSE= -zinterpose
657 LD_ZLAZYLOAD= -zlazyload
658 LD_ZLOADFLTR= -zloadfltr
660 LD_ZNODELETE= -znodelete
661 LD_ZNODLOPEN= -znodlopen
663 LD_ZNOLAZYLOAD= -znolazyload
664 LD_ZNOLDYNSYM= -znoldynsym
665 LD_ZNORELOC= -znoreloc
666 LD_ZNOVERSION= -znoversion
670 ZDEFS= $(LD_ZDEFS:%=-Wl,%)
671 ZDIRECT= $(LD_ZDIRECT:%=-Wl,%)
672 ZIGNORE= $(LD_ZIGNORE:%=-Wl,%)
673 ZINITFIRST= $(LD_ZINITFIRST:%=-Wl,%)
674 ZINTERPOSE= $(LD_ZINTERPOSE:%=-Wl,%)
675 ZLAZYLOAD= $(LD_ZLAZYLOAD:%=-Wl,%)
676 ZLOADFLTR= $(LD_ZLOADFLTR:%=-Wl,%)
677 ZNODEFS= $(LD_ZNODEFS:%=-Wl,%)
678 ZNODELETE= $(LD_ZNODELETE:%=-Wl,%)
679 ZNODLOPEN= $(LD_ZNODLOPEN:%=-Wl,%)
680 ZNODUMP= $(LD_ZNODUMP:%=-Wl,%)
681 ZNOLAZYLOAD= $(LD_ZNOLAZYLOAD:%=-Wl,%)
682 ZNOLDYNSYM= $(LD_ZNOLDYNSYM:%=-Wl,%)
683 NORELOC= $(LD_ZNORELOC:%=-Wl,%)
684 ZNOVERSION= $(LD_ZNOVERSION:%=-Wl,%)
685 ZRECORD= $(LD_ZRECORD:%=-Wl,%)
686 ZTEXT= $(LD_ZTEXT:%=-Wl,%)
690 # Handle different PIC models on different ISAs
691 # (May be overridden by lower-level Makefiles)
693 sparc_C_PICFLAGS = -fpic
694 sparcv9_C_PICFLAGS = -fpic
695 i386_C_PICFLAGS = -fpic
696 amd64_C_PICFLAGS = -fpic
697 C_PICFLAGS = $($(MACH)_C_PICFLAGS)
698 C_PICFLAGS64 = $($(MACH64)_C_PICFLAGS)
700 sparc_C_BIGPICFLAGS = -fPIC
701 sparcv9_C_BIGPICFLAGS = -fPIC
702 i386_C_BIGPICFLAGS = -fPIC
703 amd64_C_BIGPICFLAGS = -fPIC
704 C_BIGPICFLAGS = $($(MACH)_C_BIGPICFLAGS)
705 C_BIGPICFLAGS64 = $($(MACH64)_C_BIGPICFLAGS)
707 # CC requires there to be no space between '-K' and 'pic' or 'PIC'.
708 sparc_CC_PICFLAGS = -fpic
709 sparcv9_CC_PICFLAGS = -fPIC
710 i386_CC_PICFLAGS = -fpic
711 amd64_CC_PICFLAGS = -fpic
712 CC_PICFLAGS = $($(MACH)_CC_PICFLAGS)
713 CC_PICFLAGS64 = $($(MACH64)_CC_PICFLAGS)
719 # Default label for CTF sections
721 CTFCVTFLAGS= -i -L VERSION
724 # Override to pass module-specific flags to ctfmerge. Currently used only by
725 # krtld to turn on fuzzy matching, and source-level debugging to inhibit
730 CTFCONVERT_O = $(CTFCONVERT) $(CTFCVTFLAGS) $@
732 # Rules (normally from make.rules) and macros which are used for post
733 # processing files. Normally, these do stripping of the comment section
735 # RELEASE_CM: Should be editted to reflect the release.
736 # POST_PROCESS_O: Post-processing for `.o' files.
737 # POST_PROCESS_A: Post-processing for `.a' files (currently null).
738 # POST_PROCESS_SO: Post-processing for `.so' files.
739 # POST_PROCESS: Post-processing for executable files (no suffix).
740 # Note that these macros are not completely generalized as they are to be
741 # used with the file name to be processed following.
743 # It is left as an exercise to Release Engineering to embellish the generation
744 # of the release comment string.
746 # If this is a standard development build:
747 # compress the comment section (mcs -c)
748 # add the standard comment (mcs -a $(RELEASE_CM))
749 # add the development specific comment (mcs -a $(DEV_CM))
751 # If this is an installation build:
752 # delete the comment section (mcs -d)
753 # add the standard comment (mcs -a $(RELEASE_CM))
754 # add the development specific comment (mcs -a $(DEV_CM))
756 # If this is an release build:
757 # delete the comment section (mcs -d)
758 # add the standard comment (mcs -a $(RELEASE_CM))
760 # The following list of macros are used in the definition of RELEASE_CM
761 # which is used to label all binaries in the build:
763 # RELEASE Specific release of the build, eg: 5.2
764 # RELEASE_MAJOR Major version number part of $(RELEASE)
765 # RELEASE_MINOR Minor version number part of $(RELEASE)
766 # VERSION Version of the build (alpha, beta, Generic)
767 # PATCHID If this is a patch this value should contain
768 # the patchid value (eg: "Generic 100832-01"), otherwise
769 # it will be set to $(VERSION)
770 # RELEASE_DATE Date of the Release Build
771 # PATCH_DATE Date the patch was created, if this is blank it
772 # will default to the RELEASE_DATE
777 RELEASE= $(RELEASE_MAJOR).$(RELEASE_MINOR)
778 VERSION= $(SYSNAME) Development
780 RELEASE_DATE= release date not set
781 PATCH_DATE= $(RELEASE_DATE)
782 RELEASE_CM= "$(SYSNAME) $(RELEASE) $(PATCHID) $(PATCH_DATE)"
783 DEV_CM= "$(SYSNAME) Development: non-nightly build"
785 STRIP_STABS= $(STRIP) -x $@
786 $(SRCDBGBLD)STRIP_STABS= :
790 POST_PROCESS_SO= $(STRIP_STABS)
791 POST_PROCESS= $(STRIP_STABS)
794 # PKGARCHIVE specifies the default location where packages should be
797 PKGARCHIVE=$(SRC)/../../packages/$(MACH)/nightly
800 # The repositories will be created with these publisher settings. To
801 # update an image to the resulting repositories, this must match the
802 # publisher name provided to "pkg set-publisher."
804 PKGPUBLISHER= unleashed
806 # Default build rules which perform comment section post-processing.
809 $(LINK.c) -o $@ $< $(LDLIBS)
812 $(COMPILE.c) $(OUTPUT_OPTION) $< $(CTFCONVERT_HOOK)
815 $(COMPILE.c) -o $% $<
816 $(AR) $(ARFLAGS) $@ $%
819 $(COMPILE.s) -o $@ $<
822 $(COMPILE.s) -o $% $<
823 $(AR) $(ARFLAGS) $@ $%
826 $(LINK.cc) -o $@ $< $(LDLIBS)
829 $(COMPILE.cc) $(OUTPUT_OPTION) $<
832 $(COMPILE.cc) -o $% $<
833 $(AR) $(ARFLAGS) $@ $%
837 $(LINK.c) -o $@ y.tab.c $(LDLIBS)
842 $(COMPILE.c) -o $@ y.tab.c $(CTFCONVERT_HOOK)
848 $(LINK.c) -o $@ $*.c -ll $(LDLIBS)
854 $(COMPILE.c) -o $@ $*.c $(CTFCONVERT_HOOK)
859 $(COMPILE.b) -o $@ $<
865 # Bourne and Korn shell script message catalog build rules.
866 # We extract all gettext strings with sed(1) (being careful to permit
867 # multiple gettext strings on the same line), weed out the dups, and
868 # build the catalogue with awk(1).
873 -e "s/.*gettext *\(\"[^\"]*\"\).*/\1/p" \
875 -e "s/\(.*\)gettext *\"[^\"]*\"\(.*\)/\1\2/" \
877 $< | sort -u | $(AWK) '{ print "msgid\t" $$0 "\nmsgstr" }' > $@
880 # Python and Perl executable and message catalog build rules.
882 .SUFFIXES: .pl .pm .py .pyc
886 $(SED) -e "s@TEXT_DOMAIN@\"$(TEXT_DOMAIN)\"@" $< > $@;
890 $(RM) $@; $(SED) -e "1s:^\#!@PYTHON@:\#!$(PYTHON):" < $< > $@; $(CHMOD) +x $@
894 $(PYTHON) -mpy_compile $<
895 @[ $(<)c = $@ ] || $(MV) $(<)c $@
898 $(XGETTEXT) $(XGETFLAGS) -d $(<F) $< ;
900 $(SED) "/^domain/d" < $(<F).po > $@ ;
904 # When using xgettext, we want messages to go to the default domain,
905 # rather than the specified one. This special version of the
906 # COMPILE.cpp macro effectively prevents expansion of TEXT_DOMAIN,
907 # causing xgettext to put all messages into the default domain.
909 CPPFORPO=$(COMPILE.cpp:\"$(TEXT_DOMAIN)\"=TEXT_DOMAIN)
919 $(CPPFORPO) y.tab.c > $@
924 $(CPPFORPO) lex.yy.c > $@
928 $(CPPFORPO) $< > $<.i
932 $(CPPFORPO) $< > $<.i
937 $(CPPFORPO) y.tab.c > $<.i
943 $(CPPFORPO) lex.yy.c > $<.i
948 # Rules to perform stylistic checks
950 .SUFFIXES: .x .xml .check .xmlchk