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>
30 # Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
31 # Copyright (c) 2019, Joyent, Inc.
34 include $(SRC)/Makefile.cfgparam
37 # Makefile.master, global definitions for system source
42 # Adjunct root, containing an additional proto area to be used for headers
48 # Adjunct for building things that run on the build machine.
53 # RELEASE_BUILD should be cleared for final release builds.
54 # NOT_RELEASE_BUILD is exactly what the name implies.
58 RELEASE_BUILD= $(POUND_SIGN)
59 $(RELEASE_BUILD)NOT_RELEASE_BUILD= $(POUND_SIGN)
60 PATCH_BUILD= $(POUND_SIGN)
62 # SPARC_BLD is '#' for an Intel build.
63 # INTEL_BLD is '#' for a Sparc build.
64 SPARC_BLD_1= $(MACH:i386=$(POUND_SIGN))
65 SPARC_BLD= $(SPARC_BLD_1:sparc=)
66 INTEL_BLD_1= $(MACH:sparc=$(POUND_SIGN))
67 INTEL_BLD= $(INTEL_BLD_1:i386=)
69 # Allow build-time "configuration" to enable or disable some things.
70 # The default is POUND_SIGN, meaning "not enabled".
71 ENABLE_PERL64= $(POUND_SIGN)
73 # BUILD_TOOLS is the root of all tools including compilers.
74 # ONBLD_TOOLS is the root of all the tools that are part of SUNWonbld.
77 ONBLD_TOOLS= $(BUILD_TOOLS)/onbld
79 GNUC_ROOT= /opt/gcc/4.4.4
80 GCCLIBDIR= $(GNUC_ROOT)/lib
81 GCCLIBDIR64= $(GNUC_ROOT)/lib/$(MACH64)
83 DOCBOOK_XSL_ROOT= /usr/share/sgml/docbook/xsl-stylesheets
85 RPCGEN= /usr/bin/rpcgen
86 ELFEXTRACT= $(ONBLD_TOOLS)/bin/$(MACH)/elfextract
87 MBH_PATCH= $(SRCTOP)/tools/mbh_patch/obj/mbh_patch
88 BTXLD= $(ONBLD_TOOLS)/bin/$(MACH)/btxld
89 VTFONTCVT= /usr/bin/vtfontcvt
90 # echo(1) and true(1) are specified without absolute paths, so that the shell
91 # spawned by make(1) may use the built-in versions. This is minimally
92 # problematic, as the shell spawned by make(1) is known and under control, the
93 # only risk being if the shell falls back to $PATH.
95 # We specifically want an echo(1) that does interpolation of escape sequences,
96 # which ksh, /bin/sh, and bash will all provide.
100 SYMLINK= /usr/bin/ln -s
102 MKDIR= /usr/bin/mkdir
103 CHMOD= /usr/bin/chmod
110 EGREP= /usr/bin/egrep
111 ELFWRAP= /usr/bin/elfwrap
117 ELFDUMP= /usr/bin/elfdump
120 STRIP= /usr/bin/strip
125 BISON= /usr/bin/bison
126 CPP= $(GNUC_ROOT)/cpp
127 ANSI_CPP= $(GNUC_ROOT)/bin/cpp
128 CTFCONVERT= /usr/bin/ctfconvert
129 CTFDIFF= /usr/bin/ctfdiff
130 CTFMERGE= /usr/bin/ctfmerge
131 CTFSTABS= $(ONBLD_TOOLS)/bin/$(MACH)/ctfstabs
132 CTFSTRIP= $(ONBLD_TOOLS)/bin/$(MACH)/ctfstrip
133 NDRGEN= $(ONBLD_TOOLS)/bin/$(MACH)/ndrgen
134 GENOFFSETS= $(ONBLD_TOOLS)/bin/genoffsets
139 PERL_ARCH= i86pc-solaris-64int
140 PERL_ARCH64= i86pc-solaris-64
141 $(SPARC_BLD)PERL_ARCH= sun4-solaris-64int
142 $(SPARC_BLD)PERL_ARCH64= sun4-solaris-64
146 PYTHON= /usr/bin/python$(PYTHON_VERSION)
150 PYTHON3= /usr/bin/python$(PYTHON3_VERSION)
151 $(BUILDPY3TOOLS)TOOLS_PYTHON= $(PYTHON3)
152 $(BUILDPY2TOOLS)TOOLS_PYTHON= $(PYTHON)
154 TOUCH= /usr/bin/touch
156 XARGS= /usr/bin/xargs
157 ELFEDIT= /usr/bin/elfedit
158 DTRACE= /usr/sbin/dtrace -xnolibs
161 ASTBINDIR= /usr/ast/bin
162 MSGCC= $(ASTBINDIR)/msgcc
163 MSGFMT= /usr/bin/msgfmt -s
168 # Declare that nothing should be built in parallel.
169 # Individual Makefiles can use the .PARALLEL target to declare otherwise.
172 # For stylistic checks
174 # Note that the X and C checks are not used at this time and may need
175 # modification when they are actually used.
177 CSTYLE= $(ONBLD_TOOLS)/bin/cstyle
179 HDRCHK= $(ONBLD_TOOLS)/bin/hdrchk
183 @$(ECHO) "checking $<"; $(CSTYLE) $< $(CSTYLE_TAIL); \
184 $(HDRCHK) $< $(HDRCHK_TAIL)
187 @$(ECHO) "checking $<"; $(RPCGEN) -C -h $< | $(CSTYLE) $(CSTYLE_TAIL); \
188 $(RPCGEN) -C -h $< | $(HDRCHK) $< $(HDRCHK_TAIL)
191 @$(ECHO) "checking $<"; $(CSTYLE) $< $(CSTYLE_TAIL)
194 @$(ECHO) "checking $<"; \
195 SVCCFG_DTD=$(SRC)/cmd/svc/dtd/service_bundle.dtd.1 \
196 SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/global.db \
197 SVCCFG_CONFIGD_PATH=$(SRC)/cmd/svc/configd/svc.configd-native \
198 $(SRC)/cmd/svc/svccfg/svccfg-native validate $<
200 INS.file= $(INS) -m $(FILEMODE) $< $@
201 INS.dir= $(INS) -d -m $(DIRMODE) $@
202 # installs and renames at once
204 INS.rename= $(INS.file)
208 INS.link= $(RM) $@; $(LN) $(INSLINKTARGET) $@
209 INS.symlink= $(RM) $@; $(SYMLINK) $(INSLINKTARGET) $@
211 # The path to python that will be used for the shebang line when installing
212 # python scripts to the proto area. This is overridden by makefiles to
213 # select to the correct version.
217 # Python bakes the mtime of the .py file into the compiled .pyc and
218 # rebuilds if the baked-in mtime != the mtime of the source file
219 # (rather than only if it's less than), thus when installing python
220 # files we must make certain to not adjust the mtime of the source
223 INS.pyfile= $(RM) $@; $(SED) \
224 -e "1s:^\#!@PYTHON@:\#!$(PYSHEBANG):" \
225 -e "1s:^\#!@TOOLS_PYTHON@:\#!$(TOOLS_PYTHON):" \
226 < $< > $@; $(CHMOD) $(FILEMODE) $@; $(TOUCH) -r $< $@
228 # MACH must be set in the shell environment per uname -p on the build host
229 # More specific architecture variables should be set in lower makefiles.
231 # MACH64 is derived from MACH, and BUILD64 is set to `#' for
232 # architectures on which we do not build 64-bit versions.
233 # (There are no such architectures at the moment.)
235 # Set BUILD64=# in the environment to disable 64-bit amd64
236 # builds on i386 machines.
238 MACH64_1= $(MACH:sparc=sparcv9)
239 MACH64= $(MACH64_1:i386=amd64)
241 MACH32_1= $(MACH:sparc=sparcv7)
242 MACH32= $(MACH32_1:i386=i386)
246 BUILD64= $($(MACH)_BUILD64)
249 # generate 32-bit addresses in the v9 kernel. Saves memory.
250 CCABS32= -fno-pic -mcmodel=medlow
252 # generate v9 code which tolerates callers using the v7 ABI, for the sake of
254 CC32BITCALLERS= -massume-32bit-callers
256 # GCC, especially, is increasingly beginning to auto-inline functions and
257 # sadly does so separately not under the general -fno-inline-functions
258 # Additionally, we wish to prevent optimisations which cause GCC to clone
259 # functions -- in particular, these may cause unhelpful symbols to be
260 # emitted instead of function names
261 CCNOAUTOINLINE= -fno-inline-small-functions \
262 -fno-inline-functions-called-once \
266 # compiler architecture flags.
268 sparc_XARCH= -m32 -mcpu=v8 -mno-v8plus
269 sparcv9_XARCH= -m64 -mcpu=v9
270 i386_XARCH= -m32 -march=pentiumpro
271 amd64_XARCH= -m64 -Ui386 -U__i386 -mtune=opteron
273 # assembler architecture flags. Different from compiler architecture flags.
274 sparc_AS_XARCH= -xarch=v8plus -Dsparc -D__sparc -D__sparcv8
275 sparcv9_AS_XARCH= -xarch=v9 -Dsparc -D__sparc -D__sparcv9
276 i386_AS_XARCH= -m32 -Di386 -D__i386
277 amd64_AS_XARCH= -m64 -Ui386 -U__i386 -D__x86_64 -D__amd64
280 # These flags define what we need to be 'standalone' i.e. -not- part
281 # of the rather more cosy userland environment. This basically means
284 # XX64 future versions of gcc will make -mcmodel=kernel imply -mno-red-zone
286 sparc_STAND_FLAGS= -ffreestanding
287 sparcv9_STAND_FLAGS= -ffreestanding
288 # Disabling MMX also disables 3DNow, disabling SSE also disables all later
289 # additions to SSE (SSE2, AVX ,etc.)
290 NO_SIMD= -mno-mmx -mno-sse
291 i386_STAND_FLAGS= -ffreestanding $(NO_SIMD)
292 amd64_STAND_FLAGS= -ffreestanding -mno-red-zone \
293 -mcmodel=kernel $(NO_SIMD)
295 SAVEARGS= -msave-args
296 amd64_STAND_FLAGS += $(SAVEARGS)
298 STAND_FLAGS_32 = $($(MACH)_STAND_FLAGS)
299 STAND_FLAGS_64 = $($(MACH64)_STAND_FLAGS)
302 # turn warnings into errors (C)
303 CERRWARN = -Wall -Wextra -Werror
305 CERRWARN += -Wno-missing-braces
306 CERRWARN += -Wno-sign-compare
307 CERRWARN += -Wno-unknown-pragmas
308 CERRWARN += -Wno-unused-parameter
309 CERRWARN += -Wno-missing-field-initializers
311 # Unfortunately, this option can misfire very easily and unfixably.
312 CERRWARN += -Wno-array-bounds
314 # DEBUG v. -nd make for frequent unused variables, empty conditions, etc. in
316 $(RELEASE_BUILD)CERRWARN += -Wno-unused
317 $(RELEASE_BUILD)CERRWARN += -Wno-empty-body
320 # turn warnings into errors (C++)
324 CSTD_GNU89= -std=gnu89
325 CSTD_GNU99= -std=gnu99
328 # In most places, assignments to these macros should be appended with +=
329 # (CPPFLAGS.first allows values to be prepended to CPPFLAGS).
330 sparc_CFLAGS= $(sparc_XARCH)
331 sparcv9_CFLAGS= $(sparcv9_XARCH)
332 i386_CFLAGS= $(i386_XARCH)
333 amd64_CFLAGS= $(amd64_XARCH)
335 sparc_ASFLAGS= $(sparc_AS_XARCH)
336 sparcv9_ASFLAGS=$(sparcv9_AS_XARCH)
337 i386_ASFLAGS= $(i386_AS_XARCH)
338 amd64_ASFLAGS= $(amd64_AS_XARCH)
341 sparc_COPTFLAG= -fno-strict-aliasing \
342 -fno-unit-at-a-time \
343 -fno-optimize-sibling-calls \
345 sparcv9_COPTFLAG= -fno-strict-aliasing \
346 -fno-unit-at-a-time \
347 -fno-optimize-sibling-calls \
350 amd64_COPTFLAG= -fno-strict-aliasing \
351 -fno-unit-at-a-time \
352 -fno-optimize-sibling-calls \
355 COPTFLAG= $($(MACH)_COPTFLAG)
356 COPTFLAG64= $($(MACH64)_COPTFLAG)
358 # Sometimes we want all symbols and types in debugging information even
359 # if they aren't used.
360 CALLSYMS= -fno-eliminate-unused-debug-symbols \
361 -fno-eliminate-unused-debug-types
364 # Flags used to build in debug mode for ctf generation. Bugs in the Devpro
365 # compilers currently prevent us from building with cc-emitted DWARF.
367 CTF_FLAGS_sparc = -g -Wc,-Qiselect-T1 $(CSTD) $(CDWARFSTR)
368 CTF_FLAGS_i386 = -g $(CSTD) $(CDWARFSTR)
370 CTF_FLAGS_sparcv9 = $(CTF_FLAGS_sparc)
371 CTF_FLAGS_amd64 = $(CTF_FLAGS_i386)
373 CTF_FLAGS_amd64 += $(SAVEARGS)
375 CTF_FLAGS_32 = $(CTF_FLAGS_$(MACH))
376 CTF_FLAGS_64 = $(CTF_FLAGS_$(MACH64))
377 CTF_FLAGS = $(CTF_FLAGS_32)
380 # Flags used with genoffsets
382 GOFLAGS = $(CALLSYMS) \
385 OFFSETS_CREATE = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \
386 $(CC) $(GOFLAGS) $(CFLAGS) $(CPPFLAGS)
388 OFFSETS_CREATE64 = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \
389 $(CC) $(GOFLAGS) $(CFLAGS64) $(CPPFLAGS)
391 sparc_XREGSFLAG = -mno-app-regs
392 sparcv9_XREGSFLAG = -mno-app-regs
396 XREGSFLAG = $($(MACH)_XREGSFLAG)
397 XREGSFLAG64 = $($(MACH64)_XREGSFLAG)
399 # dmake SOURCEDEBUG=yes ... enables source-level debugging information, and
400 # avoids stripping it.
401 SOURCEDEBUG = $(POUND_SIGN)
402 SRCDBGBLD = $(SOURCEDEBUG:yes=)
405 # These variables are intended ONLY for use by developers to safely pass extra
406 # flags to the compilers without unintentionally overriding Makefile-set
407 # flags. They should NEVER be set to any value in a Makefile.
409 # They come last in the associated FLAGS variable such that they can
410 # explicitly override things if necessary, there are gaps in this, but it's
411 # the best we can manage.
414 CUSERFLAGS64 = $(CUSERFLAGS)
416 CCUSERFLAGS64 = $(CCUSERFLAGS)
420 $(SRCDBGBLD)CSOURCEDEBUGFLAGS = -g
421 $(SRCDBGBLD)CCSOURCEDEBUGFLAGS = -g
423 CFLAGS= $(COPTFLAG) $($(MACH)_CFLAGS) \
424 $(CERRWARN) $(CSTD) \
425 $(CCNOAUTOINLINE) $(CSOURCEDEBUGFLAGS) \
427 CFLAGS64= $(COPTFLAG64) $($(MACH64)_CFLAGS) \
428 $(CERRWARN) $(CSTD) \
429 $(CCNOAUTOINLINE) $(CSOURCEDEBUGFLAGS) \
433 # Flags that are used to build parts of the code that are subsequently
434 # run on the build machine (also known as the NATIVE_BUILD).
436 NATIVE_CFLAGS= $(COPTFLAG) $($(NATIVE_MACH)_CFLAGS) \
437 $(CERRWARN) $(CSTD) \
439 $(CSOURCEDEBUGFLAGS) $(CUSERFLAGS)
441 DTEXTDOM=-DTEXT_DOMAIN=\"$(TEXT_DOMAIN)\" # For messaging.
442 CPPFLAGS.first= # Please keep empty. Only lower makefiles should set this.
443 CPPFLAGS.master=$(DTEXTDOM) \
444 $(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4) \
445 $(ADJUNCT_PROTO:%=-I%/usr/include)
446 CPPFLAGS.native=$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) \
447 $(ENVCPPFLAGS4) -I$(NATIVE_ADJUNCT)/include
448 CPPFLAGS= $(CPPFLAGS.first) $(CPPFLAGS.master)
449 AS_CPPFLAGS= $(CPPFLAGS.first) $(CPPFLAGS.master)
452 # For source message catalogue
454 .SUFFIXES: $(SUFFIXES) .i .po
455 MSGROOT= $(ROOT)/catalog
456 MSGDOMAIN= $(MSGROOT)/$(TEXT_DOMAIN)
457 MSGDOMAINPOFILE = $(MSGDOMAIN)/$(POFILE)
458 DCMSGDOMAIN= $(MSGROOT)/LC_TIME/$(TEXT_DOMAIN)
459 DCMSGDOMAINPOFILE = $(DCMSGDOMAIN)/$(DCFILE:.dc=.po)
461 CLOBBERFILES += $(POFILE) $(POFILES)
462 COMPILE.cpp= $(CC) -xc -E -C $(CFLAGS) $(CPPFLAGS)
463 XGETTEXT= /usr/bin/xgettext
464 XGETFLAGS= -c TRANSLATION_NOTE
465 BUILD.po= $(XGETTEXT) $(XGETFLAGS) -d $(<F) $<.i ;\
467 $(SED) "/^domain/d" < $(<F).po > $@ ;\
471 # This is overwritten by local Makefile when PROG is a list.
475 sparc_CCFLAGS= -m32 mcpu=v8 mno-v8plus \
478 sparcv9_CCFLAGS= $(sparcv9_XARCH) \
480 i386_CCFLAGS= $(i386_XARCH) $(CCERRWARN)
481 amd64_CCFLAGS= $(amd64_XARCH) \
485 sparcv9_CCOPTFLAG= -O
489 CCOPTFLAG= $($(MACH)_CCOPTFLAG)
490 CCOPTFLAG64= $($(MACH64)_CCOPTFLAG)
491 CCFLAGS= $(CCOPTFLAG) $($(MACH)_CCFLAGS) $(CCSOURCEDEBUGFLAGS) \
493 CCFLAGS64= $(CCOPTFLAG64) $($(MACH64)_CCFLAGS) $(CCSOURCEDEBUGFLAGS) \
500 ELFWRAP_FLAGS64 = -64
503 # Various mapfiles that are used throughout the build, and delivered to
506 MAPFILE.PGA = $(SRC)/common/mapfiles/common/map.pagealign
507 MAPFILE.FLT = $(SRC)/common/mapfiles/common/map.filter
508 MAPFILE.LEX = $(SRC)/common/mapfiles/common/map.lex.yy
511 # Generated mapfiles that are compiler specific, and used throughout the
512 # build. These mapfiles are not delivered in /usr/lib/ld.
514 MAPFILE.NGB_sparc= $(SRC)/common/mapfiles/gen/sparc_gcc_map.noexeglobs
515 MAPFILE.NGB_sparcv9= $(SRC)/common/mapfiles/gen/sparcv9_gcc_map.noexeglobs
516 MAPFILE.NGB_i386= $(SRC)/common/mapfiles/gen/i386_gcc_map.noexeglobs
517 MAPFILE.NGB_amd64= $(SRC)/common/mapfiles/gen/amd64_gcc_map.noexeglobs
518 MAPFILE.NGB = $(MAPFILE.NGB_$(MACH))
521 # A generic interface mapfile name, used by various dynamic objects to define
522 # the interfaces and interposers the object must export.
524 MAPFILE.INT = mapfile-intf
527 # LDLIBS32 and LDLIBS64 can be set in the environment to override the following
530 LDLIBS32 = $(ENVLDLIBS1) $(ENVLDLIBS2) $(ENVLDLIBS3)
531 LDLIBS32 += $(ADJUNCT_PROTO:%=-L%/usr/lib -L%/lib)
532 LDLIBS.cmd = $(LDLIBS32)
533 LDLIBS.lib = $(LDLIBS32)
535 LDLIBS64 = $(ENVLDLIBS1:%=%/$(MACH64)) \
536 $(ENVLDLIBS2:%=%/$(MACH64)) \
537 $(ENVLDLIBS3:%=%/$(MACH64))
538 LDLIBS64 += $(ADJUNCT_PROTO:%=-L%/usr/lib/$(MACH64) -L%/lib/$(MACH64))
541 # Define compilation macros.
543 COMPILE.c= $(CC) $(CFLAGS) $(CPPFLAGS) -c
544 COMPILE64.c= $(CC) $(CFLAGS64) $(CPPFLAGS) -c
545 COMPILE.cc= $(CCC) $(CCFLAGS) $(CPPFLAGS) -c
546 COMPILE64.cc= $(CCC) $(CCFLAGS64) $(CPPFLAGS) -c
547 COMPILE.s= $(AS) $(ASFLAGS) $(AS_CPPFLAGS)
548 COMPILE32.s= $(AS) $(ASFLAGS) $($(MACH32)_AS_XARCH) $(AS_CPPFLAGS)
549 COMPILE64.s= $(AS) $(ASFLAGS) $($(MACH64)_AS_XARCH) $(AS_CPPFLAGS)
550 COMPILE.d= $(DTRACE) -G -32
551 COMPILE64.d= $(DTRACE) -G -64
552 COMPILE.b= $(ELFWRAP) $(ELFWRAP_FLAGS$(CLASS))
553 COMPILE64.b= $(ELFWRAP) $(ELFWRAP_FLAGS$(CLASS))
558 CCNEEDED = -L$(GCCLIBDIR) -lstdc++ -lgcc
559 CCEXTNEEDED = $(CCNEEDED)
561 LINK.c= $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
562 LINK64.c= $(CC) $(CFLAGS64) $(CPPFLAGS) $(LDFLAGS)
563 LINK.cc= $(CCC) $(CCFLAGS) $(CPPFLAGS) \
564 $(LDFLAGS) $(CCNEEDED)
565 LINK64.cc= $(CCC) $(CCFLAGS64) $(CPPFLAGS) \
566 $(LDFLAGS) $(CCNEEDED)
570 NATIVE_MACH= $(MACH64)
572 # Define native compilation macros
575 # Base directory where compilers are located.
576 # Defined here so it can be overridden by developers.
580 BASIC_CC_ARGS= -fident \
582 -fno-inline-functions \
585 -fdiagnostics-show-option
587 # The SPARC ldd and std instructions require 8-byte alignment of their
588 # address operand. gcc correctly uses them only when the ABI requires
589 # 8-byte alignment; unfortunately we have a number of pieces of buggy code
590 # that does not conform to the ABI. This flag makes gcc work more like
591 # Studio with -xmemalign=4.
592 $(SPARC_BLD)BASIC_CC_ARGS += mno-integer-ldd-std
594 BASIC_CC_ARGS += -D__sun
596 BASIC_AS_ARGS= -x assembler-with-cpp \
599 -Wa,--fatal-warnings \
600 -Wa,--traditional-format \
603 # Specify platform compiler versions for languages
604 # that we use (currently only c and c++).
606 sparc_CC= /usr/libexec/unleashed/gcc-wrap $(GNUC_ROOT)/bin/gcc $(BASIC_CC_ARGS)
607 sparc_CCC= /usr/libexec/unleashed/gcc-wrap $(GNUC_ROOT)/bin/g++ $(BASIC_CC_ARGS)
608 sparc_CPP= $(GNUC_ROOT)/bin/cpp
609 sparc_AS= /usr/bin/as -xregsym=no
610 sparc_LD= /usr/bin/ld.sun
612 sparcv9_CC= /usr/libexec/unleashed/gcc-wrap $(GNUC_ROOT)/bin/gcc $(BASIC_CC_ARGS)
613 sparcv9_CCC= /usr/libexec/unleashed/gcc-wrap $(GNUC_ROOT)/bin/g++ $(BASIC_CC_ARGS)
614 sparcv9_CPP= $(GNUC_ROOT)/bin/cpp
615 sparcv9_AS= /usr/bin/as -xregsym=no
616 sparcv9_LD= /usr/bin/ld.sun
618 i386_CC= /usr/libexec/unleashed/gcc-wrap $(GNUC_ROOT)/bin/gcc $(BASIC_CC_ARGS) -nodefaultlibs
619 i386_CCC= /usr/libexec/unleashed/gcc-wrap $(GNUC_ROOT)/bin/g++ $(BASIC_CC_ARGS)
620 i386_CPP= $(GNUC_ROOT)/bin/cpp
621 i386_AS= $(GNUC_ROOT)/bin/gcc $(BASIC_AS_ARGS)
622 i386_LD= /usr/bin/ld.sun
624 amd64_CC= /usr/libexec/unleashed/gcc-wrap $(GNUC_ROOT)/bin/gcc $(BASIC_CC_ARGS) -nodefaultlibs
625 amd64_CCC= /usr/libexec/unleashed/gcc-wrap $(GNUC_ROOT)/bin/g++ $(BASIC_CC_ARGS)
626 amd64_CPP= $(GNUC_ROOT)/bin/cpp
627 amd64_AS= $(GNUC_ROOT)/bin/gcc $(BASIC_AS_ARGS)
628 amd64_LD= /usr/bin/ld.sun
630 NATIVECC= $($(NATIVE_MACH)_CC)
631 NATIVECCC= $($(NATIVE_MACH)_CCC)
632 NATIVECPP= $($(NATIVE_MACH)_CPP)
633 NATIVEAS= $($(NATIVE_MACH)_AS)
634 NATIVELD= $($(NATIVE_MACH)_LD)
637 # Makefile.master.64 overrides these settings
648 LD_BDYNAMIC= -Bdynamic
650 LD_BNODIRECT= -Bnodirect
654 BDIRECT= $(LD_BDIRECT:%=-Wl,%)
655 BDYNAMIC= $(LD_BDYNAMIC:%=-Wl,%)
656 BLOCAL= $(LD_BLOCAL:%=-Wl,%)
657 BNODIRECT= $(LD_BNODIRECT:%=-Wl,%)
658 BREDUCE= $(LD_BREDUCE:%=-Wl,%)
659 BSTATIC= $(LD_BSTATIC:%=-Wl,%)
664 LD_ZINITFIRST= -zinitfirst
665 LD_ZINTERPOSE= -zinterpose
666 LD_ZLAZYLOAD= -zlazyload
667 LD_ZLOADFLTR= -zloadfltr
669 LD_ZNODELETE= -znodelete
670 LD_ZNODLOPEN= -znodlopen
672 LD_ZNOLAZYLOAD= -znolazyload
673 LD_ZNOLDYNSYM= -znoldynsym
674 LD_ZNORELOC= -znoreloc
675 LD_ZNOVERSION= -znoversion
679 ZDEFS= $(LD_ZDEFS:%=-Wl,%)
680 ZDIRECT= $(LD_ZDIRECT:%=-Wl,%)
681 ZIGNORE= $(LD_ZIGNORE:%=-Wl,%)
682 ZINITFIRST= $(LD_ZINITFIRST:%=-Wl,%)
683 ZINTERPOSE= $(LD_ZINTERPOSE:%=-Wl,%)
684 ZLAZYLOAD= $(LD_ZLAZYLOAD:%=-Wl,%)
685 ZLOADFLTR= $(LD_ZLOADFLTR:%=-Wl,%)
686 ZNODEFS= $(LD_ZNODEFS:%=-Wl,%)
687 ZNODELETE= $(LD_ZNODELETE:%=-Wl,%)
688 ZNODLOPEN= $(LD_ZNODLOPEN:%=-Wl,%)
689 ZNODUMP= $(LD_ZNODUMP:%=-Wl,%)
690 ZNOLAZYLOAD= $(LD_ZNOLAZYLOAD:%=-Wl,%)
691 ZNOLDYNSYM= $(LD_ZNOLDYNSYM:%=-Wl,%)
692 NORELOC= $(LD_ZNORELOC:%=-Wl,%)
693 ZNOVERSION= $(LD_ZNOVERSION:%=-Wl,%)
694 ZRECORD= $(LD_ZRECORD:%=-Wl,%)
695 ZTEXT= $(LD_ZTEXT:%=-Wl,%)
699 # Handle different PIC models on different ISAs
700 # (May be overridden by lower-level Makefiles)
702 sparc_C_PICFLAGS = -fpic
703 sparcv9_C_PICFLAGS = -fpic
704 i386_C_PICFLAGS = -fpic
705 amd64_C_PICFLAGS = -fpic
706 C_PICFLAGS = $($(MACH)_C_PICFLAGS)
707 C_PICFLAGS64 = $($(MACH64)_C_PICFLAGS)
709 sparc_C_BIGPICFLAGS = -fPIC
710 sparcv9_C_BIGPICFLAGS = -fPIC
711 i386_C_BIGPICFLAGS = -fPIC
712 amd64_C_BIGPICFLAGS = -fPIC
713 C_BIGPICFLAGS = $($(MACH)_C_BIGPICFLAGS)
714 C_BIGPICFLAGS64 = $($(MACH64)_C_BIGPICFLAGS)
716 # CC requires there to be no space between '-K' and 'pic' or 'PIC'.
717 sparc_CC_PICFLAGS = -fpic
718 sparcv9_CC_PICFLAGS = -fPIC
719 i386_CC_PICFLAGS = -fpic
720 amd64_CC_PICFLAGS = -fpic
721 CC_PICFLAGS = $($(MACH)_CC_PICFLAGS)
722 CC_PICFLAGS64 = $($(MACH64)_CC_PICFLAGS)
728 # Default label for CTF sections
730 CTFCVTFLAGS= -i -L VERSION
733 # Override to pass module-specific flags to ctfmerge. Currently used only by
734 # krtld to turn on fuzzy matching, and source-level debugging to inhibit
739 CTFCONVERT_O = $(CTFCONVERT) $(CTFCVTFLAGS) $@
741 # Rules (normally from make.rules) and macros which are used for post
742 # processing files. Normally, these do stripping of the comment section
744 # RELEASE_CM: Should be editted to reflect the release.
745 # POST_PROCESS_O: Post-processing for `.o' files.
746 # POST_PROCESS_A: Post-processing for `.a' files (currently null).
747 # POST_PROCESS_SO: Post-processing for `.so' files.
748 # POST_PROCESS: Post-processing for executable files (no suffix).
749 # Note that these macros are not completely generalized as they are to be
750 # used with the file name to be processed following.
752 # It is left as an exercise to Release Engineering to embellish the generation
753 # of the release comment string.
755 # If this is a standard development build:
756 # compress the comment section (mcs -c)
757 # add the standard comment (mcs -a $(RELEASE_CM))
758 # add the development specific comment (mcs -a $(DEV_CM))
760 # If this is an installation build:
761 # delete the comment section (mcs -d)
762 # add the standard comment (mcs -a $(RELEASE_CM))
763 # add the development specific comment (mcs -a $(DEV_CM))
765 # If this is an release build:
766 # delete the comment section (mcs -d)
767 # add the standard comment (mcs -a $(RELEASE_CM))
769 # The following list of macros are used in the definition of RELEASE_CM
770 # which is used to label all binaries in the build:
772 # RELEASE Specific release of the build, eg: 5.2
773 # RELEASE_MAJOR Major version number part of $(RELEASE)
774 # RELEASE_MINOR Minor version number part of $(RELEASE)
775 # VERSION Version of the build (alpha, beta, Generic)
776 # PATCHID If this is a patch this value should contain
777 # the patchid value (eg: "Generic 100832-01"), otherwise
778 # it will be set to $(VERSION)
779 # RELEASE_DATE Date of the Release Build
780 # PATCH_DATE Date the patch was created, if this is blank it
781 # will default to the RELEASE_DATE
786 RELEASE= $(RELEASE_MAJOR).$(RELEASE_MINOR)
787 VERSION= $(SYSNAME) Development
789 RELEASE_DATE= release date not set
790 PATCH_DATE= $(RELEASE_DATE)
791 RELEASE_CM= "$(SYSNAME) $(RELEASE) $(PATCHID) $(PATCH_DATE)"
792 DEV_CM= "$(SYSNAME) Development: non-nightly build"
794 STRIP_STABS= $(STRIP) -x $@
795 $(SRCDBGBLD)STRIP_STABS= :
799 POST_PROCESS_SO= $(STRIP_STABS)
800 POST_PROCESS= $(STRIP_STABS)
803 # PKGARCHIVE specifies the default location where packages should be
806 PKGARCHIVE=$(SRC)/../../packages/$(MACH)/nightly
809 # The repositories will be created with these publisher settings. To
810 # update an image to the resulting repositories, this must match the
811 # publisher name provided to "pkg set-publisher."
813 PKGPUBLISHER= unleashed
815 # Default build rules which perform comment section post-processing.
818 $(LINK.c) -o $@ $< $(LDLIBS)
821 $(COMPILE.c) $(OUTPUT_OPTION) $< $(CTFCONVERT_HOOK)
824 $(COMPILE.c) -o $% $<
825 $(AR) $(ARFLAGS) $@ $%
828 $(COMPILE.s) -o $@ $<
831 $(COMPILE.s) -o $% $<
832 $(AR) $(ARFLAGS) $@ $%
835 $(LINK.cc) -o $@ $< $(LDLIBS)
838 $(COMPILE.cc) $(OUTPUT_OPTION) $<
841 $(COMPILE.cc) -o $% $<
842 $(AR) $(ARFLAGS) $@ $%
846 $(LINK.c) -o $@ y.tab.c $(LDLIBS)
851 $(COMPILE.c) -o $@ y.tab.c $(CTFCONVERT_HOOK)
857 $(LINK.c) -o $@ $*.c -ll $(LDLIBS)
863 $(COMPILE.c) -o $@ $*.c $(CTFCONVERT_HOOK)
868 $(COMPILE.b) -o $@ $<
874 # Bourne and Korn shell script message catalog build rules.
875 # We extract all gettext strings with sed(1) (being careful to permit
876 # multiple gettext strings on the same line), weed out the dups, and
877 # build the catalogue with awk(1).
882 -e "s/.*gettext *\(\"[^\"]*\"\).*/\1/p" \
884 -e "s/\(.*\)gettext *\"[^\"]*\"\(.*\)/\1\2/" \
886 $< | sort -u | $(AWK) '{ print "msgid\t" $$0 "\nmsgstr" }' > $@
889 # Python and Perl executable and message catalog build rules.
891 .SUFFIXES: .pl .pm .py .pyc
895 $(SED) -e "s@TEXT_DOMAIN@\"$(TEXT_DOMAIN)\"@" $< > $@;
900 -e "1s:^\#!@PYTHON@:\#!$(PYSHEBANG):" \
901 -e "1s:^\#!@TOOLS_PYTHON@:\#!$(TOOLS_PYTHON):" \
902 < $< > $@; $(CHMOD) +x $@
906 $(PYTHON) -mpy_compile $<
907 @[ $(<)c = $@ ] || $(MV) $(<)c $@
910 $(XGETTEXT) $(XGETFLAGS) -d $(<F) $< ;
912 $(SED) "/^domain/d" < $(<F).po > $@ ;
916 # When using xgettext, we want messages to go to the default domain,
917 # rather than the specified one. This special version of the
918 # COMPILE.cpp macro effectively prevents expansion of TEXT_DOMAIN,
919 # causing xgettext to put all messages into the default domain.
921 CPPFORPO=$(COMPILE.cpp:\"$(TEXT_DOMAIN)\"=TEXT_DOMAIN)
931 $(CPPFORPO) y.tab.c > $@
936 $(CPPFORPO) lex.yy.c > $@
940 $(CPPFORPO) $< > $<.i
944 $(CPPFORPO) $< > $<.i
949 $(CPPFORPO) y.tab.c > $<.i
955 $(CPPFORPO) lex.yy.c > $<.i
960 # Rules to perform stylistic checks
962 .SUFFIXES: .x .xml .check .xmlchk