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