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 ksh, /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
114 ELFDUMP= /usr/bin/elfdump
116 STRIP= /usr/bin/strip
121 CPP= $(GNUC_ROOT)/cpp
122 ANSI_CPP= $(GNUC_ROOT)/bin/cpp
123 CTFCONVERT= /usr/bin/ctfconvert
124 CTFDIFF= /usr/bin/ctfdiff
125 CTFMERGE= /usr/bin/ctfmerge
126 CTFSTABS= $(ONBLD_TOOLS)/bin/$(MACH)/ctfstabs
127 CTFSTRIP= $(ONBLD_TOOLS)/bin/$(MACH)/ctfstrip
128 NDRGEN= $(ONBLD_TOOLS)/bin/$(MACH)/ndrgen
129 GENOFFSETS= $(ONBLD_TOOLS)/bin/genoffsets
134 PERL_ARCH= i86pc-solaris-64int
135 PERL_ARCH64= i86pc-solaris-64
136 $(SPARC_BLD)PERL_ARCH= sun4-solaris-64int
137 $(SPARC_BLD)PERL_ARCH64= sun4-solaris-64
141 PYTHON= /usr/bin/python$(PYTHON_VERSION)
145 PYTHON3= /usr/bin/python$(PYTHON3_VERSION)
147 TOUCH= /usr/bin/touch
149 XARGS= /usr/bin/xargs
150 ELFEDIT= /usr/bin/elfedit
151 DTRACE= /usr/sbin/dtrace -xnolibs
154 ASTBINDIR= /usr/ast/bin
155 MSGCC= $(ASTBINDIR)/msgcc
156 MSGFMT= /usr/bin/msgfmt -s
161 # Declare that nothing should be built in parallel.
162 # Individual Makefiles can use the .PARALLEL target to declare otherwise.
165 # For stylistic checks
167 # Note that the X and C checks are not used at this time and may need
168 # modification when they are actually used.
170 CSTYLE= $(ONBLD_TOOLS)/bin/cstyle
172 HDRCHK= $(ONBLD_TOOLS)/bin/hdrchk
176 @$(ECHO) "checking $<"; $(CSTYLE) $< $(CSTYLE_TAIL); \
177 $(HDRCHK) $< $(HDRCHK_TAIL)
180 @$(ECHO) "checking $<"; $(RPCGEN) -C -h $< | $(CSTYLE) $(CSTYLE_TAIL); \
181 $(RPCGEN) -C -h $< | $(HDRCHK) $< $(HDRCHK_TAIL)
184 @$(ECHO) "checking $<"; $(CSTYLE) $< $(CSTYLE_TAIL)
187 @$(ECHO) "checking $<"; \
188 SVCCFG_DTD=$(SRC)/cmd/svc/dtd/service_bundle.dtd.1 \
189 SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/global.db \
190 SVCCFG_CONFIGD_PATH=$(SRC)/cmd/svc/configd/svc.configd-native \
191 $(SRC)/cmd/svc/svccfg/svccfg-native validate $<
193 INS.file= $(INS) -m $(FILEMODE) $< $@
194 INS.dir= $(INS) -d -m $(DIRMODE) $@
195 # installs and renames at once
197 INS.rename= $(INS.file)
201 INS.link= $(RM) $@; $(LN) $(INSLINKTARGET) $@
202 INS.symlink= $(RM) $@; $(SYMLINK) $(INSLINKTARGET) $@
204 # The path to python that will be used for the shebang line when installing
205 # python scripts to the proto area. This is overridden by makefiles to
206 # select to the correct version.
210 # Python bakes the mtime of the .py file into the compiled .pyc and
211 # rebuilds if the baked-in mtime != the mtime of the source file
212 # (rather than only if it's less than), thus when installing python
213 # files we must make certain to not adjust the mtime of the source
216 INS.pyfile= $(RM) $@; $(SED) -e "1s:^\#!@PYTHON@:\#!$(PYSHEBANG):" < $< > $@; $(CHMOD) $(FILEMODE) $@; $(TOUCH) -r $< $@
218 # MACH must be set in the shell environment per uname -p on the build host
219 # More specific architecture variables should be set in lower makefiles.
221 # MACH64 is derived from MACH, and BUILD64 is set to `#' for
222 # architectures on which we do not build 64-bit versions.
223 # (There are no such architectures at the moment.)
225 # Set BUILD64=# in the environment to disable 64-bit amd64
226 # builds on i386 machines.
228 MACH64_1= $(MACH:sparc=sparcv9)
229 MACH64= $(MACH64_1:i386=amd64)
231 MACH32_1= $(MACH:sparc=sparcv7)
232 MACH32= $(MACH32_1:i386=i386)
236 BUILD64= $($(MACH)_BUILD64)
239 # generate 32-bit addresses in the v9 kernel. Saves memory.
240 CCABS32= -fno-pic -mcmodel=medlow
242 # generate v9 code which tolerates callers using the v7 ABI, for the sake of
244 CC32BITCALLERS= -massume-32bit-callers
246 # GCC, especially, is increasingly beginning to auto-inline functions and
247 # sadly does so separately not under the general -fno-inline-functions
248 # Additionally, we wish to prevent optimisations which cause GCC to clone
249 # functions -- in particular, these may cause unhelpful symbols to be
250 # emitted instead of function names
251 CCNOAUTOINLINE= -fno-inline-small-functions \
252 -fno-inline-functions-called-once \
256 # compiler architecture flags.
258 sparc_XARCH= -m32 -mcpu=v8 -mno-v8plus
259 sparcv9_XARCH= -m64 -mcpu=v9
260 i386_XARCH= -m32 -march=pentiumpro
261 amd64_XARCH= -m64 -Ui386 -U__i386 -mtune=opteron
263 # assembler architecture flags. Different from compiler architecture flags.
264 sparc_AS_XARCH= -xarch=v8plus -Dsparc -D__sparc -D__sparcv8
265 sparcv9_AS_XARCH= -xarch=v9 -Dsparc -D__sparc -D__sparcv9
266 i386_AS_XARCH= -m32 -Di386 -D__i386
267 amd64_AS_XARCH= -m64 -Ui386 -U__i386 -D__x86_64 -D__amd64
270 # These flags define what we need to be 'standalone' i.e. -not- part
271 # of the rather more cosy userland environment. This basically means
274 # XX64 future versions of gcc will make -mcmodel=kernel imply -mno-red-zone
276 sparc_STAND_FLAGS= -ffreestanding
277 sparcv9_STAND_FLAGS= -ffreestanding
278 # Disabling MMX also disables 3DNow, disabling SSE also disables all later
279 # additions to SSE (SSE2, AVX ,etc.)
280 NO_SIMD= -mno-mmx -mno-sse
281 i386_STAND_FLAGS= -ffreestanding $(NO_SIMD)
282 amd64_STAND_FLAGS= -ffreestanding -mno-red-zone \
283 -mcmodel=kernel $(NO_SIMD)
285 SAVEARGS= -msave-args
286 amd64_STAND_FLAGS += $(SAVEARGS)
288 STAND_FLAGS_32 = $($(MACH)_STAND_FLAGS)
289 STAND_FLAGS_64 = $($(MACH64)_STAND_FLAGS)
292 # turn warnings into errors (C)
293 CERRWARN = -Wall -Wextra -Werror
295 CERRWARN += -Wno-missing-braces
296 CERRWARN += -Wno-sign-compare
297 CERRWARN += -Wno-unknown-pragmas
298 CERRWARN += -Wno-unused-parameter
299 CERRWARN += -Wno-missing-field-initializers
301 # Unfortunately, this option can misfire very easily and unfixably.
302 CERRWARN += -Wno-array-bounds
304 # DEBUG v. -nd make for frequent unused variables, empty conditions, etc. in
306 $(RELEASE_BUILD)CERRWARN += -Wno-unused
307 $(RELEASE_BUILD)CERRWARN += -Wno-empty-body
310 # turn warnings into errors (C++)
314 CSTD_GNU89= -std=gnu89
315 CSTD_GNU99= -std=gnu99
318 # In most places, assignments to these macros should be appended with +=
319 # (CPPFLAGS.first allows values to be prepended to CPPFLAGS).
320 sparc_CFLAGS= $(sparc_XARCH)
321 sparcv9_CFLAGS= $(sparcv9_XARCH)
322 i386_CFLAGS= $(i386_XARCH)
323 amd64_CFLAGS= $(amd64_XARCH)
325 sparc_ASFLAGS= $(sparc_AS_XARCH)
326 sparcv9_ASFLAGS=$(sparcv9_AS_XARCH)
327 i386_ASFLAGS= $(i386_AS_XARCH)
328 amd64_ASFLAGS= $(amd64_AS_XARCH)
331 sparc_COPTFLAG= -fno-strict-aliasing \
332 -fno-unit-at-a-time \
333 -fno-optimize-sibling-calls \
335 sparcv9_COPTFLAG= -fno-strict-aliasing \
336 -fno-unit-at-a-time \
337 -fno-optimize-sibling-calls \
340 amd64_COPTFLAG= -fno-strict-aliasing \
341 -fno-unit-at-a-time \
342 -fno-optimize-sibling-calls \
345 COPTFLAG= $($(MACH)_COPTFLAG)
346 COPTFLAG64= $($(MACH64)_COPTFLAG)
348 # Sometimes we want all symbols and types in debugging information even
349 # if they aren't used.
350 CALLSYMS= -fno-eliminate-unused-debug-symbols \
351 -fno-eliminate-unused-debug-types
354 # Flags used to build in debug mode for ctf generation. Bugs in the Devpro
355 # compilers currently prevent us from building with cc-emitted DWARF.
357 CTF_FLAGS_sparc = -g -Wc,-Qiselect-T1 $(CSTD) $(CDWARFSTR)
358 CTF_FLAGS_i386 = -g $(CSTD) $(CDWARFSTR)
360 CTF_FLAGS_sparcv9 = $(CTF_FLAGS_sparc)
361 CTF_FLAGS_amd64 = $(CTF_FLAGS_i386)
363 CTF_FLAGS_amd64 += $(SAVEARGS)
365 CTF_FLAGS_32 = $(CTF_FLAGS_$(MACH))
366 CTF_FLAGS_64 = $(CTF_FLAGS_$(MACH64))
367 CTF_FLAGS = $(CTF_FLAGS_32)
370 # Flags used with genoffsets
372 GOFLAGS = $(CALLSYMS) \
375 OFFSETS_CREATE = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \
376 $(CC) $(GOFLAGS) $(CFLAGS) $(CPPFLAGS)
378 OFFSETS_CREATE64 = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \
379 $(CC) $(GOFLAGS) $(CFLAGS64) $(CPPFLAGS)
381 sparc_XREGSFLAG = -mno-app-regs
382 sparcv9_XREGSFLAG = -mno-app-regs
386 XREGSFLAG = $($(MACH)_XREGSFLAG)
387 XREGSFLAG64 = $($(MACH64)_XREGSFLAG)
389 # dmake SOURCEDEBUG=yes ... enables source-level debugging information, and
390 # avoids stripping it.
391 SOURCEDEBUG = $(POUND_SIGN)
392 SRCDBGBLD = $(SOURCEDEBUG:yes=)
395 # These variables are intended ONLY for use by developers to safely pass extra
396 # flags to the compilers without unintentionally overriding Makefile-set
397 # flags. They should NEVER be set to any value in a Makefile.
399 # They come last in the associated FLAGS variable such that they can
400 # explicitly override things if necessary, there are gaps in this, but it's
401 # the best we can manage.
404 CUSERFLAGS64 = $(CUSERFLAGS)
406 CCUSERFLAGS64 = $(CCUSERFLAGS)
410 $(SRCDBGBLD)CSOURCEDEBUGFLAGS = -g
411 $(SRCDBGBLD)CCSOURCEDEBUGFLAGS = -g
413 CFLAGS= $(COPTFLAG) $($(MACH)_CFLAGS) \
414 $(CERRWARN) $(CSTD) \
415 $(CCNOAUTOINLINE) $(CSOURCEDEBUGFLAGS) \
417 CFLAGS64= $(COPTFLAG64) $($(MACH64)_CFLAGS) \
418 $(CERRWARN) $(CSTD) \
419 $(CCNOAUTOINLINE) $(CSOURCEDEBUGFLAGS) \
423 # Flags that are used to build parts of the code that are subsequently
424 # run on the build machine (also known as the NATIVE_BUILD).
426 NATIVE_CFLAGS= $(COPTFLAG) $($(NATIVE_MACH)_CFLAGS) \
427 $(CERRWARN) $(CSTD) \
429 $(CSOURCEDEBUGFLAGS) $(CUSERFLAGS)
431 DTEXTDOM=-DTEXT_DOMAIN=\"$(TEXT_DOMAIN)\" # For messaging.
432 CPPFLAGS.first= # Please keep empty. Only lower makefiles should set this.
433 CPPFLAGS.master=$(DTEXTDOM) \
434 $(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4) \
435 $(ADJUNCT_PROTO:%=-I%/usr/include)
436 CPPFLAGS.native=$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) \
437 $(ENVCPPFLAGS4) -I$(NATIVE_ADJUNCT)/include
438 CPPFLAGS= $(CPPFLAGS.first) $(CPPFLAGS.master)
439 AS_CPPFLAGS= $(CPPFLAGS.first) $(CPPFLAGS.master)
442 # For source message catalogue
444 .SUFFIXES: $(SUFFIXES) .i .po
445 MSGROOT= $(ROOT)/catalog
446 MSGDOMAIN= $(MSGROOT)/$(TEXT_DOMAIN)
447 MSGDOMAINPOFILE = $(MSGDOMAIN)/$(POFILE)
448 DCMSGDOMAIN= $(MSGROOT)/LC_TIME/$(TEXT_DOMAIN)
449 DCMSGDOMAINPOFILE = $(DCMSGDOMAIN)/$(DCFILE:.dc=.po)
451 CLOBBERFILES += $(POFILE) $(POFILES)
452 COMPILE.cpp= $(CC) -xc -E -C $(CFLAGS) $(CPPFLAGS)
453 XGETTEXT= /usr/bin/xgettext
454 XGETFLAGS= -c TRANSLATION_NOTE
455 BUILD.po= $(XGETTEXT) $(XGETFLAGS) -d $(<F) $<.i ;\
457 $(SED) "/^domain/d" < $(<F).po > $@ ;\
461 # This is overwritten by local Makefile when PROG is a list.
465 sparc_CCFLAGS= -m32 mcpu=v8 mno-v8plus \
468 sparcv9_CCFLAGS= $(sparcv9_XARCH) \
470 i386_CCFLAGS= $(CCERRWARN)
471 amd64_CCFLAGS= $(amd64_XARCH) \
475 sparcv9_CCOPTFLAG= -O
479 CCOPTFLAG= $($(MACH)_CCOPTFLAG)
480 CCOPTFLAG64= $($(MACH64)_CCOPTFLAG)
481 CCFLAGS= $(CCOPTFLAG) $($(MACH)_CCFLAGS) $(CCSOURCEDEBUGFLAGS) \
483 CCFLAGS64= $(CCOPTFLAG64) $($(MACH64)_CCFLAGS) $(CCSOURCEDEBUGFLAGS) \
490 ELFWRAP_FLAGS64 = -64
493 # Various mapfiles that are used throughout the build, and delivered to
496 MAPFILE.PGA = $(SRC)/common/mapfiles/common/map.pagealign
497 MAPFILE.FLT = $(SRC)/common/mapfiles/common/map.filter
498 MAPFILE.LEX = $(SRC)/common/mapfiles/common/map.lex.yy
501 # Generated mapfiles that are compiler specific, and used throughout the
502 # build. These mapfiles are not delivered in /usr/lib/ld.
504 MAPFILE.NGB_sparc= $(SRC)/common/mapfiles/gen/sparc_gcc_map.noexeglobs
505 MAPFILE.NGB_sparcv9= $(SRC)/common/mapfiles/gen/sparcv9_gcc_map.noexeglobs
506 MAPFILE.NGB_i386= $(SRC)/common/mapfiles/gen/i386_gcc_map.noexeglobs
507 MAPFILE.NGB_amd64= $(SRC)/common/mapfiles/gen/amd64_gcc_map.noexeglobs
508 MAPFILE.NGB = $(MAPFILE.NGB_$(MACH))
511 # A generic interface mapfile name, used by various dynamic objects to define
512 # the interfaces and interposers the object must export.
514 MAPFILE.INT = mapfile-intf
517 # LDLIBS32 and LDLIBS64 can be set in the environment to override the following
520 LDLIBS32 = $(ENVLDLIBS1) $(ENVLDLIBS2) $(ENVLDLIBS3)
521 LDLIBS32 += $(ADJUNCT_PROTO:%=-L%/usr/lib -L%/lib)
522 LDLIBS.cmd = $(LDLIBS32)
523 LDLIBS.lib = $(LDLIBS32)
525 LDLIBS64 = $(ENVLDLIBS1:%=%/$(MACH64)) \
526 $(ENVLDLIBS2:%=%/$(MACH64)) \
527 $(ENVLDLIBS3:%=%/$(MACH64))
528 LDLIBS64 += $(ADJUNCT_PROTO:%=-L%/usr/lib/$(MACH64) -L%/lib/$(MACH64))
531 # Define compilation macros.
533 COMPILE.c= $(CC) $(CFLAGS) $(CPPFLAGS) -c
534 COMPILE64.c= $(CC) $(CFLAGS64) $(CPPFLAGS) -c
535 COMPILE.cc= $(CCC) $(CCFLAGS) $(CPPFLAGS) -c
536 COMPILE64.cc= $(CCC) $(CCFLAGS64) $(CPPFLAGS) -c
537 COMPILE.s= $(AS) $(ASFLAGS) $(AS_CPPFLAGS)
538 COMPILE64.s= $(AS) $(ASFLAGS) $($(MACH64)_AS_XARCH) $(AS_CPPFLAGS)
539 COMPILE.d= $(DTRACE) -G -32
540 COMPILE64.d= $(DTRACE) -G -64
541 COMPILE.b= $(ELFWRAP) $(ELFWRAP_FLAGS$(CLASS))
542 COMPILE64.b= $(ELFWRAP) $(ELFWRAP_FLAGS$(CLASS))
547 CCNEEDED = -L$(GCCLIBDIR) -lstdc++ -lgcc_s
548 CCEXTNEEDED = $(CCNEEDED)
550 LINK.c= $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
551 LINK64.c= $(CC) $(CFLAGS64) $(CPPFLAGS) $(LDFLAGS)
552 LINK.cc= $(CCC) $(CCFLAGS) $(CPPFLAGS) \
553 $(LDFLAGS) $(CCNEEDED)
554 LINK64.cc= $(CCC) $(CCFLAGS64) $(CPPFLAGS) \
555 $(LDFLAGS) $(CCNEEDED)
559 # For some future builds, NATIVE_MACH and MACH might be different.
560 # Therefore, NATIVE_MACH needs to be redefined in the
561 # environment as `uname -p` to override this macro.
563 # For now at least, we cross-compile amd64 on i386 machines.
564 NATIVE_MACH= $(MACH:amd64=i386)
566 # Define native compilation macros
569 # Base directory where compilers are located.
570 # Defined here so it can be overridden by developers.
574 BASIC_CC_ARGS= -fident \
576 -fno-inline-functions \
579 -fdiagnostics-show-option \
582 # The SPARC ldd and std instructions require 8-byte alignment of their
583 # address operand. gcc correctly uses them only when the ABI requires
584 # 8-byte alignment; unfortunately we have a number of pieces of buggy code
585 # that does not conform to the ABI. This flag makes gcc work more like
586 # Studio with -xmemalign=4.
587 $(SPARC_BLD)BASIC_CC_ARGS += mno-integer-ldd-std
589 BASIC_CC_ARGS += -D__sun
591 BASIC_AS_ARGS= -x assembler-with-cpp \
594 -Wa,--fatal-warnings \
595 -Wa,--traditional-format \
598 # Specify platform compiler versions for languages
599 # that we use (currently only c and c++).
601 sparc_CC= /usr/libexec/unleashed/gcc-wrap $(GNUC_ROOT)/bin/gcc $(BASIC_CC_ARGS)
602 sparc_CCC= /usr/libexec/unleashed/gcc-wrap $(GNUC_ROOT)/bin/g++ $(BASIC_CC_ARGS)
603 sparc_CPP= $(GNUC_ROOT)/bin/cpp
604 sparc_AS= /usr/bin/as -xregsym=no
605 sparc_LD= /usr/bin/ld
607 sparcv9_CC= /usr/libexec/unleashed/gcc-wrap $(GNUC_ROOT)/bin/gcc $(BASIC_CC_ARGS)
608 sparcv9_CCC= /usr/libexec/unleashed/gcc-wrap $(GNUC_ROOT)/bin/g++ $(BASIC_CC_ARGS)
609 sparcv9_CPP= $(GNUC_ROOT)/bin/cpp
610 sparcv9_AS= /usr/bin/as -xregsym=no
611 sparcv9_LD= /usr/bin/ld
613 i386_CC= /usr/libexec/unleashed/gcc-wrap $(GNUC_ROOT)/bin/gcc $(BASIC_CC_ARGS)
614 i386_CCC= /usr/libexec/unleashed/gcc-wrap $(GNUC_ROOT)/bin/g++ $(BASIC_CC_ARGS)
615 i386_CPP= $(GNUC_ROOT)/bin/cpp
616 i386_AS= $(GNUC_ROOT)/bin/gcc $(BASIC_AS_ARGS)
619 amd64_CC= /usr/libexec/unleashed/gcc-wrap $(GNUC_ROOT)/bin/gcc $(BASIC_CC_ARGS)
620 amd64_CCC= /usr/libexec/unleashed/gcc-wrap $(GNUC_ROOT)/bin/g++ $(BASIC_CC_ARGS)
621 amd64_CPP= $(GNUC_ROOT)/bin/cpp
622 amd64_AS= $(GNUC_ROOT)/bin/gcc $(BASIC_AS_ARGS)
623 amd64_LD= /usr/bin/ld
625 NATIVECC= $($(NATIVE_MACH)_CC)
626 NATIVECCC= $($(NATIVE_MACH)_CCC)
627 NATIVECPP= $($(NATIVE_MACH)_CPP)
628 NATIVEAS= $($(NATIVE_MACH)_AS)
629 NATIVELD= $($(NATIVE_MACH)_LD)
632 # Makefile.master.64 overrides these settings
643 LD_BDYNAMIC= -Bdynamic
645 LD_BNODIRECT= -Bnodirect
649 BDIRECT= $(LD_BDIRECT:%=-Wl,%)
650 BDYNAMIC= $(LD_BDYNAMIC:%=-Wl,%)
651 BLOCAL= $(LD_BLOCAL:%=-Wl,%)
652 BNODIRECT= $(LD_BNODIRECT:%=-Wl,%)
653 BREDUCE= $(LD_BREDUCE:%=-Wl,%)
654 BSTATIC= $(LD_BSTATIC:%=-Wl,%)
659 LD_ZINITFIRST= -zinitfirst
660 LD_ZINTERPOSE= -zinterpose
661 LD_ZLAZYLOAD= -zlazyload
662 LD_ZLOADFLTR= -zloadfltr
664 LD_ZNODELETE= -znodelete
665 LD_ZNODLOPEN= -znodlopen
667 LD_ZNOLAZYLOAD= -znolazyload
668 LD_ZNOLDYNSYM= -znoldynsym
669 LD_ZNORELOC= -znoreloc
670 LD_ZNOVERSION= -znoversion
674 ZDEFS= $(LD_ZDEFS:%=-Wl,%)
675 ZDIRECT= $(LD_ZDIRECT:%=-Wl,%)
676 ZIGNORE= $(LD_ZIGNORE:%=-Wl,%)
677 ZINITFIRST= $(LD_ZINITFIRST:%=-Wl,%)
678 ZINTERPOSE= $(LD_ZINTERPOSE:%=-Wl,%)
679 ZLAZYLOAD= $(LD_ZLAZYLOAD:%=-Wl,%)
680 ZLOADFLTR= $(LD_ZLOADFLTR:%=-Wl,%)
681 ZNODEFS= $(LD_ZNODEFS:%=-Wl,%)
682 ZNODELETE= $(LD_ZNODELETE:%=-Wl,%)
683 ZNODLOPEN= $(LD_ZNODLOPEN:%=-Wl,%)
684 ZNODUMP= $(LD_ZNODUMP:%=-Wl,%)
685 ZNOLAZYLOAD= $(LD_ZNOLAZYLOAD:%=-Wl,%)
686 ZNOLDYNSYM= $(LD_ZNOLDYNSYM:%=-Wl,%)
687 NORELOC= $(LD_ZNORELOC:%=-Wl,%)
688 ZNOVERSION= $(LD_ZNOVERSION:%=-Wl,%)
689 ZRECORD= $(LD_ZRECORD:%=-Wl,%)
690 ZTEXT= $(LD_ZTEXT:%=-Wl,%)
694 # Handle different PIC models on different ISAs
695 # (May be overridden by lower-level Makefiles)
697 sparc_C_PICFLAGS = -fpic
698 sparcv9_C_PICFLAGS = -fpic
699 i386_C_PICFLAGS = -fpic
700 amd64_C_PICFLAGS = -fpic
701 C_PICFLAGS = $($(MACH)_C_PICFLAGS)
702 C_PICFLAGS64 = $($(MACH64)_C_PICFLAGS)
704 sparc_C_BIGPICFLAGS = -fPIC
705 sparcv9_C_BIGPICFLAGS = -fPIC
706 i386_C_BIGPICFLAGS = -fPIC
707 amd64_C_BIGPICFLAGS = -fPIC
708 C_BIGPICFLAGS = $($(MACH)_C_BIGPICFLAGS)
709 C_BIGPICFLAGS64 = $($(MACH64)_C_BIGPICFLAGS)
711 # CC requires there to be no space between '-K' and 'pic' or 'PIC'.
712 sparc_CC_PICFLAGS = -fpic
713 sparcv9_CC_PICFLAGS = -fPIC
714 i386_CC_PICFLAGS = -fpic
715 amd64_CC_PICFLAGS = -fpic
716 CC_PICFLAGS = $($(MACH)_CC_PICFLAGS)
717 CC_PICFLAGS64 = $($(MACH64)_CC_PICFLAGS)
723 # Default label for CTF sections
725 CTFCVTFLAGS= -i -L VERSION
728 # Override to pass module-specific flags to ctfmerge. Currently used only by
729 # krtld to turn on fuzzy matching, and source-level debugging to inhibit
734 CTFCONVERT_O = $(CTFCONVERT) $(CTFCVTFLAGS) $@
736 # Rules (normally from make.rules) and macros which are used for post
737 # processing files. Normally, these do stripping of the comment section
739 # RELEASE_CM: Should be editted to reflect the release.
740 # POST_PROCESS_O: Post-processing for `.o' files.
741 # POST_PROCESS_A: Post-processing for `.a' files (currently null).
742 # POST_PROCESS_SO: Post-processing for `.so' files.
743 # POST_PROCESS: Post-processing for executable files (no suffix).
744 # Note that these macros are not completely generalized as they are to be
745 # used with the file name to be processed following.
747 # It is left as an exercise to Release Engineering to embellish the generation
748 # of the release comment string.
750 # If this is a standard development build:
751 # compress the comment section (mcs -c)
752 # add the standard comment (mcs -a $(RELEASE_CM))
753 # add the development specific comment (mcs -a $(DEV_CM))
755 # If this is an installation build:
756 # delete the comment section (mcs -d)
757 # add the standard comment (mcs -a $(RELEASE_CM))
758 # add the development specific comment (mcs -a $(DEV_CM))
760 # If this is an release build:
761 # delete the comment section (mcs -d)
762 # add the standard comment (mcs -a $(RELEASE_CM))
764 # The following list of macros are used in the definition of RELEASE_CM
765 # which is used to label all binaries in the build:
767 # RELEASE Specific release of the build, eg: 5.2
768 # RELEASE_MAJOR Major version number part of $(RELEASE)
769 # RELEASE_MINOR Minor version number part of $(RELEASE)
770 # VERSION Version of the build (alpha, beta, Generic)
771 # PATCHID If this is a patch this value should contain
772 # the patchid value (eg: "Generic 100832-01"), otherwise
773 # it will be set to $(VERSION)
774 # RELEASE_DATE Date of the Release Build
775 # PATCH_DATE Date the patch was created, if this is blank it
776 # will default to the RELEASE_DATE
781 RELEASE= $(RELEASE_MAJOR).$(RELEASE_MINOR)
782 VERSION= $(SYSNAME) Development
784 RELEASE_DATE= release date not set
785 PATCH_DATE= $(RELEASE_DATE)
786 RELEASE_CM= "$(SYSNAME) $(RELEASE) $(PATCHID) $(PATCH_DATE)"
787 DEV_CM= "$(SYSNAME) Development: non-nightly build"
789 STRIP_STABS= $(STRIP) -x $@
790 $(SRCDBGBLD)STRIP_STABS= :
794 POST_PROCESS_SO= $(STRIP_STABS)
795 POST_PROCESS= $(STRIP_STABS)
798 # PKGARCHIVE specifies the default location where packages should be
801 PKGARCHIVE=$(SRC)/../../packages/$(MACH)/nightly
804 # The repositories will be created with these publisher settings. To
805 # update an image to the resulting repositories, this must match the
806 # publisher name provided to "pkg set-publisher."
808 PKGPUBLISHER= unleashed
810 # Default build rules which perform comment section post-processing.
813 $(LINK.c) -o $@ $< $(LDLIBS)
816 $(COMPILE.c) $(OUTPUT_OPTION) $< $(CTFCONVERT_HOOK)
819 $(COMPILE.c) -o $% $<
820 $(AR) $(ARFLAGS) $@ $%
823 $(COMPILE.s) -o $@ $<
826 $(COMPILE.s) -o $% $<
827 $(AR) $(ARFLAGS) $@ $%
830 $(LINK.cc) -o $@ $< $(LDLIBS)
833 $(COMPILE.cc) $(OUTPUT_OPTION) $<
836 $(COMPILE.cc) -o $% $<
837 $(AR) $(ARFLAGS) $@ $%
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@:\#!$(PYSHEBANG):" < $< > $@; $(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