1# 2# CDDL HEADER START 3# 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. 7# 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. 12# 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] 18# 19# CDDL HEADER END 20# 21 22# 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 2021 OmniOS Community Edition (OmniOSce) Association. 31# Copyright 2021 Joyent, Inc. 32# Copyright 2019 RackTop Systems. 33# Copyright 2020 Oxide Computer Company 34# Copyright 2020 Peter Tribble 35# 36 37# 38# Makefile.master, global definitions for system source 39# 40ROOT= /proto 41 42# 43# Adjunct root, containing an additional proto area to be used for headers 44# and libraries. 45# 46ADJUNCT_PROTO= 47# HAVE_ADJUNCT_PROTO - ADJUNCT_PROTO is set to a non-default value 48# NO_ADJUNCT_PROTO - ADJUNCT_PROTO is unset 49# 50# This works by replacing any value in ADJUNCT_PROTO with POUND_SIGN, which 51# only happens if it has some value, and then setting HAVE_ADJUNCT_PROTO 52# oppositely. 53NO_ADJUNCT_PROTO=$(ADJUNCT_PROTO:%=$(POUND_SIGN)) 54$(NO_ADJUNCT_PROTO)HAVE_ADJUNCT_PROTO=$(POUND_SIGN) 55 56# 57# Adjunct for building things that run on the build machine. 58# 59NATIVE_ADJUNCT= /usr 60 61# 62# Compatibility code for FreeBSD etc. 63# 64COMPAT= $(SRC)/compat 65CONTRIB= $(SRC)/contrib 66 67# 68# RELEASE_BUILD should be cleared for final release builds. 69# NOT_RELEASE_BUILD is exactly what the name implies. 70# 71# __GNUC toggles the building of ON components using gcc and related tools. 72# Normally set to `#', set it to `' to do gcc build. 73# 74# The declaration POUND_SIGN is always '#'. This is needed to get around the 75# make feature that '#' is always a comment delimiter, even when escaped or 76# quoted. We use this macro expansion method to get POUND_SIGN rather than 77# always breaking out a shell because the general case can cause a noticable 78# slowdown in build times when so many Makefiles include Makefile.master. 79# 80# While the majority of users are expected to override the setting below 81# with an env file (via nightly or bldenv), if you aren't building that way 82# (ie, you're using "ws" or some other bootstrapping method) then you need 83# this definition in order to avoid the subshell invocation mentioned above. 84# 85 86PRE_POUND= pre\# 87POUND_SIGN= $(PRE_POUND:pre\%=%) 88 89NOT_RELEASE_BUILD= 90RELEASE_BUILD= $(POUND_SIGN) 91$(RELEASE_BUILD)NOT_RELEASE_BUILD= $(POUND_SIGN) 92PATCH_BUILD= $(POUND_SIGN) 93 94# SPARC_BLD is '#' for an Intel build. 95# INTEL_BLD is '#' for a Sparc build. 96SPARC_BLD_1= $(MACH:i386=$(POUND_SIGN)) 97SPARC_BLD= $(SPARC_BLD_1:sparc=) 98INTEL_BLD_1= $(MACH:sparc=$(POUND_SIGN)) 99INTEL_BLD= $(INTEL_BLD_1:i386=) 100 101# The variables below control the compilers used during the build. 102# There are a number of permutations. 103# 104# __GNUC and __SUNC control (and indicate) the primary compiler. Whichever 105# one is not POUND_SIGN is the primary, with the other as the shadow. They 106# may also be used to control entirely compiler-specific Makefile assignments. 107# __GNUC and GCC are the default. 108# 109# __GNUC64 indicates that the 64bit build should use the GNU C compiler. 110# There is no Sun C analogue. 111# 112# The following version-specific options are operative regardless of which 113# compiler is primary, and control the versions of the given compilers to be 114# used. They also allow compiler-version specific Makefile fragments. 115# 116 117__SUNC= $(POUND_SIGN) 118$(__SUNC)__GNUC= $(POUND_SIGN) 119__GNUC64= $(__GNUC) 120 121# Allow build-time "configuration" to enable or disable some things. 122# The default is POUND_SIGN, meaning "not enabled". If the environment 123# passes in an override like ENABLE_SMB_PRINTING= (empty) that will 124# uncomment things in the lower Makefiles to enable the feature. 125ENABLE_SMB_PRINTING= $(POUND_SIGN) 126 127# BUILD_TOOLS is the root of all tools including compilers. 128# ONBLD_TOOLS is the root of all the tools that are part of SUNWonbld. 129 130BUILD_TOOLS= /ws/onnv-tools 131ONBLD_TOOLS= $(BUILD_TOOLS)/onbld 132 133# define runtime JAVA_HOME, primarily for cmd/pools/poold 134JAVA_HOME= /usr/java 135# define buildtime JAVA_ROOT 136JAVA_ROOT= /usr/java 137# Build uses java8 by default. Pass the variable below set to empty 138# string in the environment to override. 139BLD_JAVA_11= $(POUND_SIGN) 140 141GNUC_ROOT= /usr/gcc/7 142GCCLIBDIR= $(GNUC_ROOT)/lib 143GCCLIBDIR64= $(GNUC_ROOT)/lib/$(MACH64) 144 145DOCBOOK_XSL_ROOT= /usr/share/sgml/docbook/xsl-stylesheets 146 147RPCGEN= $(ONBLD_TOOLS)/bin/$(MACH)/rpcgen 148STABS= $(ONBLD_TOOLS)/bin/$(MACH)/stabs 149ELFEXTRACT= $(ONBLD_TOOLS)/bin/$(MACH)/elfextract 150MBH_PATCH= $(ONBLD_TOOLS)/bin/$(MACH)/mbh_patch 151BTXLD= $(ONBLD_TOOLS)/bin/$(MACH)/btxld 152VTFONTCVT= $(ONBLD_TOOLS)/bin/$(MACH)/vtfontcvt 153# echo(1) and true(1) are specified without absolute paths, so that the shell 154# spawned by make(1) may use the built-in versions. This is minimally 155# problematic, as the shell spawned by make(1) is known and under control, the 156# only risk being if the shell falls back to $PATH. 157# 158# We specifically want an echo(1) that does interpolation of escape sequences, 159# which ksh93, /bin/sh, and bash will all provide. 160ECHO= echo 161TRUE= true 162INS= $(ONBLD_TOOLS)/bin/$(MACH)/install 163ED= /usr/bin/ed 164SYMLINK= /usr/bin/ln -s 165LN= /usr/bin/ln 166MKDIR= /usr/bin/mkdir 167CHMOD= /usr/bin/chmod 168MV= /usr/bin/mv -f 169RM= /usr/bin/rm -f 170CUT= /usr/bin/cut 171NM= /usr/bin/nm 172DIFF= /usr/bin/diff 173GREP= /usr/bin/grep 174EGREP= /usr/bin/egrep 175ELFWRAP= /usr/bin/elfwrap 176KSH93= /usr/bin/ksh93 177SED= /usr/bin/sed 178AWK= /usr/bin/nawk 179CP= /usr/bin/cp -f 180MCS= /usr/bin/mcs 181CAT= /usr/bin/cat 182ELFDUMP= /usr/bin/elfdump 183M4= /usr/bin/m4 184GM4= /usr/bin/gm4 185STRIP= /usr/bin/strip 186LEX= /usr/bin/lex 187FLEX= /usr/bin/flex 188YACC= /usr/bin/yacc 189BISON= /usr/bin/bison 190CPP= /usr/lib/cpp 191SH= /usr/bin/sh 192ANSI_CPP= $(GNUC_ROOT)/bin/cpp 193JAVAC= $(JAVA_ROOT)/bin/javac 194JAVADOC= $(JAVA_ROOT)/bin/javadoc 195JAR= $(JAVA_ROOT)/bin/jar 196CTFCONVERT= $(ONBLD_TOOLS)/bin/$(MACH)/ctfconvert 197CTFDIFF= $(ONBLD_TOOLS)/bin/$(MACH)/ctfdiff 198CTFMERGE= $(ONBLD_TOOLS)/bin/$(MACH)/ctfmerge 199CTFSTABS= $(ONBLD_TOOLS)/bin/$(MACH)/ctfstabs 200CTFSTRIP= $(ONBLD_TOOLS)/bin/$(MACH)/ctfstrip 201NDRGEN= $(ONBLD_TOOLS)/bin/$(MACH)/ndrgen 202GENOFFSETS= $(ONBLD_TOOLS)/bin/genoffsets 203XREF= $(ONBLD_TOOLS)/bin/xref 204FIND= /usr/bin/find 205PERL= /usr/bin/perl 206PERL_VERSION= 5.10.0 207PERL_PKGVERS= -510 208PERL_MACH= i86pc 209$(SPARC_BLD)PERL_MACH= sun4 210PERL_VARIANT= 211PERL_ARCH= $(PERL_MACH)-solaris$(PERL_VARIANT)-64int 212PERL_ARCH64= $(PERL_MACH)-solaris$(PERL_VARIANT)-64 213PYTHON3_VERSION= 3.9 214PYTHON3_PKGVERS= -39 215PYTHON3_SUFFIX= 216PYTHON3= /usr/bin/python$(PYTHON3_VERSION) 217# BUILDPY3b should be overridden in the env file in order to build python 218# modules with a secondary python to aid migration between versions. 219BUILDPY3b= $(POUND_SIGN) 220PYTHON3b_VERSION= 3.5 221PYTHON3b_PKGVERS= -35 222PYTHON3b_SUFFIX= m 223# 224$(BUILDPY3b)PYTHON3b= /usr/bin/python$(PYTHON3b_VERSION) 225TOOLS_PYTHON= $(PYTHON3) 226SORT= /usr/bin/sort 227TR= /usr/bin/tr 228TOUCH= /usr/bin/touch 229WC= /usr/bin/wc 230XARGS= /usr/bin/xargs 231ELFEDIT= /usr/bin/elfedit 232DTRACE= /usr/sbin/dtrace -xnolibs 233UNIQ= /usr/bin/uniq 234TAR= /usr/bin/tar 235ASTBINDIR= /usr/ast/bin 236MSGCC= $(ASTBINDIR)/msgcc 237MSGFMT= /usr/bin/msgfmt -s 238LCDEF= $(ONBLD_TOOLS)/bin/$(MACH)/localedef 239TIC= $(ONBLD_TOOLS)/bin/$(MACH)/tic 240ZIC= $(ONBLD_TOOLS)/bin/$(MACH)/zic 241OPENSSL= /usr/bin/openssl 242CPCGEN= $(ONBLD_TOOLS)/bin/$(MACH)/cpcgen 243GENICONVTBL= $(ONBLD_TOOLS)/bin/$(MACH)/geniconvtbl 244 245DEFAULT_CONSOLE_COLOR= \ 246 -DDEFAULT_ANSI_FOREGROUND=ANSI_COLOR_WHITE \ 247 -DDEFAULT_ANSI_BACKGROUND=ANSI_COLOR_BLACK 248 249FILEMODE= 644 250DIRMODE= 755 251 252# Declare that nothing should be built in parallel. 253# Individual Makefiles can use the .PARALLEL target to declare otherwise. 254.NO_PARALLEL: 255 256# For stylistic checks 257# 258# Note that the X and C checks are not used at this time and may need 259# modification when they are actually used. 260# 261CSTYLE= $(ONBLD_TOOLS)/bin/cstyle 262CSTYLE_TAIL= 263HDRCHK= $(ONBLD_TOOLS)/bin/hdrchk 264HDRCHK_TAIL= 265JSTYLE= $(ONBLD_TOOLS)/bin/jstyle 266 267DOT_H_CHECK= \ 268 @$(ECHO) "checking $<"; $(CSTYLE) $< $(CSTYLE_TAIL); \ 269 $(HDRCHK) $< $(HDRCHK_TAIL) 270 271DOT_X_CHECK= \ 272 @$(ECHO) "checking $<"; $(RPCGEN) -C -h $< | $(CSTYLE) $(CSTYLE_TAIL); \ 273 $(RPCGEN) -C -h $< | $(HDRCHK) $< $(HDRCHK_TAIL) 274 275DOT_C_CHECK= \ 276 @$(ECHO) "checking $<"; $(CSTYLE) $< $(CSTYLE_TAIL) 277 278MANIFEST_CHECK= \ 279 @$(ECHO) "checking $<"; \ 280 SVCCFG_DTD=$(SRC)/cmd/svc/dtd/service_bundle.dtd.1 \ 281 SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/global.db \ 282 SVCCFG_CONFIGD_PATH=$(SRC)/cmd/svc/configd/svc.configd-native \ 283 $(SRC)/cmd/svc/svccfg/svccfg-native validate $< 284 285INS.file= $(RM) $@; $(INS) -s -m $(FILEMODE) -f $(@D) $< 286INS.dir= $(INS) -s -d -m $(DIRMODE) $@ 287# installs and renames at once 288# 289INS.rename= $(INS.file); $(MV) $(@D)/$(<F) $@ 290 291# install a link 292INSLINKTARGET= $< 293INS.link= $(RM) $@; $(LN) $(INSLINKTARGET) $@ 294INS.symlink= $(RM) $@; $(SYMLINK) $(INSLINKTARGET) $@ 295 296# The path to python that will be used for the shebang line when installing 297# python scripts to the proto area. This is overridden by makefiles to 298# select to the correct version. 299PYSHEBANG= $(PYTHON3) 300 301# 302# Python bakes the mtime of the .py file into the compiled .pyc and 303# rebuilds if the baked-in mtime != the mtime of the source file 304# (rather than only if it's less than), thus when installing python 305# files we must make certain to not adjust the mtime of the source 306# (.py) file. 307# 308INS.pyfile= $(RM) $@; $(SED) \ 309 -e "1s:^\#!@PYTHON@:\#!$(PYSHEBANG):" \ 310 -e "1s:^\#!@TOOLS_PYTHON@:\#!$(TOOLS_PYTHON):" \ 311 < $< > $@; $(CHMOD) $(FILEMODE) $@; $(TOUCH) -r $< $@ 312 313# MACH must be set in the shell environment per uname -p on the build host 314# More specific architecture variables should be set in lower makefiles. 315# 316# MACH64 is derived from MACH, and BUILD64 is set to `#' for 317# architectures on which we do not build 64-bit versions. 318# (There are no such architectures at the moment.) 319# 320# Set BUILD64=# in the environment to disable 64-bit amd64 321# builds on i386 machines. 322 323MACH64_1= $(MACH:sparc=sparcv9) 324MACH64= $(MACH64_1:i386=amd64) 325 326MACH32_1= $(MACH:sparc=sparcv7) 327MACH32= $(MACH32_1:i386=i86) 328 329sparc_BUILD64= 330i386_BUILD64= 331BUILD64= $($(MACH)_BUILD64) 332 333# 334# C compiler mode. Future compilers may change the default on us, 335# so force extended ANSI mode globally. Lower level makefiles can 336# override this by setting CCMODE. 337# 338CCMODE= -Xa 339CCMODE64= -Xa 340 341# 342# C compiler verbose mode. This is so we can enable it globally, 343# but turn it off in the lower level makefiles of things we cannot 344# (or aren't going to) fix. 345# 346CCVERBOSE= -v 347 348# set this to the secret flag "-Wc,-Qiselect-v9abiwarn=1" to get warnings 349# from the compiler about places the -xarch=v9 may differ from -xarch=v9c. 350V9ABIWARN= 351 352# set this to the secret flag "-Wc,-Qiselect-regsym=0" to disable register 353# symbols (used to detect conflicts between objects that use global registers) 354# we disable this now for safety, and because genunix doesn't link with 355# this feature (the v9 default) enabled. 356# 357# REGSYM is separate since the C++ driver syntax is different. 358CCREGSYM= -Wc,-Qiselect-regsym=0 359CCCREGSYM= -Qoption cg -Qiselect-regsym=0 360 361# Prevent the removal of static symbols by the SPARC code generator (cg). 362# The x86 code generator (ube) does not remove such symbols and as such 363# using this workaround is not applicable for x86. 364# 365CCSTATICSYM= -Wc,-Qassembler-ounrefsym=0 366# 367# generate 32-bit addresses in the v9 kernel. Saves memory. 368CCABS32= -Wc,-xcode=abs32 369# 370# generate v9 code which tolerates callers using the v7 ABI, for the sake of 371# system calls. 372CC32BITCALLERS= -_gcc=-massume-32bit-callers 373 374# GCC, especially, is increasingly beginning to auto-inline functions and 375# sadly does so separately not under the general -fno-inline-functions 376# Additionally, we wish to prevent optimisations which cause GCC to clone 377# functions -- in particular, these may cause unhelpful symbols to be 378# emitted instead of function names 379CCNOAUTOINLINE= \ 380 -_gcc=-fno-inline-small-functions \ 381 -_gcc=-fno-inline-functions-called-once \ 382 -_gcc=-fno-ipa-cp \ 383 -_gcc=-fno-ipa-icf \ 384 -_gcc=-fno-clone-functions 385 386# GCC may put functions in different named sub-sections of .text based on 387# their presumed calling frequency. At least in the kernel, where we actually 388# deliver relocatable objects, we don't want this to happen. 389# 390# Since at present we don't benefit from this even in userland, we disable it globally, 391# but the application of this may move into usr/src/uts/ in future. 392CCNOREORDER= -_gcc=-fno-reorder-functions \ 393 -_gcc=-fno-reorder-blocks-and-partition 394 395# 396# gcc has a rather aggressive optimization on by default that infers loop 397# bounds based on undefined behavior (!!). This can lead to some VERY 398# surprising optimizations -- ones that may be technically correct in the 399# strictest sense but also result in incorrect program behavior. We turn 400# this optimization off, with extreme prejudice. 401# 402CCNOAGGRESSIVELOOPS= -_gcc=-fno-aggressive-loop-optimizations 403 404# 405# gcc has a limit on the maximum size of a function which will be inlined 406# in the presence of the 'inline' keyword; this limit varies between versions 407# of gcc. For consistent output and to ensure that some of the slightly larger 408# functions are inlined as intended, we specify the limit explicitly. 409# 410CCINLINESIZE= -_gcc=--param=max-inline-insns-single=450 411CCWARNINLINE= -_gcc=-Winline 412 413# 414# Options to control which version of stack-protector we enable. This 415# gives us a bit of flexibility and is unfortunately necessary as some 416# modules do not function correctly with our defaults (qede). 417# 418# o STACKPROTECT_ Sets the appropriate version for the compiler 419# o STACKPROTECT_strong Sets us to use strong on all of the 420# compilers it supports. This is the same 421# as the default. 422# 423# o STACKPROTECT_none Disables the stack protector. 424# 425# o STACKPROTECT_all Enables it for everything. 426# 427# o STACKPROTECT_basic Enables the basic stack protector. 428# 429# -fstack-protector-strong is not available in gcc4 which is why we 430# have per-compiler versions below. These are not added to the default 431# global CFLAGS at this time as it's being incrementally enabled 432# throughout the build. 433# 434STACKPROTECT_ = -_gcc=-fstack-protector-strong 435 436STACKPROTECT_strong = $(STACKPROTECT_) 437STACKPROTECT_none = 438STACKPROTECT_all = -_gcc=-fstack-protector-all 439STACKPROTECT_basic = -_gcc=-fstack-protector 440 441STACKPROTECT_LD_ = -lssp_ns 442STACKPROTECT_LD_none = 443STACKPROTECT_LD_all = $(STACKPROTECT_LD_) 444STACKPROTECT_LD_basic = $(STACKPROTECT_LD_) 445 446CCSTACKPROTECT= $(STACKPROTECT_$(STACKPROTECT)) 447LDSTACKPROTECT= $(STACKPROTECT_LD_$(STACKPROTECT)) 448 449# One optimization the compiler might perform is to turn this: 450# #pragma weak foo 451# extern int foo; 452# if (&foo) 453# foo = 5; 454# into 455# foo = 5; 456# Since we do some of this (foo might be referenced in common kernel code 457# but provided only for some cpu modules or platforms), we disable this 458# optimization. 459# 460sparc_CCUNBOUND = -Wd,-xsafe=unboundsym 461i386_CCUNBOUND = 462CCUNBOUND = $($(MACH)_CCUNBOUND) 463 464# 465# compiler '-xarch' flag. This is here to centralize it and make it 466# overridable for testing. 467sparc_XARCH= -m32 468sparcv9_XARCH= -m64 469i386_XARCH= -m32 470amd64_XARCH= -m64 -Ui386 -U__i386 471 472# 473# These flags define what we need to be 'standalone' i.e. -not- part 474# of the rather more cosy userland environment. This basically means 475# the kernel. 476# 477# XX64 future versions of gcc will make -mcmodel=kernel imply -mno-red-zone 478# 479sparc_STAND_FLAGS= -_gcc=-ffreestanding 480sparcv9_STAND_FLAGS= -_gcc=-ffreestanding 481# Disabling MMX also disables 3DNow, disabling SSE also disables all later 482# additions to SSE (SSE2, AVX ,etc.) 483NO_SIMD= -_gcc=-mno-mmx -_gcc=-mno-sse 484i386_STAND_FLAGS= -_gcc=-ffreestanding $(NO_SIMD) 485amd64_STAND_FLAGS= -xmodel=kernel $(NO_SIMD) 486 487SAVEARGS= -Wu,-save_args 488amd64_STAND_FLAGS += $(SAVEARGS) 489 490STAND_FLAGS_32 = $($(MACH)_STAND_FLAGS) 491STAND_FLAGS_64 = $($(MACH64)_STAND_FLAGS) 492 493# 494# disable the incremental linker 495ILDOFF= -xildoff 496# 497XFFLAG= -xF=%all 498XESS= -xs 499XSTRCONST= -xstrconst 500 501# 502# turn warnings into errors (C) 503CERRWARN = -errtags=yes -errwarn=%all 504CERRWARN += -erroff=E_EMPTY_TRANSLATION_UNIT 505CERRWARN += -erroff=E_STATEMENT_NOT_REACHED 506 507CERRWARN += -_gcc=-Wno-missing-braces 508CERRWARN += -_gcc=-Wno-sign-compare 509CERRWARN += -_gcc=-Wno-unknown-pragmas 510CERRWARN += -_gcc=-Wno-unused-parameter 511CERRWARN += -_gcc=-Wno-missing-field-initializers 512 513# Unfortunately, this option can misfire very easily and unfixably. 514CERRWARN += -_gcc=-Wno-array-bounds 515 516CNOWARN_UNINIT = -_gcc=-Wno-maybe-uninitialized 517 518CERRWARN += -_smatch=-p=illumos_user 519include $(SRC)/Makefile.smatch 520 521# 522# turn warnings into errors (C++) 523CCERRWARN = -errtags=yes -errwarn=%all 524CCERRWARN += -erroff=E_EMPTY_TRANSLATION_UNIT 525CCERRWARN += -erroff=E_STATEMENT_NOT_REACHED 526 527CCERRWARN += -_gcc=-Wno-missing-braces 528CCERRWARN += -_gcc=-Wno-sign-compare 529CCERRWARN += -_gcc=-Wno-unknown-pragmas 530CCERRWARN += -_gcc=-Wno-unused-parameter 531CCERRWARN += -_gcc=-Wno-missing-field-initializers 532 533# C standard 534CSTD_GNU89= -xc99=%none 535CSTD_GNU99= -xc99=%all 536CSTD= $(CSTD_GNU89) 537 538# In most places, assignments to these macros should be appended with += 539# (CPPFLAGS.first allows values to be prepended to CPPFLAGS). 540sparc_CFLAGS= $(sparc_XARCH) $(CCSTATICSYM) 541sparcv9_CFLAGS= $(sparcv9_XARCH) -dalign $(CCVERBOSE) $(V9ABIWARN) $(CCREGSYM) \ 542 $(CCSTATICSYM) 543i386_CFLAGS= $(i386_XARCH) 544amd64_CFLAGS= $(amd64_XARCH) 545 546$(MACH)_ASFLAGS= $($(MACH)_CFLAGS) 547$(MACH64)_ASFLAGS= $($(MACH64)_CFLAGS) 548 549ASFLAGS= $($(MACH)_ASFLAGS) 550ASFLAGS64= $($(MACH64)_ASFLAGS) 551 552# 553sparc_COPTFLAG= -xO3 554sparcv9_COPTFLAG= -xO3 555i386_COPTFLAG= -O 556amd64_COPTFLAG= -xO3 557 558COPTFLAG= $($(MACH)_COPTFLAG) 559COPTFLAG64= $($(MACH64)_COPTFLAG) 560 561# When -g is used, the compiler globalizes static objects 562# (gives them a unique prefix). Disable that. 563CNOGLOBAL= -W0,-noglobal 564 565# Direct the Sun Studio compiler to use a static globalization prefix based on the 566# name of the module rather than something unique. Otherwise, objects 567# will not build deterministically, as subsequent compilations of identical 568# source will yeild objects that always look different. 569# 570# In the same spirit, this will also remove the date from the N_OPT stab. 571CGLOBALSTATIC= -W0,-xglobalstatic 572 573# Sometimes we want all symbols and types in debugging information even 574# if they aren't used. 575CALLSYMS= -_gcc=-fno-eliminate-unused-debug-symbols \ 576 -_gcc=-fno-eliminate-unused-debug-types 577 578# 579# We force the compilers to generate the debugging information best understood 580# by the CTF tools. With Sun Studio this is stabs due to bugs in the Studio 581# compilers. With GCC this is DWARF v2. 582# 583DEBUGFORMAT= -_cc=-xdebugformat=stabs -_gcc=-gdwarf-2 \ 584 -_gcc10=-gstrict-dwarf -_gcc11=-gstrict-dwarf 585 586# 587# Ask the compiler to include debugging information 588# 589CCGDEBUG= -g $(DEBUGFORMAT) 590 591# 592# Flags used to build in debug mode for ctf generation. 593# 594CTF_FLAGS_sparc = $(CCGDEBUG) -Wc,-Qiselect-T1 $(CSTD) $(CNOGLOBAL) 595CTF_FLAGS_i386 = $(CCGDEBUG) $(CSTD) $(CNOGLOBAL) 596 597CTF_FLAGS_sparcv9 = $(CTF_FLAGS_sparc) 598CTF_FLAGS_amd64 = $(CTF_FLAGS_i386) 599 600# Sun Studio produces broken userland code when saving arguments. 601$(__GNUC)CTF_FLAGS_amd64 += $(SAVEARGS) 602 603CTF_FLAGS_32 = $(CTF_FLAGS_$(MACH)) 604CTF_FLAGS_64 = $(CTF_FLAGS_$(MACH64)) 605CTF_FLAGS = $(CTF_FLAGS_32) 606 607# 608# Flags used with genoffsets 609# 610GENOFFSETS_FLAGS = $(CALLSYMS) 611 612OFFSETS_CREATE = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \ 613 $(CW) --noecho $(CW_CC_COMPILERS) -- $(GENOFFSETS_FLAGS) \ 614 $(CFLAGS) $(CPPFLAGS) 615 616OFFSETS_CREATE64 = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \ 617 $(CW) --noecho $(CW_CC_COMPILERS) -- $(GENOFFSETS_FLAGS) \ 618 $(CFLAGS64) $(CPPFLAGS) 619 620# 621# tradeoff time for space (smaller is better) 622# 623sparc_SPACEFLAG = -xspace -W0,-Lt 624sparcv9_SPACEFLAG = -xspace -W0,-Lt 625i386_SPACEFLAG = -xspace 626amd64_SPACEFLAG = 627 628SPACEFLAG = $($(MACH)_SPACEFLAG) 629SPACEFLAG64 = $($(MACH64)_SPACEFLAG) 630 631# 632# The Sun Studio 11 compiler has changed the behaviour of integer 633# wrap arounds and so a flag is needed to use the legacy behaviour 634# (without this flag panics/hangs could be exposed within the source). 635# 636sparc_IROPTFLAG = -W2,-xwrap_int 637sparcv9_IROPTFLAG = -W2,-xwrap_int 638i386_IROPTFLAG = 639amd64_IROPTFLAG = 640 641IROPTFLAG = $($(MACH)_IROPTFLAG) 642IROPTFLAG64 = $($(MACH64)_IROPTFLAG) 643 644sparc_XREGSFLAG = -xregs=no%appl 645sparcv9_XREGSFLAG = -xregs=no%appl 646i386_XREGSFLAG = 647amd64_XREGSFLAG = 648 649XREGSFLAG = $($(MACH)_XREGSFLAG) 650XREGSFLAG64 = $($(MACH64)_XREGSFLAG) 651 652# dmake SOURCEDEBUG=yes ... enables source-level debugging information, and 653# avoids stripping it. 654SOURCEDEBUG = $(POUND_SIGN) 655SRCDBGBLD = $(SOURCEDEBUG:yes=) 656 657# 658# These variables are intended ONLY for use by developers to safely pass extra 659# flags to the compilers without unintentionally overriding Makefile-set 660# flags. They should NEVER be set to any value in a Makefile. 661# 662# They come last in the associated FLAGS variable such that they can 663# explicitly override things if necessary, there are gaps in this, but it's 664# the best we can manage. 665# 666CUSERFLAGS = 667CUSERFLAGS64 = $(CUSERFLAGS) 668CCUSERFLAGS = 669CCUSERFLAGS64 = $(CCUSERFLAGS) 670 671CSOURCEDEBUGFLAGS = 672CCSOURCEDEBUGFLAGS = 673$(SRCDBGBLD)CSOURCEDEBUGFLAGS = $(CCGDEBUG) -xs 674$(SRCDBGBLD)CCSOURCEDEBUGFLAGS = $(CCGDEBUG) -xs 675 676CFLAGS= $(COPTFLAG) $($(MACH)_CFLAGS) $(SPACEFLAG) $(CCMODE) \ 677 $(ILDOFF) $(CERRWARN) $(CSTD) $(CCUNBOUND) $(IROPTFLAG) \ 678 $(CGLOBALSTATIC) $(CCNOAUTOINLINE) $(CCNOREORDER) \ 679 $(CCNOAGGRESSIVELOOPS) $(CCINLINESIZE) \ 680 $(CSOURCEDEBUGFLAGS) $(CUSERFLAGS) 681CFLAGS64= $(COPTFLAG64) $($(MACH64)_CFLAGS) $(SPACEFLAG64) $(CCMODE64) \ 682 $(ILDOFF) $(CERRWARN) $(CSTD) $(CCUNBOUND) $(IROPTFLAG64) \ 683 $(CGLOBALSTATIC) $(CCNOAUTOINLINE) $(CCNOREORDER) \ 684 $(CCNOAGGRESSIVELOOPS) $(CCINLINESIZE) \ 685 $(CSOURCEDEBUGFLAGS) $(CUSERFLAGS64) 686# 687# Flags that are used to build parts of the code that are subsequently 688# run on the build machine (also known as the NATIVE_BUILD). 689# 690NATIVE_CFLAGS= $(COPTFLAG) $($(NATIVE_MACH)_CFLAGS) $(CCMODE) \ 691 $(ILDOFF) $(CERRWARN) $(CSTD) $($(NATIVE_MACH)_CCUNBOUND) \ 692 $(IROPTFLAG) $(CGLOBALSTATIC) $(CCNOAUTOINLINE) \ 693 $(CCNOREORDER) $(CCNOAGGRESSIVELOOPS) $(CCINLINESIZE) \ 694 $(CSOURCEDEBUGFLAGS) $(CUSERFLAGS) 695 696NATIVE_CCFLAGS= $(CCOPTFLAG) $($(NATIVE_MACH)_CCFLAGS) $(CCSOURCEDEBUGFLAGS) \ 697 $(CCUSERFLAGS) 698 699NATIVE_CFLAGS64= $(COPTFLAG64) $($(NATIVE_MACH64)_CFLAGS) $(CCMODE64) \ 700 $(ILDOFF) $(CERRWARN) $(CSTD) $($(NATIVE_MACH64)_CCUNBOUND) \ 701 $(IROPTFLAG64) $(CGLOBALSTATIC) $(CCNOAUTOINLINE) \ 702 $(CCNOREORDER) $(CCNOAGGRESSIVELOOPS) $(CCINLINESIZE) \ 703 $(CSOURCEDEBUGFLAGS) $(CUSERFLAGS64) 704 705NATIVE_CCFLAGS64= $(CCOPTFLAG64) $($(NATIVE_MACH64)_CCFLAGS) \ 706 $(CCSOURCEDEBUGFLAGS) $(CCUSERFLAGS64) 707 708DTEXTDOM=-DTEXT_DOMAIN=\"$(TEXT_DOMAIN)\" # For messaging. 709DTS_ERRNO=-D_TS_ERRNO 710CPPFLAGS.first= # Please keep empty. Only lower makefiles should set this. 711CPPFLAGS.master=$(DTEXTDOM) $(DTS_ERRNO) \ 712 $(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4) \ 713 $(ADJUNCT_PROTO:%=-I%/usr/include) 714CPPFLAGS.native=$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) \ 715 $(ENVCPPFLAGS4) -I$(NATIVE_ADJUNCT)/include 716CPPFLAGS= $(CPPFLAGS.first) $(CPPFLAGS.master) 717AS_CPPFLAGS= $(CPPFLAGS.first) $(CPPFLAGS.master) 718JAVAFLAGS= -source 7 -target 7 -Xlint:deprecation,-options 719$(BLD_JAVA_11)JAVAFLAGS= -source 7 -target 7 -Xlint:-options 720 721# 722# For source message catalogue 723# 724.SUFFIXES: $(SUFFIXES) .i .po 725MSGROOT= $(ROOT)/catalog 726MSGDOMAIN= $(MSGROOT)/$(TEXT_DOMAIN) 727MSGDOMAINPOFILE = $(MSGDOMAIN)/$(POFILE) 728DCMSGDOMAIN= $(MSGROOT)/LC_TIME/$(TEXT_DOMAIN) 729DCMSGDOMAINPOFILE = $(DCMSGDOMAIN)/$(DCFILE:.dc=.po) 730 731CLOBBERFILES += $(POFILE) $(POFILES) 732COMPILE.cpp= $(CC) -E -C $(CFLAGS) $(CPPFLAGS) 733XGETTEXT= /usr/bin/xgettext 734XGETFLAGS= -c TRANSLATION_NOTE 735GNUXGETTEXT= /usr/gnu/bin/xgettext 736GNUXGETFLAGS= --add-comments=TRANSLATION_NOTE --keyword=_ \ 737 --strict --no-location --omit-header 738BUILD.po= $(XGETTEXT) $(XGETFLAGS) -d $(<F) $<.i ;\ 739 $(RM) $@ ;\ 740 $(SED) "/^domain/d" < $(<F).po > $@ ;\ 741 $(RM) $(<F).po $<.i 742 743# 744# This is overwritten by local Makefile when PROG is a list. 745# 746POFILE= $(PROG).po 747 748sparc_CCFLAGS= $(sparc_XARCH) -cg92 -compat=4 \ 749 -Qoption ccfe -messages=no%anachronism \ 750 $(CCERRWARN) 751sparcv9_CCFLAGS= $(sparcv9_XARCH) -dalign -compat=5 \ 752 -Qoption ccfe -messages=no%anachronism \ 753 -Qoption ccfe -features=no%conststrings \ 754 $(CCCREGSYM) \ 755 $(CCERRWARN) 756i386_CCFLAGS= $(i386_XARCH) -compat=4 \ 757 -Qoption ccfe -messages=no%anachronism \ 758 -Qoption ccfe -features=no%conststrings \ 759 $(CCERRWARN) 760amd64_CCFLAGS= $(amd64_XARCH) -compat=5 \ 761 -Qoption ccfe -messages=no%anachronism \ 762 -Qoption ccfe -features=no%conststrings \ 763 $(CCERRWARN) 764 765sparc_CCOPTFLAG= -O 766sparcv9_CCOPTFLAG= -O 767i386_CCOPTFLAG= -O 768amd64_CCOPTFLAG= -O 769 770CCOPTFLAG= $($(MACH)_CCOPTFLAG) 771CCOPTFLAG64= $($(MACH64)_CCOPTFLAG) 772CCFLAGS= $(CCOPTFLAG) $($(MACH)_CCFLAGS) $(CCSOURCEDEBUGFLAGS) \ 773 $(CCUSERFLAGS) 774CCFLAGS64= $(CCOPTFLAG64) $($(MACH64)_CCFLAGS) $(CCSOURCEDEBUGFLAGS) \ 775 $(CCUSERFLAGS64) 776 777# 778# 779# 780ELFWRAP_FLAGS = 781ELFWRAP_FLAGS64 = -64 782 783# 784# Various mapfiles that are used throughout the build, and delivered to 785# /usr/lib/ld. 786# 787MAPFILE.NED_i386 = $(SRC)/common/mapfiles/common/map.noexdata 788MAPFILE.NED_sparc = 789MAPFILE.NED = $(MAPFILE.NED_$(MACH)) 790MAPFILE.PGA = $(SRC)/common/mapfiles/common/map.pagealign 791MAPFILE.NES = $(SRC)/common/mapfiles/common/map.noexstk 792MAPFILE.FLT = $(SRC)/common/mapfiles/common/map.filter 793MAPFILE.LEX = $(SRC)/common/mapfiles/common/map.lex.yy 794 795# 796# Generated mapfiles that are compiler specific, and used throughout the 797# build. These mapfiles are not delivered in /usr/lib/ld. 798# 799MAPFILE.NGB_sparc= $(SRC)/common/mapfiles/gen/sparc_cc_map.noexeglobs 800$(__GNUC64)MAPFILE.NGB_sparc= \ 801 $(SRC)/common/mapfiles/gen/sparc_gcc_map.noexeglobs 802MAPFILE.NGB_sparcv9= $(SRC)/common/mapfiles/gen/sparcv9_cc_map.noexeglobs 803$(__GNUC64)MAPFILE.NGB_sparcv9= \ 804 $(SRC)/common/mapfiles/gen/sparcv9_gcc_map.noexeglobs 805MAPFILE.NGB_i386= $(SRC)/common/mapfiles/gen/i386_cc_map.noexeglobs 806$(__GNUC64)MAPFILE.NGB_i386= \ 807 $(SRC)/common/mapfiles/gen/i386_gcc_map.noexeglobs 808MAPFILE.NGB_amd64= $(SRC)/common/mapfiles/gen/amd64_cc_map.noexeglobs 809$(__GNUC64)MAPFILE.NGB_amd64= \ 810 $(SRC)/common/mapfiles/gen/amd64_gcc_map.noexeglobs 811MAPFILE.NGB = $(MAPFILE.NGB_$(MACH)) 812 813# 814# A generic interface mapfile name, used by various dynamic objects to define 815# the interfaces and interposers the object must export. 816# 817MAPFILE.INT = mapfile-intf 818 819# 820# LDLIBS32 and LDLIBS64 can be set in the environment to override the following 821# assignments. 822# 823# These environment settings make sure that no libraries are searched outside 824# of the local workspace proto area: 825# LDLIBS32=-YP,$ROOT/lib:$ROOT/usr/lib 826# LDLIBS64=-YP,$ROOT/lib/$MACH64:$ROOT/usr/lib/$MACH64 827# 828LDLIBS32 = $(ENVLDLIBS1) $(ENVLDLIBS2) $(ENVLDLIBS3) 829LDLIBS32 += $(ADJUNCT_PROTO:%=-L%/usr/lib -L%/lib) 830LDLIBS.cmd = $(LDLIBS32) 831LDLIBS.lib = $(LDLIBS32) 832 833LDLIBS64 = $(ENVLDLIBS1:%=%/$(MACH64)) \ 834 $(ENVLDLIBS2:%=%/$(MACH64)) \ 835 $(ENVLDLIBS3:%=%/$(MACH64)) 836LDLIBS64 += $(ADJUNCT_PROTO:%=-L%/usr/lib/$(MACH64) -L%/lib/$(MACH64)) 837 838# 839# Define compilation macros. 840# 841COMPILE.c= $(CC) $(CFLAGS) $(CPPFLAGS) -c 842COMPILE64.c= $(CC) $(CFLAGS64) $(CPPFLAGS) -c 843COMPILE.cc= $(CCC) $(CCFLAGS) $(CPPFLAGS) -c 844COMPILE64.cc= $(CCC) $(CCFLAGS64) $(CPPFLAGS) -c 845COMPILE.s= $(AS) $(ASFLAGS) $(AS_CPPFLAGS) -c 846COMPILE64.s= $(AS) $(ASFLAGS64) $(AS_CPPFLAGS) -c 847COMPILE.d= $(DTRACE) -G -32 848COMPILE64.d= $(DTRACE) -G -64 849COMPILE.b= $(ELFWRAP) $(ELFWRAP_FLAGS$(CLASS)) 850COMPILE64.b= $(ELFWRAP) $(ELFWRAP_FLAGS$(CLASS)) 851 852CLASSPATH= . 853COMPILE.java= $(JAVAC) $(JAVAFLAGS) -classpath $(CLASSPATH) 854 855# 856# Link time macros 857# 858CCNEEDED = -lC 859CCEXTNEEDED = -lCrun -lCstd 860NATIVECCNEEDED = -lC 861$(__GNUC)CCNEEDED = -L$(GCCLIBDIR) -lstdc++ -lgcc_s 862$(__GNUC)CCEXTNEEDED = $(CCNEEDED) 863$(__GNUC)NATIVECCNEEDED = -R$(GCCLIBDIR) -L$(GCCLIBDIR) -lstdc++ -lgcc_s 864 865CCNEEDED64 = -lCrun 866CCEXTNEEDED64 = -lCrun -lCstd 867NATIVECCNEEDED64 = -lCrun 868$(__GNUC64)CCNEEDED64 = -L$(GCCLIBDIR) -lstdc++ -lgcc_s 869$(__GNUC64)NATIVECCNEEDED64 = -R$(GCCLIBDIR) -L$(GCCLIBDIR) -lstdc++ -lgcc_s 870$(__GNUC64)CCEXTNEEDED = $(CCNEEDED64) 871 872# Libraries we expect to use natively on the build machine 873NATIVE_LIBS= 874 875LDCHECKS = $(ZASSERTDEFLIB) $(ZGUIDANCE) $(ZFATALWARNINGS) 876LDCHECKS += $(NATIVE_LIBS:%=$(ZASSERTDEFLIB)=%) 877 878LINK.c= $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(LDCHECKS) 879LINK64.c= $(CC) $(CFLAGS64) $(CPPFLAGS) $(LDFLAGS) $(LDCHECKS) 880NORUNPATH= -norunpath -nolib 881LINK.cc= $(CCC) $(CCFLAGS) $(CPPFLAGS) $(NORUNPATH) \ 882 $(LDFLAGS) $(CCNEEDED) $(LDCHECKS) 883LINK64.cc= $(CCC) $(CCFLAGS64) $(CPPFLAGS) $(NORUNPATH) \ 884 $(LDFLAGS) $(CCNEEDED64) $(LDCHECKS) 885 886# For some future builds, NATIVE_MACH and MACH might be different. 887# Therefore, NATIVE_MACH needs to be redefined in the 888# environment as `uname -p` to override this macro. 889# 890# For now at least, we cross-compile amd64 on i386 machines. 891NATIVE_MACH= $(MACH:amd64=i386) 892NATIVE_MACH64= $(MACH64) 893 894# Define native compilation macros 895# 896 897# Base directory where compilers are loaded. 898# Defined here so it can be overridden by developer. 899# 900SPRO_ROOT= $(BUILD_TOOLS)/SUNWspro 901SPRO_VROOT= $(SPRO_ROOT)/SS12 902GNU_ROOT= /usr 903 904$(__GNUC)PRIMARY_CC= gcc7,$(GNUC_ROOT)/bin/gcc,gnu 905$(__SUNC)PRIMARY_CC= studio12,$(SPRO_VROOT)/bin/cc,sun 906$(__GNUC)PRIMARY_CCC= gcc7,$(GNUC_ROOT)/bin/g++,gnu 907$(__SUNC)PRIMARY_CCC= studio12,$(SPRO_VROOT)/bin/CC,sun 908 909CW_CC_COMPILERS= $(PRIMARY_CC:%=--primary %) $(SHADOW_CCS:%=--shadow %) 910CW_CCC_COMPILERS= $(PRIMARY_CCC:%=--primary %) $(SHADOW_CCCS:%=--shadow %) 911 912CW_LINKER= --linker $(LD) 913 914# Specify platform compiler versions for languages 915# that we use (currently only c and c++). 916# 917CW= $(ONBLD_TOOLS)/bin/$(MACH)/cw 918 919BUILD_CC= $(CW) $(CW_LINKER) $(CW_CC_COMPILERS) -- 920BUILD_CCC= $(CW) -C $(CW_LINKER) $(CW_CCC_COMPILERS) -- 921BUILD_CPP= /usr/lib/cpp 922BUILD_LD= $(ONBLD_TOOLS)/bin/$(MACH64)/ld 923 924$(MACH)_CC= $(BUILD_CC) 925$(MACH)_CCC= $(BUILD_CCC) 926$(MACH)_CPP= $(BUILD_CPP) 927$(MACH)_LD= $(BUILD_LD) 928$(MACH)_AS= $(BUILD_CC) 929$(MACH64)_CC= $(BUILD_CC) 930$(MACH64)_CCC= $(BUILD_CCC) 931$(MACH64)_CPP= $(BUILD_CPP) 932$(MACH64)_LD= $(BUILD_LD) 933$(MACH64)_AS= $(BUILD_CC) 934 935NATIVECC= $($(NATIVE_MACH)_CC) 936NATIVECCC= $($(NATIVE_MACH)_CCC) 937NATIVECPP= $($(NATIVE_MACH)_CPP) 938NATIVEAS= $($(NATIVE_MACH)_AS) 939NATIVELD= $($(NATIVE_MACH)_LD) 940 941NATIVECC64= $($(NATIVE_MACH64)_CC) 942NATIVECCC64= $($(NATIVE_MACH64)_CCC) 943NATIVECPP64= $($(NATIVE_MACH64)_CPP) 944NATIVEAS64= $($(NATIVE_MACH64)_AS) 945NATIVELD64= $($(NATIVE_MACH64)_LD) 946 947# 948# Makefile.master.64 overrides these settings 949# 950CC= $(NATIVECC) 951CCC= $(NATIVECCC) 952CPP= $(NATIVECPP) 953AS= $(NATIVEAS) 954LD= $(NATIVELD) 955 956CC64= $(NATIVECC64) 957CCC64= $(NATIVECCC64) 958CPP64= $(NATIVECPP64) 959AS64= $(NATIVEAS64) 960LD64= $(NATIVELD64) 961 962# Pass -Y flag to cpp (method of which is release-dependent) 963CCYFLAG= -Y I, 964 965BDIRECT= -Wl,-Bdirect 966BDYNAMIC= -Wl,-Bdynamic 967BLOCAL= -Wl,-Blocal 968BNODIRECT= -Wl,-Bnodirect 969BREDUCE= -Wl,-Breduce 970BSTATIC= -Wl,-Bstatic 971BSYMBOLIC= -Wl,-Bsymbolic 972 973ZDEFS= -Wl,-zdefs 974ZDIRECT= -Wl,-zdirect 975ZIGNORE= -Wl,-zignore 976ZINITFIRST= -Wl,-zinitfirst 977ZINTERPOSE= -Wl,-zinterpose 978ZLAZYLOAD= -Wl,-zlazyload 979ZLOADFLTR= -Wl,-zloadfltr 980ZMULDEFS= -Wl,-zmuldefs 981ZNODEFAULTLIB= -Wl,-znodefaultlib 982ZNODEFS= -Wl,-znodefs 983ZNODELETE= -Wl,-znodelete 984ZNODLOPEN= -Wl,-znodlopen 985ZNODUMP= -Wl,-znodump 986ZNOLAZYLOAD= -Wl,-znolazyload 987ZNOLDYNSYM= -Wl,-znoldynsym 988ZNORELOC= -Wl,-znoreloc 989ZNOVERSION= -Wl,-znoversion 990ZRECORD= -Wl,-zrecord 991ZREDLOCSYM= -Wl,-zredlocsym 992ZTEXT= -Wl,-ztext 993ZVERBOSE= -Wl,-zverbose 994ZASSERTDEFLIB= -Wl,-zassert-deflib 995ZGUIDANCE= -Wl,-zguidance 996ZFATALWARNINGS= -Wl,-zfatal-warnings 997ZASLR= -Wl,-zaslr 998 999GSHARED= -shared 1000CCMT= -mt 1001 1002# Handle different PIC models on different ISAs 1003# (May be overridden by lower-level Makefiles) 1004 1005sparc_C_PICFLAGS = -fpic 1006sparcv9_C_PICFLAGS = -fpic 1007i386_C_PICFLAGS = -fpic 1008amd64_C_PICFLAGS = -fpic 1009C_PICFLAGS = $($(MACH)_C_PICFLAGS) 1010C_PICFLAGS64 = $($(MACH64)_C_PICFLAGS) 1011 1012sparc_C_BIGPICFLAGS = -fPIC 1013sparcv9_C_BIGPICFLAGS = -fPIC 1014i386_C_BIGPICFLAGS = -fPIC 1015amd64_C_BIGPICFLAGS = -fPIC 1016C_BIGPICFLAGS = $($(MACH)_C_BIGPICFLAGS) 1017C_BIGPICFLAGS64 = $($(MACH64)_C_BIGPICFLAGS) 1018 1019# CC requires there to be no space between '-K' and 'pic' or 'PIC'. 1020# and does not support -f 1021sparc_CC_PICFLAGS = -_cc=-Kpic -_gcc=-fpic 1022sparcv9_CC_PICFLAGS = -_cc=-KPIC -_gcc=-fPIC 1023i386_CC_PICFLAGS = -_cc=-Kpic -_gcc=-fpic 1024amd64_CC_PICFLAGS = -_cc=-Kpic -_gcc=-fpic 1025CC_PICFLAGS = $($(MACH)_CC_PICFLAGS) 1026CC_PICFLAGS64 = $($(MACH64)_CC_PICFLAGS) 1027 1028AS_PICFLAGS= $(C_PICFLAGS) 1029AS_BIGPICFLAGS= $(C_BIGPICFLAGS) 1030 1031# 1032# Default label for CTF sections 1033# 1034CTFCVTFLAGS= -L VERSION 1035 1036# 1037# Override to pass module-specific flags to ctfmerge. Currently used only by 1038# krtld to turn on fuzzy matching, and source-level debugging to inhibit 1039# stripping. 1040# 1041CTFMRGFLAGS= 1042 1043CTFCONVERT_O = $(CTFCONVERT) $(CTFCVTFLAGS) $@ 1044 1045# Rules (normally from make.rules) and macros which are used for post 1046# processing files. Normally, these do stripping of the comment section 1047# automatically. 1048# RELEASE_CM: Should be edited to reflect the release. 1049# POST_PROCESS_O: Post-processing for `.o' files (typically C source) 1050# POST_PROCESS_S_O: Post-processing for `.o' files built from asssembly 1051# POST_PROCESS_CC_O: Post-processing for `.o' files built from C++ 1052# POST_PROCESS_A: Post-processing for `.a' files (currently null). 1053# POST_PROCESS_SO: Post-processing for `.so' files. 1054# POST_PROCESS: Post-processing for executable files (no suffix). 1055# 1056# Note that these macros are not completely generalized as they are to be 1057# used with the file name to be processed following. 1058# 1059# It is left as an exercise to Release Engineering to embellish the generation 1060# of the release comment string. 1061# 1062# If this is a standard development build: 1063# compress the comment section (mcs -c) 1064# add the standard comment (mcs -a $(RELEASE_CM)) 1065# add the development specific comment (mcs -a $(DEV_CM)) 1066# 1067# If this is an installation build: 1068# delete the comment section (mcs -d) 1069# add the standard comment (mcs -a $(RELEASE_CM)) 1070# add the development specific comment (mcs -a $(DEV_CM)) 1071# 1072# If this is an release build: 1073# delete the comment section (mcs -d) 1074# add the standard comment (mcs -a $(RELEASE_CM)) 1075# 1076# The following list of macros are used in the definition of RELEASE_CM 1077# which is used to label all binaries in the build: 1078# 1079# RELEASE Specific release of the build, eg: 5.2 1080# RELEASE_MAJOR Major version number part of $(RELEASE) 1081# RELEASE_MINOR Minor version number part of $(RELEASE) 1082# VERSION Version of the build (alpha, beta, Generic) 1083# PATCHID If this is a patch this value should contain 1084# the patchid value (eg: "Generic 100832-01"), otherwise 1085# it will be set to $(VERSION) 1086# RELEASE_DATE Date of the Release Build 1087# PATCH_DATE Date the patch was created, if this is blank it 1088# will default to the RELEASE_DATE 1089# 1090RELEASE_MAJOR= 5 1091RELEASE_MINOR= 11 1092RELEASE= $(RELEASE_MAJOR).$(RELEASE_MINOR) 1093VERSION= SunOS Development 1094PATCHID= $(VERSION) 1095RELEASE_DATE= release date not set 1096PATCH_DATE= $(RELEASE_DATE) 1097RELEASE_CM= "@($(POUND_SIGN))illumos $(PATCHID) $(PATCH_DATE)" 1098DEV_CM_TAIL= development build: $(LOGNAME) 1099DEV_CM= "@($(POUND_SIGN))illumos $(DEV_CM_TAIL)" 1100UTS_LABEL= $(RELEASE) 1101 1102# 1103# The boot banner may be overridden by distributions. Up to five lines can be 1104# specified by overriding the BOOTBANNER macros, and any line that expands to 1105# an empty string will not be printed. See comments in 1106# bootbanner_expand_template() for more details about the template string 1107# format. 1108# 1109BOOTBANNER1= ^o Version ^v ^w-bit 1110BOOTBANNER2= 1111BOOTBANNER3= 1112BOOTBANNER4= 1113BOOTBANNER5= 1114 1115PROCESS_COMMENT= @?${MCS} -d -a $(RELEASE_CM) -a $(DEV_CM) 1116$(RELEASE_BUILD)PROCESS_COMMENT= @?${MCS} -d -a $(RELEASE_CM) 1117 1118STRIP_STABS= $(STRIP) -x $@ 1119$(SRCDBGBLD)STRIP_STABS= : 1120PROCESS_CTF= : 1121 1122POST_PROCESS_O= 1123POST_PROCESS_S_O= 1124POST_PROCESS_CC_O= 1125POST_PROCESS_A= 1126POST_PROCESS_SO= $(PROCESS_COMMENT) $@ ; $(STRIP_STABS) ; \ 1127 $(ELFSIGN_OBJECT) 1128POST_PROCESS= $(PROCESS_COMMENT) $@ ; $(PROCESS_CTF) ; \ 1129 $(STRIP_STABS) ; $(ELFSIGN_OBJECT) 1130 1131# 1132# chk4ubin is a tool that inspects a module for a symbol table 1133# ELF section size which can trigger an OBP bug on older platforms. 1134# This problem affects only specific sun4u bootable modules. 1135# 1136CHK4UBIN= $(ONBLD_TOOLS)/bin/$(MACH)/chk4ubin 1137CHK4UBINFLAGS= 1138CHK4UBINARY= $(CHK4UBIN) $(CHK4UBINFLAGS) $@ 1139 1140# 1141# PKGARCHIVE specifies the default location where packages should be 1142# placed if built. 1143# 1144$(RELEASE_BUILD)PKGARCHIVESUFFIX= -nd 1145PKGARCHIVE=$(SRC)/../../packages/$(MACH)/nightly$(PKGARCHIVESUFFIX) 1146 1147# 1148# The repositories will be created with these publisher settings. To 1149# update an image to the resulting repositories, this must match the 1150# publisher name provided to "pkg set-publisher." 1151# 1152PKGPUBLISHER_REDIST= on-nightly 1153PKGPUBLISHER_NONREDIST= on-extra 1154 1155# Allow suffix rules like the below for .S as well as .s 1156.SUFFIXES: .S 1157 1158# Default build rules which perform comment section post-processing. 1159# 1160.c: 1161 $(LINK.c) -o $@ $< $(LDLIBS) 1162 $(POST_PROCESS) 1163.c.o: 1164 $(COMPILE.c) $(OUTPUT_OPTION) $< $(CTFCONVERT_HOOK) 1165 $(POST_PROCESS_O) 1166.c.a: 1167 $(COMPILE.c) -o $% $< 1168 $(PROCESS_COMMENT) $% 1169 $(AR) $(ARFLAGS) $@ $% 1170 $(RM) $% 1171.s.o: 1172 $(COMPILE.s) -o $@ $< 1173 $(POST_PROCESS_S_O) 1174.s.a: 1175 $(COMPILE.s) -o $% $< 1176 $(PROCESS_COMMENT) $% 1177 $(AR) $(ARFLAGS) $@ $% 1178 $(RM) $% 1179 1180.S.o: 1181 $(COMPILE.s) -o $@ $< 1182 $(POST_PROCESS_S_O) 1183.S.a: 1184 $(COMPILE.s) -o $% $< 1185 $(PROCESS_COMMENT) $% 1186 $(AR) $(ARFLAGS) $@ $% 1187 $(RM) $% 1188.cc: 1189 $(LINK.cc) -o $@ $< $(LDLIBS) 1190 $(POST_PROCESS) 1191.cc.o: 1192 $(COMPILE.cc) $(OUTPUT_OPTION) $< 1193 $(POST_PROCESS_CC_O) 1194.cc.a: 1195 $(COMPILE.cc) -o $% $< 1196 $(AR) $(ARFLAGS) $@ $% 1197 $(PROCESS_COMMENT) $% 1198 $(RM) $% 1199.y: 1200 $(YACC.y) $< 1201 $(LINK.c) -o $@ y.tab.c $(LDLIBS) 1202 $(POST_PROCESS) 1203 $(RM) y.tab.c 1204.y.o: 1205 $(YACC.y) $< 1206 $(COMPILE.c) -o $@ y.tab.c $(CTFCONVERT_HOOK) 1207 $(POST_PROCESS_O) 1208 $(RM) y.tab.c 1209.l: 1210 $(RM) $*.c 1211 $(LEX.l) $< > $*.c 1212 $(LINK.c) -o $@ $*.c -ll $(LDLIBS) 1213 $(POST_PROCESS) 1214 $(RM) $*.c 1215.l.o: 1216 $(RM) $*.c 1217 $(LEX.l) $< > $*.c 1218 $(COMPILE.c) -o $@ $*.c $(CTFCONVERT_HOOK) 1219 $(POST_PROCESS_O) 1220 $(RM) $*.c 1221 1222.bin.o: 1223 $(COMPILE.b) -o $@ $< 1224 $(POST_PROCESS_O) 1225 1226.java.class: 1227 $(COMPILE.java) $< 1228 1229# Bourne and Korn shell script message catalog build rules. 1230# We extract all gettext strings with sed(1) (being careful to permit 1231# multiple gettext strings on the same line), weed out the dups, and 1232# build the catalogue with awk(1). 1233 1234.sh.po .ksh.po: 1235 $(SED) -n -e ":a" \ 1236 -e "h" \ 1237 -e "s/.*gettext *\(\"[^\"]*\"\).*/\1/p" \ 1238 -e "x" \ 1239 -e "s/\(.*\)gettext *\"[^\"]*\"\(.*\)/\1\2/" \ 1240 -e "t a" \ 1241 $< | sort -u | $(AWK) '{ print "msgid\t" $$0 "\nmsgstr" }' > $@ 1242 1243# 1244# Python and Perl executable and message catalog build rules. 1245# 1246.SUFFIXES: .pl .pm .py .pyc 1247 1248.pl: 1249 $(RM) $@; 1250 $(SED) -e "s@TEXT_DOMAIN@\"$(TEXT_DOMAIN)\"@" $< > $@; 1251 $(CHMOD) +x $@ 1252 1253.py: 1254 $(RM) $@; $(SED) \ 1255 -e "1s:^\#!@PYTHON@:\#!$(PYSHEBANG):" \ 1256 -e "1s:^\#!@TOOLS_PYTHON@:\#!$(TOOLS_PYTHON):" \ 1257 < $< > $@; $(CHMOD) +x $@ 1258 1259.py.po: 1260 $(GNUXGETTEXT) $(GNUXGETFLAGS) -d $(<F:%.py=%) $< ; 1261 1262.pl.po .pm.po: 1263 $(XGETTEXT) $(XGETFLAGS) -d $(<F) $< ; 1264 $(RM) $@ ; 1265 $(SED) "/^domain/d" < $(<F).po > $@ ; 1266 $(RM) $(<F).po 1267 1268# 1269# When using xgettext, we want messages to go to the default domain, 1270# rather than the specified one. This special version of the 1271# COMPILE.cpp macro effectively prevents expansion of TEXT_DOMAIN, 1272# causing xgettext to put all messages into the default domain. 1273# 1274CPPFORPO=$(COMPILE.cpp:\"$(TEXT_DOMAIN)\"=TEXT_DOMAIN) 1275 1276.c.i: 1277 $(CPPFORPO) $< > $@ 1278 1279.h.i: 1280 $(CPPFORPO) $< > $@ 1281 1282.y.i: 1283 $(YACC) -d $< 1284 $(CPPFORPO) y.tab.c > $@ 1285 $(RM) y.tab.c 1286 1287.l.i: 1288 $(LEX) $< 1289 $(CPPFORPO) lex.yy.c > $@ 1290 $(RM) lex.yy.c 1291 1292.c.po: 1293 $(CPPFORPO) $< > $<.i 1294 $(BUILD.po) 1295 1296.cc.po: 1297 $(CPPFORPO) $< > $<.i 1298 $(BUILD.po) 1299 1300.y.po: 1301 $(YACC) -d $< 1302 $(CPPFORPO) y.tab.c > $<.i 1303 $(BUILD.po) 1304 $(RM) y.tab.c 1305 1306.l.po: 1307 $(LEX) $< 1308 $(CPPFORPO) lex.yy.c > $<.i 1309 $(BUILD.po) 1310 $(RM) lex.yy.c 1311 1312# 1313# Rules to perform stylistic checks 1314# 1315.SUFFIXES: .x .xml .check .xmlchk 1316 1317.h.check: 1318 $(DOT_H_CHECK) 1319 1320.x.check: 1321 $(DOT_X_CHECK) 1322 1323.xml.xmlchk: 1324 $(MANIFEST_CHECK) 1325