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 # 27 28 # 29 # Makefile.master, global definitions for system source 30 # 31 ROOT= /proto 32 33 # 34 # Adjunct root, containing an additional proto area to be used for headers 35 # and libraries. 36 # 37 ADJUNCT_PROTO= 38 39 # 40 # Adjunct for building things that run on the build machine. 41 # 42 NATIVE_ADJUNCT= /usr 43 44 # 45 # RELEASE_BUILD should be cleared for final release builds. 46 # NOT_RELEASE_BUILD is exactly what the name implies. 47 # 48 # __GNUC toggles the building of ON components using gcc and related tools. 49 # Normally set to `#', set it to `' to do gcc build. 50 # 51 # The declaration POUND_SIGN is always '#'. This is needed to get around the 52 # make feature that '#' is always a comment delimiter, even when escaped or 53 # quoted. We use this macro expansion method to get POUND_SIGN rather than 54 # always breaking out a shell because the general case can cause a noticable 55 # slowdown in build times when so many Makefiles include Makefile.master. 56 # 57 # While the majority of users are expected to override the setting below 58 # with an env file (via nightly or bldenv), if you aren't building that way 59 # (ie, you're using "ws" or some other bootstrapping method) then you need 60 # this definition in order to avoid the subshell invocation mentioned above. 61 # 62 63 PRE_POUND= pre\# 64 POUND_SIGN= $(PRE_POUND:pre\%=%) 65 66 NOT_RELEASE_BUILD= 67 RELEASE_BUILD= $(POUND_SIGN) 68 $(RELEASE_BUILD)NOT_RELEASE_BUILD= $(POUND_SIGN) 69 PATCH_BUILD= $(POUND_SIGN) 70 71 # SPARC_BLD is '#' for an Intel build. 72 # INTEL_BLD is '#' for a Sparc build. 73 SPARC_BLD_2= $(MACH:arm=$(POUND_SIGN)) 74 SPARC_BLD_1= $(MACH:i386=$(POUND_SIGN)) 75 SPARC_BLD= $(SPARC_BLD_1:sparc=) 76 INTEL_BLD_2= $(MACH:arm=$(POUND_SIGN)) 77 INTEL_BLD_1= $(MACH:sparc=$(POUND_SIGN)) 78 INTEL_BLD= $(INTEL_BLD_1:i386=) 79 ARM_BLD_2= $(MACH:i386=$(POUND_SIGN)) 80 ARM_BLD_1= $(MACH:sparc=$(POUND_SIGN)) 81 ARM_BLD= $(ARM_BLD_1:arm=) 82 83 # CROSS_BLD is "#" if NATIVE_MACH and MACH are the same, and the empty string 84 # otherwise. NATIVE_BLD is the opposite 85 CROSS_BLD_1= $(NATIVE_MACH:$(MACH)=$(POUND_SIGN)) 86 CROSS_BLD= $(CROSS_BLD_1:$(NATIVE_MACH)=) 87 NATIVE_BLD= 88 $(CROSS_BLD)NATIVE_BLD= $(POUND_SIGN) 89 90 # The variables below control the compilers used during the build. 91 # There are a number of permutations. 92 # 93 # __GNUC and __SUNC control (and indicate) the primary compiler. Whichever 94 # one is not POUND_SIGN is the primary, with the other as the shadow. They 95 # may also be used to control entirely compiler-specific Makefile assignments. 96 # __GNUC and GCC are the default. 97 # 98 # __GNUC64 indicates that the 64bit build should use the GNU C compiler. 99 # There is no Sun C analogue. 100 # 101 # The following version-specific options are operative regardless of which 102 # compiler is primary, and control the versions of the given compilers to be 103 # used. They also allow compiler-version specific Makefile fragments. 104 # 105 106 __SUNC= $(POUND_SIGN) 107 $(__SUNC)__GNUC= $(POUND_SIGN) 108 __GNUC64= $(__GNUC) 109 110 # CLOSED is the root of the tree that contains source which isn't released 111 # as open source 112 CLOSED= $(SRC)/../closed 113 114 # BUILD_TOOLS is the root of all tools including compilers. 115 # ONBLD_TOOLS is the root of all the tools that are part of SUNWonbld. 116 117 BUILD_TOOLS= /ws/onnv-tools 118 ONBLD_TOOLS= $(BUILD_TOOLS)/onbld 119 120 JAVA_ROOT= /usr/java 121 122 SFW_ROOT= /usr/sfw 123 SFWINCDIR= $(SFW_ROOT)/include 124 SFWLIBDIR= $(SFW_ROOT)/lib 125 SFWLIBDIR64= $(SFW_ROOT)/lib/$(MACH64) 126 127 i386_GCC_ROOT= /opt/gcc/4.4.4 128 sparc_GCC_ROOT= /opt/gcc/4.4.4 129 arm_GCC_ROOT= /opt/gcc/4.4.4 130 131 NATIVE_GCC_ROOT= $($(NATIVE_MACH)_GCC_ROOT) 132 133 GCC_ROOT= $($(MACH)_GCC_ROOT) 134 GCCLIBDIR= $(GCC_ROOT)/lib 135 GCCLIBDIR64= $(GCC_ROOT)/lib/$(MACH64) 136 137 DOCBOOK_XSL_ROOT= /usr/share/sgml/docbook/xsl-stylesheets 138 139 RPCGEN= /usr/bin/rpcgen 140 STABS= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/stabs 141 ELFEXTRACT= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/elfextract 142 MBH_PATCH= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/mbh_patch 143 ECHO= echo 144 INS= install 145 TRUE= true 146 SYMLINK= /usr/bin/ln -s 147 LN= /usr/bin/ln 148 CHMOD= /usr/bin/chmod 149 MV= /usr/bin/mv -f 150 RM= /usr/bin/rm -f 151 CUT= /usr/bin/cut 152 NM= /usr/ccs/bin/nm 153 DIFF= /usr/bin/diff 154 GREP= /usr/bin/grep 155 EGREP= /usr/bin/egrep 156 ELFWRAP= /usr/bin/elfwrap 157 KSH93= /usr/bin/ksh93 158 SED= /usr/bin/sed 159 NAWK= /usr/bin/nawk 160 CP= /usr/bin/cp -f 161 MCS= /usr/ccs/bin/mcs 162 CAT= /usr/bin/cat 163 ELFDUMP= /usr/ccs/bin/elfdump 164 M4= /usr/ccs/bin/m4 165 STRIP= /usr/ccs/bin/strip 166 LEX= /usr/ccs/bin/lex 167 FLEX= $(SFW_ROOT)/bin/flex 168 YACC= /usr/ccs/bin/yacc 169 CPP= /usr/lib/cpp 170 JAVAC= $(JAVA_ROOT)/bin/javac 171 JAVAH= $(JAVA_ROOT)/bin/javah 172 JAVADOC= $(JAVA_ROOT)/bin/javadoc 173 RMIC= $(JAVA_ROOT)/bin/rmic 174 JAR= $(JAVA_ROOT)/bin/jar 175 CTFSTABS= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/ctfstabs 176 CTFSTRIP= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/ctfstrip 177 NDRGEN= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/ndrgen 178 GENOFFSETS= $(ONBLD_TOOLS)/bin/genoffsets 179 CTFCVTPTBL= $(ONBLD_TOOLS)/bin/ctfcvtptbl 180 CTFFINDMOD= $(ONBLD_TOOLS)/bin/ctffindmod 181 XREF= $(ONBLD_TOOLS)/bin/xref 182 FIND= /usr/bin/find 183 PERL= /usr/bin/perl 184 PERL_VERSION= 5.10.0 185 PERL_PKGVERS= -510 186 PYTHON_26= /usr/bin/python2.6 187 PYTHON= $(PYTHON_26) 188 SORT= /usr/bin/sort 189 TOUCH= /usr/bin/touch 190 WC= /usr/bin/wc 191 XARGS= /usr/bin/xargs 192 ELFEDIT= /usr/bin/elfedit 193 ELFSIGN= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/elfsign 194 DTRACE= /usr/sbin/dtrace -xnolibs 195 UNIQ= /usr/bin/uniq 196 TAR= /usr/bin/tar 197 ASTBINDIR= /usr/ast/bin 198 MSGCC= $(ASTBINDIR)/msgcc 199 200 FILEMODE= 644 201 DIRMODE= 755 202 203 # 204 # The version of the patch makeup table optimized for build-time use. Used 205 # during patch builds only. 206 $(PATCH_BUILD)PMTMO_FILE=$(SRC)/patch_makeup_table.mo 207 208 # Declare that nothing should be built in parallel. 209 # Individual Makefiles can use the .PARALLEL target to declare otherwise. 210 .NO_PARALLEL: 211 212 # For stylistic checks 213 # 214 # Note that the X and C checks are not used at this time and may need 215 # modification when they are actually used. 216 # 217 CSTYLE= $(ONBLD_TOOLS)/bin/cstyle 218 CSTYLE_TAIL= 219 HDRCHK= $(ONBLD_TOOLS)/bin/hdrchk 220 HDRCHK_TAIL= 221 JSTYLE= $(ONBLD_TOOLS)/bin/jstyle 222 223 DOT_H_CHECK= \ 224 @$(ECHO) "checking $<"; $(CSTYLE) $< $(CSTYLE_TAIL); \ 225 $(HDRCHK) $< $(HDRCHK_TAIL) 226 227 DOT_X_CHECK= \ 228 @$(ECHO) "checking $<"; $(RPCGEN) -C -h $< | $(CSTYLE) $(CSTYLE_TAIL); \ 229 $(RPCGEN) -C -h $< | $(HDRCHK) $< $(HDRCHK_TAIL) 230 231 DOT_C_CHECK= \ 232 @$(ECHO) "checking $<"; $(CSTYLE) $< $(CSTYLE_TAIL) 233 234 MANIFEST_CHECK= \ 235 @$(ECHO) "checking $<"; \ 236 SVCCFG_DTD=$(SRC)/cmd/svc/dtd/service_bundle.dtd.1 \ 237 SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/global.db \ 238 SVCCFG_CONFIGD_PATH=$(SRC)/cmd/svc/configd/svc.configd-native \ 239 $(SRC)/cmd/svc/svccfg/svccfg-native validate $< 240 241 INS.file= $(RM) $@; $(INS) -s -m $(FILEMODE) -f $(@D) $< 242 INS.dir= $(INS) -s -d -m $(DIRMODE) $@ 243 # installs and renames at once 244 # 245 INS.rename= $(INS.file); $(MV) $(@D)/$(<F) $@ 246 247 # install a link 248 INSLINKTARGET= $< 249 INS.link= $(RM) $@; $(LN) $(INSLINKTARGET) $@ 250 INS.symlink= $(RM) $@; $(SYMLINK) $(INSLINKTARGET) $@ 251 252 # 253 # Python bakes the mtime of the .py file into the compiled .pyc and 254 # rebuilds if the baked-in mtime != the mtime of the source file 255 # (rather than only if it's less than), thus when installing python 256 # files we must make certain to not adjust the mtime of the source 257 # (.py) file. 258 # 259 INS.pyfile= $(INS.file); $(TOUCH) -r $< $@ 260 261 # MACH must be set in the shell environment to describe the target machine. 262 # If $MACH does not match uname -p on the build host, NATIVE_MACH must be set 263 # too. More specific architecture variables should be set in lower makefiles. 264 # 265 # MACH64 is derived from MACH, and BUILD64 is set to `#' for 266 # architectures on which we do not build 64-bit versions. 267 # (There are no such architectures at the moment.) 268 # 269 # Set BUILD64=# in the environment to disable 64-bit amd64 270 # builds on i386 machines. 271 272 MACH64_1= $(MACH:sparc=sparcv9) 273 MACH64= $(MACH64_1:i386=amd64) 274 275 MACH32_1= $(MACH:sparc=sparcv7) 276 MACH32= $(MACH32_1:i386=i86) 277 278 sparc_BUILD64= 279 i386_BUILD64= 280 arm_BUILD64= $(POUND_SIGN) 281 BUILD64= $($(MACH)_BUILD64) 282 283 # 284 # C compiler mode. Future compilers may change the default on us, 285 # so force extended ANSI mode globally. Lower level makefiles can 286 # override this by setting CCMODE. 287 # 288 CCMODE= -Xa 289 CCMODE64= -Xa 290 291 # 292 # C compiler verbose mode. This is so we can enable it globally, 293 # but turn it off in the lower level makefiles of things we cannot 294 # (or aren't going to) fix. 295 # 296 CCVERBOSE= -v 297 298 # set this to the secret flag "-Wc,-Qiselect-v9abiwarn=1" to get warnings 299 # from the compiler about places the -xarch=v9 may differ from -xarch=v9c. 300 V9ABIWARN= 301 302 # set this to the secret flag "-Wc,-Qiselect-regsym=0" to disable register 303 # symbols (used to detect conflicts between objects that use global registers) 304 # we disable this now for safety, and because genunix doesn't link with 305 # this feature (the v9 default) enabled. 306 # 307 # REGSYM is separate since the C++ driver syntax is different. 308 CCREGSYM= -Wc,-Qiselect-regsym=0 309 CCCREGSYM= -Qoption cg -Qiselect-regsym=0 310 311 # Prevent the removal of static symbols by the SPARC code generator (cg). 312 # The x86 code generator (ube) does not remove such symbols and as such 313 # using this workaround is not applicable for x86. 314 # 315 CCSTATICSYM= -Wc,-Qassembler-ounrefsym=0 316 # 317 # generate 32-bit addresses in the v9 kernel. Saves memory. 318 CCABS32= -Wc,-xcode=abs32 319 # 320 # generate v9 code which tolerates callers using the v7 ABI, for the sake of 321 # system calls. 322 CC32BITCALLERS= -_gcc=-massume-32bit-callers 323 324 # GCC, especially, is increasingly beginning to auto-inline functions and 325 # sadly does so separately not under the general -fno-inline-functions 326 # Additionally, we wish to prevent optimisations which cause GCC to clone 327 # functions -- in particular, these may cause unhelpful symbols to be 328 # emitted instead of function names 329 CCNOAUTOINLINE= -_gcc=-fno-inline-small-functions \ 330 -_gcc=-fno-inline-functions-called-once \ 331 -_gcc=-fno-ipa-cp 332 333 # One optimization the compiler might perform is to turn this: 334 # #pragma weak foo 335 # extern int foo; 336 # if (&foo) 337 # foo = 5; 338 # into 339 # foo = 5; 340 # Since we do some of this (foo might be referenced in common kernel code 341 # but provided only for some cpu modules or platforms), we disable this 342 # optimization. 343 # 344 sparc_CCUNBOUND = -Wd,-xsafe=unboundsym 345 i386_CCUNBOUND = 346 CCUNBOUND = $($(MACH)_CCUNBOUND) 347 348 # 349 # compiler '-xarch' flag. This is here to centralize it and make it 350 # overridable for testing. 351 sparc_XARCH= -m32 352 sparcv9_XARCH= -m64 353 i386_XARCH= 354 amd64_XARCH= -m64 -Ui386 -U__i386 355 arm_XARCH= 356 357 # assembler '-xarch' flag. Different from compiler '-xarch' flag. 358 sparc_AS_XARCH= -xarch=v8plus 359 sparcv9_AS_XARCH= -xarch=v9 360 i386_AS_XARCH= 361 amd64_AS_XARCH= -xarch=amd64 -P -Ui386 -U__i386 362 arm_AS_XARCH= 363 364 # 365 # These flags define what we need to be 'standalone' i.e. -not- part 366 # of the rather more cosy userland environment. This basically means 367 # the kernel. 368 # 369 # XX64 future versions of gcc will make -mcmodel=kernel imply -mno-red-zone 370 # 371 sparc_STAND_FLAGS= -_gcc=-ffreestanding 372 sparcv9_STAND_FLAGS= -_gcc=-ffreestanding 373 # Disabling MMX also disables 3DNow, disabling SSE also disables all later 374 # additions to SSE (SSE2, AVX ,etc.) 375 NO_SIMD= -_gcc=-mno-mmx -_gcc=-mno-sse 376 i386_STAND_FLAGS= -_gcc=-ffreestanding $(NO_SIMD) 377 amd64_STAND_FLAGS= -xmodel=kernel $(NO_SIMD) 378 arm_STAND_FLAGS= -_gcc=-ffreestanding 379 380 SAVEARGS= -Wu,-save_args 381 amd64_STAND_FLAGS += $(SAVEARGS) 382 383 STAND_FLAGS_32 = $($(MACH)_STAND_FLAGS) 384 STAND_FLAGS_64 = $($(MACH64)_STAND_FLAGS) 385 386 # 387 # disable the incremental linker 388 ILDOFF= -xildoff 389 # 390 XDEPEND= -xdepend 391 XFFLAG= -xF=%all 392 XESS= -xs 393 XSTRCONST= -xstrconst 394 395 # 396 # turn warnings into errors (C) 397 CERRWARN = -errtags=yes -errwarn=%all 398 CERRWARN += -erroff=E_EMPTY_TRANSLATION_UNIT 399 CERRWARN += -erroff=E_STATEMENT_NOT_REACHED 400 401 CERRWARN += -_gcc=-Wno-missing-braces 402 CERRWARN += -_gcc=-Wno-sign-compare 403 CERRWARN += -_gcc=-Wno-unknown-pragmas 404 CERRWARN += -_gcc=-Wno-unused-parameter 405 CERRWARN += -_gcc=-Wno-missing-field-initializers 406 407 # Unfortunately, this option can misfire very easily and unfixably. 408 CERRWARN += -_gcc=-Wno-array-bounds 409 410 # DEBUG v. -nd make for frequent unused variables, empty conditions, etc. in 411 # -nd builds 412 $(RELEASE_BUILD)CERRWARN += -_gcc=-Wno-unused 413 $(RELEASE_BUILD)CERRWARN += -_gcc=-Wno-empty-body 414 415 # 416 # turn warnings into errors (C++) 417 CCERRWARN= -xwe 418 419 # C99 mode 420 C99_ENABLE= -xc99=%all 421 C99_DISABLE= -xc99=%none 422 C99MODE= $(C99_DISABLE) 423 C99LMODE= $(C99MODE:-xc99%=-Xc99%) 424 425 # In most places, assignments to these macros should be appended with += 426 # (CPPFLAGS.master allows values to be prepended to CPPFLAGS). 427 sparc_CFLAGS= $(sparc_XARCH) $(CCSTATICSYM) 428 sparcv9_CFLAGS= $(sparcv9_XARCH) -dalign $(CCVERBOSE) $(V9ABIWARN) $(CCREGSYM) \ 429 $(CCSTATICSYM) 430 i386_CFLAGS= $(i386_XARCH) 431 amd64_CFLAGS= $(amd64_XARCH) 432 arm_CFLAGS= $(arm_XARCH) 433 434 sparc_ASFLAGS= $(sparc_AS_XARCH) 435 sparcv9_ASFLAGS=$(sparcv9_AS_XARCH) 436 i386_ASFLAGS= $(i386_AS_XARCH) 437 amd64_ASFLAGS= $(amd64_AS_XARCH) 438 arm_ASFLAGS= $(arm_AS_XARCH) 439 440 # 441 sparc_COPTFLAG= -xO3 442 sparcv9_COPTFLAG= -xO3 443 i386_COPTFLAG= -O 444 amd64_COPTFLAG= -xO3 445 arm_COPTFLAG= -xO3 446 447 COPTFLAG= $($(MACH)_COPTFLAG) 448 COPTFLAG64= $($(MACH64)_COPTFLAG) 449 450 # When -g is used, the compiler globalizes static objects 451 # (gives them a unique prefix). Disable that. 452 CNOGLOBAL= -W0,-noglobal 453 454 # Direct the Sun Studio compiler to use a static globalization prefix based on the 455 # name of the module rather than something unique. Otherwise, objects 456 # will not build deterministically, as subsequent compilations of identical 457 # source will yeild objects that always look different. 458 # 459 # In the same spirit, this will also remove the date from the N_OPT stab. 460 CGLOBALSTATIC= -W0,-xglobalstatic 461 462 # Sometimes we want all symbols and types in debugging information even 463 # if they aren't used. 464 CALLSYMS= -W0,-xdbggen=no%usedonly 465 466 # 467 # Default debug format for Sun Studio 11 is dwarf, so force it to 468 # generate stabs. 469 # 470 DEBUGFORMAT= -xdebugformat=stabs 471 472 # 473 # Flags used to build in debug mode for ctf generation. Bugs in the Devpro 474 # compilers currently prevent us from building with cc-emitted DWARF. 475 # 476 CTF_FLAGS_sparc = -g -Wc,-Qiselect-T1 $(C99MODE) $(CNOGLOBAL) $(CDWARFSTR) 477 CTF_FLAGS_i386 = -g $(C99MODE) $(CNOGLOBAL) $(CDWARFSTR) 478 CTF_FLAGS_arm = -g $(C99MODE) $(CNOGLOBAL) $(CDWARFSTR) 479 480 CTF_FLAGS_sparcv9 = $(CTF_FLAGS_sparc) 481 CTF_FLAGS_amd64 = $(CTF_FLAGS_i386) 482 483 # Sun Studio produces broken userland code when saving arguments. 484 $(__GNUC)CTF_FLAGS_amd64 += $(SAVEARGS) 485 486 CTF_FLAGS_32 = $(CTF_FLAGS_$(MACH)) $(DEBUGFORMAT) 487 CTF_FLAGS_64 = $(CTF_FLAGS_$(MACH64)) $(DEBUGFORMAT) 488 CTF_FLAGS = $(CTF_FLAGS_32) 489 490 # 491 # Flags used with genoffsets 492 # 493 GOFLAGS = -_noecho \ 494 $(CALLSYMS) \ 495 $(CDWARFSTR) 496 497 OFFSETS_CREATE = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \ 498 $(CC) $(GOFLAGS) $(CFLAGS) $(CPPFLAGS) 499 500 OFFSETS_CREATE64 = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \ 501 $(CC) $(GOFLAGS) $(CFLAGS64) $(CPPFLAGS) 502 503 # 504 # tradeoff time for space (smaller is better) 505 # 506 sparc_SPACEFLAG = -xspace -W0,-Lt 507 sparcv9_SPACEFLAG = -xspace -W0,-Lt 508 i386_SPACEFLAG = -xspace 509 amd64_SPACEFLAG = 510 arm_SPACFLAGE = #XXXARM: Really? 511 512 SPACEFLAG = $($(MACH)_SPACEFLAG) 513 SPACEFLAG64 = $($(MACH64)_SPACEFLAG) 514 515 # 516 # The Sun Studio 11 compiler has changed the behaviour of integer 517 # wrap arounds and so a flag is needed to use the legacy behaviour 518 # (without this flag panics/hangs could be exposed within the source). 519 # 520 sparc_IROPTFLAG = -W2,-xwrap_int 521 sparcv9_IROPTFLAG = -W2,-xwrap_int 522 i386_IROPTFLAG = 523 amd64_IROPTFLAG = 524 arm_IROPTFLAG = 525 526 IROPTFLAG = $($(MACH)_IROPTFLAG) 527 IROPTFLAG64 = $($(MACH64)_IROPTFLAG) 528 529 sparc_XREGSFLAG = -xregs=no%appl 530 sparcv9_XREGSFLAG = -xregs=no%appl 531 i386_XREGSFLAG = 532 amd64_XREGSFLAG = 533 arm_XREGSFLAG = 534 535 XREGSFLAG = $($(MACH)_XREGSFLAG) 536 XREGSFLAG64 = $($(MACH64)_XREGSFLAG) 537 538 # dmake SOURCEDEBUG=yes ... enables source-level debugging information, and 539 # avoids stripping it. 540 SOURCEDEBUG = $(POUND_SIGN) 541 SRCDBGBLD = $(SOURCEDEBUG:yes=) 542 543 # 544 # These variables are intended ONLY for use by developers to safely pass extra 545 # flags to the compilers without unintentionally overriding Makefile-set 546 # flags. They should NEVER be set to any value in a Makefile. 547 # 548 # They come last in the associated FLAGS variable such that they can 549 # explicitly override things if necessary, there are gaps in this, but it's 550 # the best we can manage. 551 # 552 CUSERFLAGS = 553 CUSERFLAGS64 = $(CUSERFLAGS) 554 CCUSERFLAGS = 555 CCUSERFLAGS64 = $(CCUSERFLAGS) 556 557 CSOURCEDEBUGFLAGS = 558 CCSOURCEDEBUGFLAGS = 559 $(SRCDBGBLD)CSOURCEDEBUGFLAGS = -g -xs 560 $(SRCDBGBLD)CCSOURCEDEBUGFLAGS = -g -xs 561 562 CFLAGS= $(COPTFLAG) $($(MACH)_CFLAGS) $(SPACEFLAG) $(CCMODE) \ 563 $(ILDOFF) $(CERRWARN) $(C99MODE) $(CCUNBOUND) $(IROPTFLAG) \ 564 $(CGLOBALSTATIC) $(CCNOAUTOINLINE) $(CSOURCEDEBUGFLAGS) \ 565 $(CUSERFLAGS) 566 CFLAGS64= $(COPTFLAG64) $($(MACH64)_CFLAGS) $(SPACEFLAG64) $(CCMODE64) \ 567 $(ILDOFF) $(CERRWARN) $(C99MODE) $(CCUNBOUND) $(IROPTFLAG64) \ 568 $(CGLOBALSTATIC) $(CCNOAUTOINLINE) $(CSOURCEDEBUGFLAGS) \ 569 $(CUSERFLAGS64) 570 # 571 # Flags that are used to build parts of the code that are subsequently 572 # run on the build machine (also known as the NATIVE_BUILD). 573 # 574 NATIVE_CFLAGS= $(COPTFLAG) $($(NATIVE_MACH)_CFLAGS) $(CCMODE) \ 575 $(ILDOFF) $(CERRWARN) $(C99MODE) $($(NATIVE_MACH)_CCUNBOUND) \ 576 $(IROPTFLAG) $(CGLOBALSTATIC) $(CCNOAUTOINLINE) \ 577 $(CSOURCEDEBUGFLAGS) $(CUSERFLAGS) 578 579 DTEXTDOM=-DTEXT_DOMAIN=\"$(TEXT_DOMAIN)\" # For messaging. 580 DTS_ERRNO=-D_TS_ERRNO 581 CPPFLAGS.master=$(DTEXTDOM) $(DTS_ERRNO) \ 582 $(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4) \ 583 $(ADJUNCT_PROTO:%=-I%/usr/include) 584 CPPFLAGS.native=$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) \ 585 $(ENVCPPFLAGS4) -I$(NATIVE_ADJUNCT)/include 586 CPPFLAGS= $(CPPFLAGS.master) 587 AS_CPPFLAGS= $(CPPFLAGS.master) 588 JAVAFLAGS= -deprecation 589 590 # 591 # For source message catalogue 592 # 593 .SUFFIXES: $(SUFFIXES) .i .po 594 MSGROOT= $(ROOT)/catalog 595 MSGDOMAIN= $(MSGROOT)/$(TEXT_DOMAIN) 596 MSGDOMAINPOFILE = $(MSGDOMAIN)/$(POFILE) 597 DCMSGDOMAIN= $(MSGROOT)/LC_TIME/$(TEXT_DOMAIN) 598 DCMSGDOMAINPOFILE = $(DCMSGDOMAIN)/$(DCFILE:.dc=.po) 599 600 CLOBBERFILES += $(POFILE) $(POFILES) 601 COMPILE.cpp= $(CC) -E -C $(CFLAGS) $(CPPFLAGS) 602 XGETTEXT= /usr/bin/xgettext 603 XGETFLAGS= -c TRANSLATION_NOTE 604 GNUXGETTEXT= /usr/gnu/bin/xgettext 605 GNUXGETFLAGS= --add-comments=TRANSLATION_NOTE --keyword=_ \ 606 --strict --no-location --omit-header 607 BUILD.po= $(XGETTEXT) $(XGETFLAGS) -d $(<F) $<.i ;\ 608 $(RM) $@ ;\ 609 $(SED) "/^domain/d" < $(<F).po > $@ ;\ 610 $(RM) $(<F).po $<.i 611 612 # 613 # This is overwritten by local Makefile when PROG is a list. 614 # 615 POFILE= $(PROG).po 616 617 sparc_CCFLAGS= -cg92 -compat=4 \ 618 -Qoption ccfe -messages=no%anachronism \ 619 $(CCERRWARN) 620 sparcv9_CCFLAGS= $(sparcv9_XARCH) -dalign -compat=5 \ 621 -Qoption ccfe -messages=no%anachronism \ 622 -Qoption ccfe -features=no%conststrings \ 623 $(CCCREGSYM) \ 624 $(CCERRWARN) 625 i386_CCFLAGS= -compat=4 \ 626 -Qoption ccfe -messages=no%anachronism \ 627 -Qoption ccfe -features=no%conststrings \ 628 $(CCERRWARN) 629 amd64_CCFLAGS= $(amd64_XARCH) -compat=5 \ 630 -Qoption ccfe -messages=no%anachronism \ 631 -Qoption ccfe -features=no%conststrings \ 632 $(CCERRWARN) 633 arm_CCFLAGS= $(CCERRWARN) 634 635 sparc_CCOPTFLAG= -O 636 sparcv9_CCOPTFLAG= -O 637 i386_CCOPTFLAG= -O 638 amd64_CCOPTFLAG= -O 639 arm_CCOPTFLAG= -O 640 641 CCOPTFLAG= $($(MACH)_CCOPTFLAG) 642 CCOPTFLAG64= $($(MACH64)_CCOPTFLAG) 643 CCFLAGS= $(CCOPTFLAG) $($(MACH)_CCFLAGS) $(CCSOURCEDEBUGFLAGS) \ 644 $(CCUSERFLAGS) 645 CCFLAGS64= $(CCOPTFLAG64) $($(MACH64)_CCFLAGS) $(CCSOURCEDEBUGFLAGS) \ 646 $(CCUSERFLAGS64) 647 648 # 649 # 650 # 651 ELFWRAP_FLAGS = 652 ELFWRAP_FLAGS64 = -64 653 654 # 655 # Various mapfiles that are used throughout the build, and delivered to 656 # /usr/lib/ld. 657 # 658 MAPFILE.NED_i386 = $(SRC)/common/mapfiles/common/map.noexdata 659 MAPFILE.NED_sparc = 660 MAPFILE.NED = $(MAPFILE.NED_$(MACH)) 661 MAPFILE.PGA = $(SRC)/common/mapfiles/common/map.pagealign 662 MAPFILE.NES = $(SRC)/common/mapfiles/common/map.noexstk 663 MAPFILE.FLT = $(SRC)/common/mapfiles/common/map.filter 664 MAPFILE.LEX = $(SRC)/common/mapfiles/common/map.lex.yy 665 666 # 667 # Generated mapfiles that are compiler specific, and used throughout the 668 # build. These mapfiles are not delivered in /usr/lib/ld. 669 # 670 MAPFILE.NGB_sparc= $(SRC)/common/mapfiles/gen/sparc_cc_map.noexeglobs 671 $(__GNUC64)MAPFILE.NGB_sparc= \ 672 $(SRC)/common/mapfiles/gen/sparc_gcc_map.noexeglobs 673 MAPFILE.NGB_sparcv9= $(SRC)/common/mapfiles/gen/sparcv9_cc_map.noexeglobs 674 $(__GNUC64)MAPFILE.NGB_sparcv9= \ 675 $(SRC)/common/mapfiles/gen/sparcv9_gcc_map.noexeglobs 676 MAPFILE.NGB_i386= $(SRC)/common/mapfiles/gen/i386_cc_map.noexeglobs 677 $(__GNUC64)MAPFILE.NGB_i386= \ 678 $(SRC)/common/mapfiles/gen/i386_gcc_map.noexeglobs 679 MAPFILE.NGB_amd64= $(SRC)/common/mapfiles/gen/amd64_cc_map.noexeglobs 680 $(__GNUC64)MAPFILE.NGB_amd64= \ 681 $(SRC)/common/mapfiles/gen/amd64_gcc_map.noexeglobs 682 MAPFILE.NGB_arm= \ 683 $(SRC)/common/mapfiles/gen/arm_gcc_map.noexeglobs 684 MAPFILE.NGB = $(MAPFILE.NGB_$(MACH)) 685 686 # 687 # A generic interface mapfile name, used by various dynamic objects to define 688 # the interfaces and interposers the object must export. 689 # 690 MAPFILE.INT = mapfile-intf 691 692 # 693 # LDLIBS32 and LDLIBS64 can be set in the environment to override the following 694 # assignments. 695 # 696 # These environment settings make sure that no libraries are searched outside 697 # of the local workspace proto area: 698 # LDLIBS32=-YP,$ROOT/lib:$ROOT/usr/lib 699 # LDLIBS64=-YP,$ROOT/lib/$MACH64:$ROOT/usr/lib/$MACH64 700 # 701 LDLIBS32 = $(ENVLDLIBS1) $(ENVLDLIBS2) $(ENVLDLIBS3) 702 LDLIBS32 += $(ADJUNCT_PROTO:%=-L%/usr/lib -L%/lib) 703 LDLIBS.cmd = $(LDLIBS32) 704 LDLIBS.lib = $(LDLIBS32) 705 706 LDLIBS64 = $(ENVLDLIBS1:%=%/$(MACH64)) \ 707 $(ENVLDLIBS2:%=%/$(MACH64)) \ 708 $(ENVLDLIBS3:%=%/$(MACH64)) 709 LDLIBS64 += $(ADJUNCT_PROTO:%=-L%/usr/lib/$(MACH64) -L%/lib/$(MACH64)) 710 711 # 712 # Define compilation macros. 713 # 714 COMPILE.c= $(CC) $(CFLAGS) $(CPPFLAGS) -c 715 COMPILE64.c= $(CC) $(CFLAGS64) $(CPPFLAGS) -c 716 COMPILE.cc= $(CCC) $(CCFLAGS) $(CPPFLAGS) -c 717 COMPILE64.cc= $(CCC) $(CCFLAGS64) $(CPPFLAGS) -c 718 COMPILE.s= $(AS) $(ASFLAGS) $(AS_CPPFLAGS) 719 COMPILE64.s= $(AS) $(ASFLAGS) $($(MACH64)_AS_XARCH) $(AS_CPPFLAGS) 720 COMPILE.d= $(DTRACE) -G -32 721 COMPILE64.d= $(DTRACE) -G -64 722 COMPILE.b= $(ELFWRAP) $(ELFWRAP_FLAGS$(CLASS)) 723 COMPILE64.b= $(ELFWRAP) $(ELFWRAP_FLAGS$(CLASS)) 724 725 CLASSPATH= . 726 COMPILE.java= $(JAVAC) $(JAVAFLAGS) -classpath $(CLASSPATH) 727 728 # 729 # Link time macros 730 # 731 CCNEEDED = -lC 732 CCEXTNEEDED = -lCrun -lCstd 733 $(__GNUC)CCNEEDED = -L$(GCCLIBDIR) -lstdc++ -lgcc_s 734 $(__GNUC)CCEXTNEEDED = $(CCNEEDED) 735 736 LINK.c= $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) 737 LINK64.c= $(CC) $(CFLAGS64) $(CPPFLAGS) $(LDFLAGS) 738 NORUNPATH= -norunpath -nolib 739 LINK.cc= $(CCC) $(CCFLAGS) $(CPPFLAGS) $(NORUNPATH) \ 740 $(LDFLAGS) $(CCNEEDED) 741 LINK64.cc= $(CCC) $(CCFLAGS64) $(CPPFLAGS) $(NORUNPATH) \ 742 $(LDFLAGS) $(CCNEEDED) 743 744 # 745 # lint macros 746 # 747 # Note that the undefine of __PRAGMA_REDEFINE_EXTNAME can be removed once 748 # ON is built with a version of lint that has the fix for 4484186. 749 # 750 ALWAYS_LINT_DEFS = -errtags=yes -s 751 ALWAYS_LINT_DEFS += -erroff=E_PTRDIFF_OVERFLOW 752 ALWAYS_LINT_DEFS += -erroff=E_ASSIGN_NARROW_CONV 753 ALWAYS_LINT_DEFS += -U__PRAGMA_REDEFINE_EXTNAME 754 ALWAYS_LINT_DEFS += $(C99LMODE) 755 ALWAYS_LINT_DEFS += -errsecurity=$(SECLEVEL) 756 ALWAYS_LINT_DEFS += -erroff=E_SEC_CREAT_WITHOUT_EXCL 757 ALWAYS_LINT_DEFS += -erroff=E_SEC_FORBIDDEN_WARN_CREAT 758 # XX64 -- really only needed for amd64 lint 759 ALWAYS_LINT_DEFS += -erroff=E_ASSIGN_INT_TO_SMALL_INT 760 ALWAYS_LINT_DEFS += -erroff=E_CAST_INT_CONST_TO_SMALL_INT 761 ALWAYS_LINT_DEFS += -erroff=E_CAST_INT_TO_SMALL_INT 762 ALWAYS_LINT_DEFS += -erroff=E_CAST_TO_PTR_FROM_INT 763 ALWAYS_LINT_DEFS += -erroff=E_COMP_INT_WITH_LARGE_INT 764 ALWAYS_LINT_DEFS += -erroff=E_INTEGRAL_CONST_EXP_EXPECTED 765 ALWAYS_LINT_DEFS += -erroff=E_PASS_INT_TO_SMALL_INT 766 ALWAYS_LINT_DEFS += -erroff=E_PTR_CONV_LOSES_BITS 767 768 # This forces lint to pick up note.h and sys/note.h from Devpro rather than 769 # from the proto area. The note.h that ON delivers would disable NOTE(). 770 ONLY_LINT_DEFS = -I$(SPRO_VROOT)/prod/include/lint 771 772 SECLEVEL= core 773 LINT.c= $(LINT) $(ONLY_LINT_DEFS) $(LINTFLAGS) $(CPPFLAGS) \ 774 $(ALWAYS_LINT_DEFS) 775 LINT64.c= $(LINT) $(ONLY_LINT_DEFS) $(LINTFLAGS64) $(CPPFLAGS) \ 776 $(ALWAYS_LINT_DEFS) 777 LINT.s= $(LINT.c) 778 779 # For some future builds, NATIVE_MACH and MACH might be different. 780 # Therefore, NATIVE_MACH needs to be redefined in the 781 # environment as `uname -p` to override this macro. 782 # 783 # For now at least, we cross-compile amd64 on i386 machines. 784 NATIVE_MACH= $(MACH:amd64=i386) 785 786 # Define native compilation macros 787 # 788 789 # Base directory where compilers are loaded. 790 # Defined here so it can be overridden by developer. 791 # 792 SPRO_ROOT= $(BUILD_TOOLS)/SUNWspro 793 SPRO_VROOT= $(SPRO_ROOT)/SS12 794 795 i386_GNU_ROOT= $(SFW_ROOT) 796 sparc_GNU_ROOT= $(SFW_ROOT) 797 arm_GNU_ROOT= $(SFW_ROOT) 798 799 GNU_ROOT= $($(MACH)_GNU_ROOT) 800 NATIVE_GNU_ROOT= $($(NATIVE_MACH)_GNU_ROOT) 801 802 # Till SS12u1 formally becomes the NV CBE, LINT is hard 803 # coded to be picked up from the $SPRO_ROOT/sunstudio12.1/ 804 # location. Impacted variables are sparc_LINT, sparcv9_LINT, 805 # i386_LINT, amd64_LINT. 806 # Reset them when SS12u1 is rolled out. 807 # 808 809 # Specify platform compiler versions for languages 810 # that we use (currently only c and c++). 811 # 812 sparc_CC= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/cw.sparc -_cc 813 $(__GNUC)sparc_CC= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/cw.sparc -_gcc 814 sparc_CCC= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/cw.sparc -_CC 815 $(__GNUC)sparc_CCC= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/cw.sparc -_g++ 816 sparc_CPP= /usr/ccs/lib/cpp 817 sparc_AS= /usr/ccs/bin/as -xregsym=no 818 sparc_LD= /usr/ccs/bin/ld 819 sparc_LINT= $(SPRO_ROOT)/sunstudio12.1/bin/lint 820 sparc_CTFCONVERT= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/ctfconvert.sparc 821 sparc_CTFMERGE= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/ctfmerge.sparc 822 823 sparcv9_CC= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/cw.sparc -_cc 824 $(__GNUC64)sparcv9_CC= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/cw.sparc -_gcc 825 sparcv9_CCC= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/cw.sparc -_CC 826 $(__GNUC64)sparcv9_CCC= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/cw.sparc -_g++ 827 sparcv9_CPP= /usr/ccs/lib/cpp 828 sparcv9_AS= /usr/ccs/bin/as -xregsym=no 829 sparcv9_LD= /usr/ccs/bin/ld 830 sparcv9_LINT= $(SPRO_ROOT)/sunstudio12.1/bin/lint 831 sparcv9_CTFCONVERT= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/ctfconvert.sparc 832 sparcv9_CTFMERGE= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/ctfmerge.sparc 833 834 i386_CC= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/cw.i386 -_cc 835 $(__GNUC)i386_CC= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/cw.i386 -_gcc 836 i386_CCC= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/cw.i386 -_CC 837 $(__GNUC)i386_CCC= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/cw.i386 -_g++ 838 i386_CPP= /usr/ccs/lib/cpp 839 i386_AS= /usr/ccs/bin/as 840 $(__GNUC)i386_AS= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/aw.i386 841 i386_LD= /usr/ccs/bin/ld 842 i386_LINT= $(SPRO_ROOT)/sunstudio12.1/bin/lint 843 i386_CTFCONVERT= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/ctfconvert.i386 844 i386_CTFMERGE= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/ctfmerge.i386 845 846 amd64_CC= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/cw.i386 -_cc 847 $(__GNUC64)amd64_CC= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/cw.i386 -_gcc 848 amd64_CCC= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/cw.i386 -_CC 849 $(__GNUC64)amd64_CCC= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/cw.i386 -_g++ 850 amd64_CPP= /usr/ccs/lib/cpp 851 amd64_AS= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/aw.i386 852 amd64_LD= /usr/ccs/bin/ld 853 amd64_LINT= $(SPRO_ROOT)/sunstudio12.1/bin/lint 854 amd64_CTFCONVERT= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/ctfconvert.i386 855 amd64_CTFMERGE= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/ctfmerge.i386 856 857 arm_CC= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/cw.arm -_gcc 858 arm_CCC= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/cw.arm -_g++ 859 arm_CPP= /usr/ccs/lib/cpp 860 arm_AS= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/aw.arm 861 arm_LD= /usr/ccs/bin/ld 862 arm_LINT= /bin/false 863 arm_CTFCONVERT= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/ctfconvert.arm 864 arm_CTFMERGE= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/ctfmerge.arm 865 866 NATIVECC= $($(NATIVE_MACH)_CC) 867 NATIVECCC= $($(NATIVE_MACH)_CCC) 868 NATIVECPP= $($(NATIVE_MACH)_CPP) 869 NATIVEAS= $($(NATIVE_MACH)_AS) 870 NATIVELD= $($(NATIVE_MACH)_LD) 871 NATIVELINT= $($(NATIVE_MACH)_LINT) 872 NATIVECTFCONVERT= $($(NATIVE_MACH)_CTFCONVERT) 873 NATIVECTFMERGE= $($(NATIVE_MACH)_CTFMERGE) 874 875 # 876 # Makefile.master.64 overrides these settings 877 # 878 CC= $($(MACH)_CC) 879 CCC= $($(MACH)_CCC) 880 CPP= $($(MACH)_CPP) 881 AS= $($(MACH)_AS) 882 LD= $($(MACH)_LD) 883 LINT= $($(MACH)_LINT) 884 CTFCONVERT= $($(MACH)_CTFCONVERT) 885 CTFMERGE= $($(MACH)_CTFMERGE) 886 887 # The real compilers used for this build 888 CW_CC_CMD= $(CC) -_compiler 889 CW_CCC_CMD= $(CCC) -_compiler 890 REAL_CC= $(CW_CC_CMD:sh) 891 REAL_CCC= $(CW_CCC_CMD:sh) 892 893 # Pass -Y flag to cpp (method of which is release-dependent) 894 CCYFLAG= -Y I, 895 896 BDIRECT= -Bdirect 897 BDYNAMIC= -Bdynamic 898 BLOCAL= -Blocal 899 BNODIRECT= -Bnodirect 900 BREDUCE= -Breduce 901 BSTATIC= -Bstatic 902 903 ZDEFS= -zdefs 904 ZDIRECT= -zdirect 905 ZIGNORE= -zignore 906 ZINITFIRST= -zinitfirst 907 ZINTERPOSE= -zinterpose 908 ZLAZYLOAD= -zlazyload 909 ZLOADFLTR= -zloadfltr 910 ZMULDEFS= -zmuldefs 911 ZNODEFAULTLIB= -znodefaultlib 912 ZNODEFS= -znodefs 913 ZNODELETE= -znodelete 914 ZNODLOPEN= -znodlopen 915 ZNODUMP= -znodump 916 ZNOLAZYLOAD= -znolazyload 917 ZNOLDYNSYM= -znoldynsym 918 ZNORELOC= -znoreloc 919 ZNOVERSION= -znoversion 920 ZRECORD= -zrecord 921 ZREDLOCSYM= -zredlocsym 922 ZTEXT= -ztext 923 ZVERBOSE= -zverbose 924 925 GSHARED= -G 926 CCMT= -mt 927 928 # Handle different PIC models on different ISAs 929 # (May be overridden by lower-level Makefiles) 930 931 sparc_C_PICFLAGS = -K pic 932 sparcv9_C_PICFLAGS = -K pic 933 i386_C_PICFLAGS = -K pic 934 amd64_C_PICFLAGS = -K pic 935 arm_C_PICFLAGS = -K pic 936 C_PICFLAGS = $($(MACH)_C_PICFLAGS) 937 C_PICFLAGS64 = $($(MACH64)_C_PICFLAGS) 938 939 sparc_C_BIGPICFLAGS = -K PIC 940 sparcv9_C_BIGPICFLAGS = -K PIC 941 i386_C_BIGPICFLAGS = -K PIC 942 amd64_C_BIGPICFLAGS = -K PIC 943 arm_C_BIGPICFLAGS = -K PIC 944 C_BIGPICFLAGS = $($(MACH)_C_BIGPICFLAGS) 945 C_BIGPICFLAGS64 = $($(MACH64)_C_BIGPICFLAGS) 946 947 # CC requires there to be no space between '-K' and 'pic' or 'PIC'. 948 sparc_CC_PICFLAGS = -Kpic 949 sparcv9_CC_PICFLAGS = -KPIC 950 i386_CC_PICFLAGS = -Kpic 951 amd64_CC_PICFLAGS = -Kpic 952 arm_CC_PICFLAGS = -Kpic 953 CC_PICFLAGS = $($(MACH)_CC_PICFLAGS) 954 CC_PICFLAGS64 = $($(MACH64)_CC_PICFLAGS) 955 956 AS_PICFLAGS= $(C_PICFLAGS) 957 AS_BIGPICFLAGS= $(C_BIGPICFLAGS) 958 959 # 960 # Default label for CTF sections 961 # 962 CTFCVTFLAGS= -i -L VERSION 963 $(SRCDBGBLD)CTFCVTFLAGS += -g 964 965 # 966 # Override to pass module-specific flags to ctfmerge. Currently used only by 967 # krtld to turn on fuzzy matching, and source-level debugging to inhibit 968 # stripping. 969 # 970 CTFMRGFLAGS= 971 $(SRCDBGBLD)CTFMRGFLAGS += -g 972 973 974 CTFCONVERT_O = $(CTFCONVERT) $(CTFCVTFLAGS) $@ 975 976 ELFSIGN_O= $(TRUE) 977 ELFSIGN_CRYPTO= $(ELFSIGN_O) 978 ELFSIGN_OBJECT= $(ELFSIGN_O) 979 980 # Rules (normally from make.rules) and macros which are used for post 981 # processing files. Normally, these do stripping of the comment section 982 # automatically. 983 # RELEASE_CM: Should be editted to reflect the release. 984 # POST_PROCESS_O: Post-processing for `.o' files. 985 # POST_PROCESS_A: Post-processing for `.a' files (currently null). 986 # POST_PROCESS_SO: Post-processing for `.so' files. 987 # POST_PROCESS: Post-processing for executable files (no suffix). 988 # Note that these macros are not completely generalized as they are to be 989 # used with the file name to be processed following. 990 # 991 # It is left as an exercise to Release Engineering to embellish the generation 992 # of the release comment string. 993 # 994 # If this is a standard development build: 995 # compress the comment section (mcs -c) 996 # add the standard comment (mcs -a $(RELEASE_CM)) 997 # add the development specific comment (mcs -a $(DEV_CM)) 998 # 999 # If this is an installation build: 1000 # delete the comment section (mcs -d) 1001 # add the standard comment (mcs -a $(RELEASE_CM)) 1002 # add the development specific comment (mcs -a $(DEV_CM)) 1003 # 1004 # If this is an release build: 1005 # delete the comment section (mcs -d) 1006 # add the standard comment (mcs -a $(RELEASE_CM)) 1007 # 1008 # The following list of macros are used in the definition of RELEASE_CM 1009 # which is used to label all binaries in the build: 1010 # 1011 # RELEASE Specific release of the build, eg: 5.2 1012 # RELEASE_MAJOR Major version number part of $(RELEASE) 1013 # RELEASE_MINOR Minor version number part of $(RELEASE) 1014 # VERSION Version of the build (alpha, beta, Generic) 1015 # PATCHID If this is a patch this value should contain 1016 # the patchid value (eg: "Generic 100832-01"), otherwise 1017 # it will be set to $(VERSION) 1018 # RELEASE_DATE Date of the Release Build 1019 # PATCH_DATE Date the patch was created, if this is blank it 1020 # will default to the RELEASE_DATE 1021 # 1022 RELEASE_MAJOR= 5 1023 RELEASE_MINOR= 11 1024 RELEASE= $(RELEASE_MAJOR).$(RELEASE_MINOR) 1025 VERSION= SunOS Development 1026 PATCHID= $(VERSION) 1027 RELEASE_DATE= release date not set 1028 PATCH_DATE= $(RELEASE_DATE) 1029 RELEASE_CM= "@($(POUND_SIGN))SunOS $(RELEASE) $(PATCHID) $(PATCH_DATE)" 1030 DEV_CM= "@($(POUND_SIGN))SunOS Internal Development: non-nightly build" 1031 1032 PROCESS_COMMENT= @?${MCS} -d -a $(RELEASE_CM) -a $(DEV_CM) 1033 $(RELEASE_BUILD)PROCESS_COMMENT= @?${MCS} -d -a $(RELEASE_CM) 1034 1035 STRIP_STABS= : 1036 $(RELEASE_BUILD)STRIP_STABS= $(STRIP) -x $@ 1037 $(SRCDBGBLD)STRIP_STABS= : 1038 1039 POST_PROCESS_O= 1040 POST_PROCESS_A= 1041 POST_PROCESS_SO= $(PROCESS_COMMENT) $@ ; $(STRIP_STABS) ; \ 1042 $(ELFSIGN_OBJECT) 1043 POST_PROCESS= $(PROCESS_COMMENT) $@ ; $(STRIP_STABS) ; \ 1044 $(ELFSIGN_OBJECT) 1045 1046 # 1047 # chk4ubin is a tool that inspects a module for a symbol table 1048 # ELF section size which can trigger an OBP bug on older platforms. 1049 # This problem affects only specific sun4u bootable modules. 1050 # 1051 CHK4UBIN= $(ONBLD_TOOLS)/bin/$(NATIVE_MACH)/chk4ubin 1052 CHK4UBINFLAGS= 1053 CHK4UBINARY= $(CHK4UBIN) $(CHK4UBINFLAGS) $@ 1054 1055 # 1056 # PKGARCHIVE specifies the default location where packages should be 1057 # placed if built. 1058 # 1059 $(RELEASE_BUILD)PKGARCHIVESUFFIX= -nd 1060 PKGARCHIVE=$(SRC)/../../packages/$(MACH)/nightly$(PKGARCHIVESUFFIX) 1061 1062 # 1063 # The repositories will be created with these publisher settings. To 1064 # update an image to the resulting repositories, this must match the 1065 # publisher name provided to "pkg set-publisher." 1066 # 1067 PKGPUBLISHER_REDIST= on-nightly 1068 PKGPUBLISHER_NONREDIST= on-extra 1069 1070 # Default build rules which perform comment section post-processing. 1071 # 1072 .c: 1073 $(LINK.c) -o $@ $< $(LDLIBS) 1074 $(POST_PROCESS) 1075 .c.o: 1076 $(COMPILE.c) $(OUTPUT_OPTION) $< $(CTFCONVERT_HOOK) 1077 $(POST_PROCESS_O) 1078 .c.a: 1079 $(COMPILE.c) -o $% $< 1080 $(PROCESS_COMMENT) $% 1081 $(AR) $(ARFLAGS) $@ $% 1082 $(RM) $% 1083 .s.o: 1084 $(COMPILE.s) -o $@ $< 1085 $(POST_PROCESS_O) 1086 .s.a: 1087 $(COMPILE.s) -o $% $< 1088 $(PROCESS_COMMENT) $% 1089 $(AR) $(ARFLAGS) $@ $% 1090 $(RM) $% 1091 .cc: 1092 $(LINK.cc) -o $@ $< $(LDLIBS) 1093 $(POST_PROCESS) 1094 .cc.o: 1095 $(COMPILE.cc) $(OUTPUT_OPTION) $< 1096 $(POST_PROCESS_O) 1097 .cc.a: 1098 $(COMPILE.cc) -o $% $< 1099 $(AR) $(ARFLAGS) $@ $% 1100 $(PROCESS_COMMENT) $% 1101 $(RM) $% 1102 .y: 1103 $(YACC.y) $< 1104 $(LINK.c) -o $@ y.tab.c $(LDLIBS) 1105 $(POST_PROCESS) 1106 $(RM) y.tab.c 1107 .y.o: 1108 $(YACC.y) $< 1109 $(COMPILE.c) -o $@ y.tab.c $(CTFCONVERT_HOOK) 1110 $(POST_PROCESS_O) 1111 $(RM) y.tab.c 1112 .l: 1113 $(RM) $*.c 1114 $(LEX.l) $< > $*.c 1115 $(LINK.c) -o $@ $*.c -ll $(LDLIBS) 1116 $(POST_PROCESS) 1117 $(RM) $*.c 1118 .l.o: 1119 $(RM) $*.c 1120 $(LEX.l) $< > $*.c 1121 $(COMPILE.c) -o $@ $*.c $(CTFCONVERT_HOOK) 1122 $(POST_PROCESS_O) 1123 $(RM) $*.c 1124 1125 .bin.o: 1126 $(COMPILE.b) -o $@ $< 1127 $(POST_PROCESS_O) 1128 1129 .java.class: 1130 $(COMPILE.java) $< 1131 1132 # Bourne and Korn shell script message catalog build rules. 1133 # We extract all gettext strings with sed(1) (being careful to permit 1134 # multiple gettext strings on the same line), weed out the dups, and 1135 # build the catalogue with awk(1). 1136 1137 .sh.po .ksh.po: 1138 $(SED) -n -e ":a" \ 1139 -e "h" \ 1140 -e "s/.*gettext *\(\"[^\"]*\"\).*/\1/p" \ 1141 -e "x" \ 1142 -e "s/\(.*\)gettext *\"[^\"]*\"\(.*\)/\1\2/" \ 1143 -e "t a" \ 1144 $< | sort -u | awk '{ print "msgid\t" $$0 "\nmsgstr" }' > $@ 1145 1146 # 1147 # Python and Perl executable and message catalog build rules. 1148 # 1149 .SUFFIXES: .pl .pm .py .pyc 1150 1151 .pl: 1152 $(RM) $@; 1153 $(SED) -e "s@TEXT_DOMAIN@\"$(TEXT_DOMAIN)\"@" $< > $@; 1154 $(CHMOD) +x $@ 1155 1156 .py: 1157 $(RM) $@; $(CAT) $< > $@; $(CHMOD) +x $@ 1158 1159 .py.pyc: 1160 $(RM) $@ 1161 $(PYTHON) -mpy_compile $< 1162 @[ $(<)c = $@ ] || $(MV) $(<)c $@ 1163 1164 .py.po: 1165 $(GNUXGETTEXT) $(GNUXGETFLAGS) -d $(<F:%.py=%) $< ; 1166 1167 .pl.po .pm.po: 1168 $(XGETTEXT) $(XGETFLAGS) -d $(<F) $< ; 1169 $(RM) $@ ; 1170 $(SED) "/^domain/d" < $(<F).po > $@ ; 1171 $(RM) $(<F).po 1172 1173 # 1174 # When using xgettext, we want messages to go to the default domain, 1175 # rather than the specified one. This special version of the 1176 # COMPILE.cpp macro effectively prevents expansion of TEXT_DOMAIN, 1177 # causing xgettext to put all messages into the default domain. 1178 # 1179 CPPFORPO=$(COMPILE.cpp:\"$(TEXT_DOMAIN)\"=TEXT_DOMAIN) 1180 1181 .c.i: 1182 $(CPPFORPO) $< > $@ 1183 1184 .h.i: 1185 $(CPPFORPO) $< > $@ 1186 1187 .y.i: 1188 $(YACC) -d $< 1189 $(CPPFORPO) y.tab.c > $@ 1190 $(RM) y.tab.c 1191 1192 .l.i: 1193 $(LEX) $< 1194 $(CPPFORPO) lex.yy.c > $@ 1195 $(RM) lex.yy.c 1196 1197 .c.po: 1198 $(CPPFORPO) $< > $<.i 1199 $(BUILD.po) 1200 1201 .y.po: 1202 $(YACC) -d $< 1203 $(CPPFORPO) y.tab.c > $<.i 1204 $(BUILD.po) 1205 $(RM) y.tab.c 1206 1207 .l.po: 1208 $(LEX) $< 1209 $(CPPFORPO) lex.yy.c > $<.i 1210 $(BUILD.po) 1211 $(RM) lex.yy.c 1212 1213 # 1214 # Rules to perform stylistic checks 1215 # 1216 .SUFFIXES: .x .xml .check .xmlchk 1217 1218 .h.check: 1219 $(DOT_H_CHECK) 1220 1221 .x.check: 1222 $(DOT_X_CHECK) 1223 1224 .xml.xmlchk: 1225 $(MANIFEST_CHECK) 1226 1227 # 1228 # Include rules to render automated sccs get rules "safe". 1229 # 1230 include $(SRC)/Makefile.noget