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