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