1 MAKE(1S)                   illumos Specific Commands                  MAKE(1S)
   2 
   3 
   4 
   5 NAME
   6        make - maintain, update, and regenerate related programs and files
   7 
   8 SYNOPSIS
   9        /usr/bin/make [-d] [-dd] [-D] [-DD] [-e] [-i] [-k] [-n]
  10             [-p] [-P] [-q] [-r] [-s] [-S] [-t] [-V]
  11             [-f makefile]... [-K statefile]... [target]...
  12             [macro = value...]
  13 
  14 
  15        /usr/xpg4/bin/make [-d] [-dd] [-D] [-DD] [-e] [-i] [-k]
  16             [-n] [-p] [-P] [-q] [-r] [-s] [-S] [-t] [-V]
  17             [-f makefile]... [target]... [macro = value...]
  18 
  19 
  20 DESCRIPTION
  21        The make utility executes a list of shell commands associated with each
  22        target, typically to create or update a file of the same name.
  23        makefile contains entries that describe how to bring a target up to
  24        date with respect to those on which it depends, which are called
  25        dependencies.  Since each dependency is a target, it can have
  26        dependencies of its own.  Targets, dependencies, and sub-dependencies
  27        comprise a tree structure that make traces when deciding whether or not
  28        to rebuild a target.
  29 
  30 
  31        The make utility recursively checks each target against its
  32        dependencies, beginning with the first target entry in makefile if no
  33        target argument is supplied on the command line. If, after processing
  34        all of its dependencies, a target file is found either to be missing,
  35        or to be older than any of its dependencies, make rebuilds it.
  36        Optionally with this version of make, a target can be treated as out-of-
  37        date when the commands used to generate it have changed since the last
  38        time the target was built.
  39 
  40 
  41        To build a given target, make executes the list of commands, called a
  42        rule. This rule can be listed explicitly in the target's makefile
  43        entry, or it can be supplied implicitly by make.
  44 
  45 
  46        If no target is specified on the command line, make uses the first
  47        target defined in makefile.
  48 
  49 
  50        If a target has no makefile entry, or if its entry has no rule, make
  51        attempts to derive a rule by each of the following methods, in turn,
  52        until a suitable rule is found. Each method is described under Usage
  53        below.
  54 
  55            o      Pattern matching rules.
  56 
  57            o      Implicit rules, read in from a user-supplied makefile.
  58 
  59            o      Standard implicit rules (also known as suffix rules),
  60                   typically read in from the file
  61                   /usr/share/lib/make/make.rules.
  62 
  63            o      SCCS retrieval. make retrieves the most recent version from
  64                   the SCCS history file (if any).  See the description of the
  65                   .SCCS_GET: special-function target for details.
  66 
  67            o      The rule from the .DEFAULT: target entry, if there is such
  68                   an entry in the makefile.
  69 
  70 
  71        If there is no makefile entry for a target, if no rule can be derived
  72        for building it, and if no file by that name is present, make issues an
  73        error message and halts.
  74 
  75 OPTIONS
  76        The following options are supported:
  77 
  78        -d
  79                        Displays the reasons why make chooses to rebuild a
  80                        target. make displays any and all dependencies that are
  81                        newer. In addition, make displays options read in from
  82                        the MAKEFLAGS environment variable.
  83 
  84 
  85        -dd
  86                        Displays the dependency check and processing in vast
  87                        detail.
  88 
  89 
  90        -D
  91                        Displays the text of the makefiles read in.
  92 
  93 
  94        -DD
  95                        Displays the text of the makefiles, make.rules file,
  96                        the state file, and all hidden-dependency reports.
  97 
  98 
  99        -e
 100                        Environment variables override assignments within
 101                        makefiles.
 102 
 103 
 104        -f makefile
 105                        Uses the description file makefile. A as the makefile
 106                        argument denotes the standard input. The contents of
 107                        makefile, when present, override the standard set of
 108                        implicit rules and predefined macros.  When more than
 109                        one -f makefile argument pair appears, make uses the
 110                        concatenation of those files, in order of appearance.
 111 
 112                        When no makefile is specified, /usr/bin/make tries the
 113                        following in sequence, except when in POSIX mode (see
 114                        .POSIX in Usage):
 115 
 116                            o      If there is a file named makefile in the
 117                                   working directory, make uses that file. If,
 118                                   however, there is an SCCS history file
 119                                   (SCCS/s.makefile) which is newer, make
 120                                   attempts to retrieve and use the most recent
 121                                   version.
 122 
 123                            o      In the absence of the above file(s), if a
 124                                   file named Makefile is present in the
 125                                   working directory, make attempts to use it.
 126                                   If there is an SCCS history file
 127                                   (SCCS/s.Makefile) that is newer, make
 128                                   attempts to retrieve and use the most recent
 129                                   version.
 130                        When no makefile is specified, /usr/bin/make in POSIX
 131                        mode and /usr/xpg4/bin/make try the following files in
 132                        sequence:
 133 
 134                            o      ./makefile, ./Makefile
 135 
 136                            o      s.makefile, SCCS/s.makefile
 137 
 138                            o      s.Makefile, SCCS/s.Makefile
 139 
 140 
 141        -i
 142                        Ignores error codes returned by commands.  Equivalent
 143                        to the special-function target .IGNORE:.
 144 
 145 
 146        -k
 147                        When a nonzero error status is returned by a rule, or
 148                        when make cannot find a rule, abandons work on the
 149                        current target, but continues with other dependency
 150                        branches that do not depend on it.
 151 
 152 
 153        -K statefile
 154                        Uses the state file statefile. A as the statefile
 155                        argument denotes the standard input. The contents of
 156                        statefile, when present, override the standard set of
 157                        implicit rules and predefined macros.  When more than
 158                        one -K statefile argument pair appears, make uses the
 159                        concatenation of those files, in order of appearance.
 160                        (See also .KEEP_STATE  and .KEEP_STATE_FILE in the
 161                        Special-Function Targets section).
 162 
 163 
 164        -n
 165                        No execution mode. Prints commands, but does not
 166                        execute them. Even lines beginning with an @ are
 167                        printed. However, if a command line contains a
 168                        reference to the $(MAKE) macro, that line is always
 169                        executed (see the discussion of MAKEFLAGS in Reading
 170                        Makefiles and the Environment). When in POSIX mode,
 171                        lines beginning with a "+" are executed.
 172 
 173 
 174        -p
 175                        Prints out the complete set of macro definitions and
 176                        target descriptions.
 177 
 178 
 179        -P
 180                        Merely reports dependencies, rather than building them.
 181 
 182 
 183        -q
 184                        Question mode. make returns a zero or nonzero status
 185                        code depending on whether or not the target file is up
 186                        to date. When in POSIX mode, lines beginning with a "+"
 187                        are executed.
 188 
 189 
 190        -r
 191                        Does not read in the default makefile
 192                        /usr/share/lib/make/make.rules.
 193 
 194 
 195        -s
 196                        Silent mode. Does not print command lines before
 197                        executing them. Equivalent to the special-function
 198                        target .SILENT:.
 199 
 200 
 201        -S
 202                        Undoes the effect of the -k option. Stops processing
 203                        when a non-zero exit status is returned by a command.
 204 
 205 
 206        -t
 207                        Touches the target files (bringing them up to date)
 208                        rather than performing their rules. Warning: This can
 209                        be dangerous when files are maintained by more than one
 210                        person. When the .KEEP_STATE: target appears in the
 211                        makefile, this option updates the state file just as if
 212                        the rules had been performed. When in POSIX mode, lines
 213                        beginning with a "+" are executed.
 214 
 215 
 216        -V
 217                        Puts make into SysV mode. Refer to sysV-make(1) for
 218                        respective details.
 219 
 220 
 221 OPERANDS
 222        The following operands are supported:
 223 
 224        target
 225                       Target names, as defined in Usage.
 226 
 227 
 228        macro=value
 229                       Macro definition. This definition overrides any regular
 230                       definition for the specified macro within the makefile
 231                       itself, or in the environment. However, this definition
 232                       can still be overridden by conditional macro
 233                       assignments.
 234 
 235 
 236 USAGE
 237        The usage of make is described below:
 238 
 239    Reading Makefiles and the Environment
 240        When make first starts, it reads the MAKEFLAGS environment variable to
 241        obtain any of the following options specified present in its value: -d,
 242        -D, -e, -i, -k, -n, -p, -q, -r, -s, -S, or -t. Due to the implementation of
 243        POSIX.2 (see POSIX.2(5), the MAKEFLAGS values contains a leading
 244        character. The make utility then reads the command line for additional
 245        options, which also take effect.
 246 
 247 
 248        Next, make reads in a default makefile that typically contains
 249        predefined macro definitions, target entries for implicit rules, and
 250        additional rules, such as the rule for retrieving SCCS files. If
 251        present, make uses the file make.rules in the current directory;
 252        otherwise it reads the file /usr/share/lib/make/make.rules, which
 253        contains the standard definitions and rules. Use the directive:
 254 
 255          include /usr/share/lib/make/make.rules
 256 
 257 
 258 
 259 
 260        in your local make.rules file to include them.
 261 
 262 
 263        Next, make imports variables from the environment (unless the -e option
 264        is in effect), and treats them as defined macros. Because make uses the
 265        most recent definition it encounters, a macro definition in the
 266        makefile normally overrides an environment variable of the same name.
 267        When -e is in effect, however, environment variables are read in after
 268        all makefiles have been read. In that case, the environment variables
 269        take precedence over definitions in the makefile.
 270 
 271 
 272        Next, make reads any makefiles you specify with -f, or one of makefile
 273        or Makefile as described above and then the state file, in the local
 274        directory if it exists. If the makefile contains a .KEEP_STATE_FILE
 275        target, then it reads the state file that follows the target. Refer to
 276        special target .KEEP_STATE_FILE for details.
 277 
 278 
 279        Next (after reading the environment if -e is in effect), make reads in
 280        any macro definitions supplied as command line arguments. These
 281        override macro definitions in the makefile and the environment both,
 282        but only for the make command itself.
 283 
 284 
 285        make exports environment variables, using the most recently defined
 286        value. Macro definitions supplied on the command line are not normally
 287        exported, unless the macro is also an environment variable.
 288 
 289 
 290        make does not export macros defined in the makefile. If an environment
 291        variable is set, and a macro with the same name is defined on the
 292        command line, make exports its value as defined on the command line.
 293        Unless -e is in effect, macro definitions within the makefile take
 294        precedence over those imported from the environment.
 295 
 296 
 297        The macros MAKEFLAGS, MAKE, SHELL, HOST_ARCH, HOST_MACH, and
 298        TARGET_MACH are special cases. See Special-Purpose Macros below for
 299        details.
 300 
 301    Makefile Target Entries
 302        A target entry has the following format:
 303 
 304                 target [:|::] [dependency] ... [; command] ...
 305                                [command]
 306                                ...
 307 
 308 
 309 
 310        The first line contains the name of a target, or a space-separated list
 311        of target names, terminated with a colon or double colon. If a list of
 312        targets is given, this is equivalent to having a separate entry of the
 313        same form for each target. The colon(s) can be followed by a
 314        dependency, or a dependency list. make checks this list before building
 315        the target. The dependency list can be terminated with a semicolon (;),
 316        which in turn can be followed by a single Bourne shell command.
 317        Subsequent lines in the target entry begin with a TAB and contain
 318        Bourne shell commands. These commands comprise the rule for building
 319        the target.
 320 
 321 
 322        Shell commands can be continued across input lines by escaping the
 323        NEWLINE with a backslash (\). The continuing line must also start with
 324        a TAB.
 325 
 326 
 327        To rebuild a target, make expands macros, strips off initial TAB
 328        characters and either executes the command directly (if it contains no
 329        shell metacharacters), or passes each command line to a Bourne shell
 330        for execution.
 331 
 332 
 333        The first non-empty line that does not begin with a TAB or # begins
 334        another target or macro definition.
 335 
 336    Special Characters
 337        Special characters are defined below.
 338 
 339    Global
 340        #
 341                            Start a comment. The comment ends at the next
 342                            NEWLINE. If the # follows the TAB in a command
 343                            line, that line is passed to the shell (which also
 344                            treats # as the start of a comment).
 345 
 346 
 347        include filename
 348                            If the word include appears as the first seven
 349                            letters of a line and is followed by a SPACE or
 350                            TAB, the string that follows is taken as a filename
 351                            to interpolate at that line. include files can be
 352                            nested to a depth of no more than 38 nested
 353                            makefiles . If filename is a macro reference, it is
 354                            expanded.
 355 
 356 
 357    Targets and Dependencies
 358        :
 359            Target list terminator. Words following the colon are added to the
 360            dependency list for the target or targets. If a target is named in
 361            more than one colon-terminated target entry, the dependencies for
 362            all its entries are added to form that target's complete dependency
 363            list.
 364 
 365 
 366        ::
 367            Target terminator for alternate dependencies. When used in place of
 368            a : the double-colon allows a target to be checked and updated with
 369            respect to alternate dependency lists. When the target is out-of-date
 370            with respect to dependencies listed in the first alternate, it is
 371            built according to the rule for that entry. When out-of-date with
 372            respect to dependencies in another alternate, it is built according
 373            the rule in that other entry. Implicit rules do not apply to
 374            double-colon targets; you must supply a rule for each entry. If no
 375            dependencies are specified, the rule is always performed.
 376 
 377 
 378        target [+ target...] :
 379            Target group. The rule in the target entry builds all the indicated
 380            targets as a group. It is normally performed only once per make
 381            run, but is checked for command dependencies every time a target in
 382            the group is encountered in the dependency scan.
 383 
 384 
 385        %
 386            Pattern matching wild card metacharacter.  Like the * shell wild
 387            card, % matches any string of zero or more characters in a target
 388            name or dependency, in the target portion of a conditional macro
 389            definition, or within a pattern replacement macro reference. Notice
 390            that only one % can appear in a target, dependency-name, or pattern-
 391            replacement macro reference.
 392 
 393 
 394        ./pathname
 395            make ignores the leading ./ characters from targets with names
 396            given as pathnames relative to "dot," the working directory.
 397 
 398 
 399    Macros
 400        =
 401                 Macro definition. The word to the left of this character is
 402                 the macro name; words to the right comprise its value. Leading
 403                 and trailing white space characters are stripped from the
 404                 value. A word break following the = is implied.
 405 
 406 
 407        $
 408                 Macro reference. The following character, or the parenthesized
 409                 or bracketed string, is interpreted as a macro reference: make
 410                 expands the reference (including the $) by replacing it with
 411                 the macro's value.
 412 
 413 
 414        ( )
 415        { }
 416                 Macro-reference name delimiters. A parenthesized or bracketed
 417                 word appended to a $ is taken as the name of the macro being
 418                 referred to. Without the delimiters, make recognizes only the
 419                 first character as the macro name.
 420 
 421 
 422        $$
 423                 A reference to the dollar-sign macro, the value of which is the
 424                 character $. Used to pass variable expressions beginning with
 425                 $ to the shell, to refer to environment variables which are
 426                 expanded by the shell, or to delay processing of dynamic
 427                 macros within the dependency list of a target, until that
 428                 target is actually processed.
 429 
 430 
 431        \$
 432                 Escaped dollar-sign character.  Interpreted as a literal dollar
 433                 sign within a rule.
 434 
 435 
 436        +=
 437                 When used in place of =, appends a string to a macro
 438                 definition (must be surrounded by white space, unlike =).
 439 
 440 
 441        :=
 442                 Conditional macro assignment. When preceded by a list of
 443                 targets with explicit target entries, the macro definition
 444                 that follows takes effect when processing only those targets,
 445                 and their dependencies.
 446 
 447 
 448        :sh =
 449                 Define the value of a macro to be the output of a command (see
 450                 Command Substitutions below).
 451 
 452 
 453        :sh
 454                 In a macro reference, execute the command stored in the macro,
 455                 and replace the reference with the output of that command (see
 456                 Command Substitutions below).
 457 
 458 
 459    Rules
 460        +
 461                make always executes the commands preceded by a "+", even when
 462                -n is specified.
 463 
 464 
 465 
 466                make ignores any nonzero error code returned by a command line
 467                for which the first non-TAB character is a. This character is
 468                not passed to the shell as part of the command line. make
 469                normally terminates when a command returns nonzero status,
 470                unless the -i or -k options, or the .IGNORE: special-function
 471                target is in effect.
 472 
 473 
 474        @
 475                If the first non-TAB character is a @, make does not print the
 476                command line before executing it. This character is not passed
 477                to the shell.
 478 
 479 
 480        ?
 481                Escape command-dependency checking. Command lines starting with
 482                this character are not subject to command dependency checking.
 483 
 484 
 485        !
 486                Force command-dependency checking. Command-dependency checking is
 487                applied to command lines for which it would otherwise be
 488                suppressed. This checking is normally suppressed for lines that
 489                contain references to the ? dynamic macro (for example, $?).
 490 
 491                When any combination of +,, @, ?, or ! appear as the first
 492                characters after the TAB, all that are present apply.  None are
 493                passed to the shell.
 494 
 495 
 496    Special-Function Targets
 497        When incorporated in a makefile, the following target names perform
 498        special-functions:
 499 
 500        .DEFAULT:
 501                               If it has an entry in the makefile, the rule for
 502                               this target is used to process a target when
 503                               there is no other entry for it, no rule for
 504                               building it, and no SCCS history file from which
 505                               to retrieve a current version. make ignores any
 506                               dependencies for this target.
 507 
 508 
 509        .DONE:
 510                               If defined in the makefile, make processes this
 511                               target and its dependencies after all other
 512                               targets are built.  This target is also
 513                               performed when make halts with an error, unless
 514                               the .FAILED target is defined.
 515 
 516 
 517        .FAILED:
 518                               This target, along with its dependencies, is
 519                               performed instead of .DONE when defined in the
 520                               makefile and make halts with an error.
 521 
 522 
 523        .GET_POSIX:
 524                               This target contains the rule for retrieving the
 525                               current version of an SCCS file from its history
 526                               file in the current working directory.  make
 527                               uses this rule when it is running in POSIX mode.
 528 
 529 
 530        .IGNORE:
 531                               Ignore errors.  When this target appears in the
 532                               makefile, make ignores non-zero error codes
 533                               returned from commands. When used in POSIX mode,
 534                               .IGNORE could be followed by target names only,
 535                               for which the errors is ignored.
 536 
 537 
 538        .INIT:
 539                               If defined in the makefile, this target and its
 540                               dependencies are built before any other targets
 541                               are processed.
 542 
 543 
 544        .KEEP_STATE:
 545                               If this target is in effect, make updates the
 546                               state file, .make.state, in the current
 547                               directory.  This target also activates command
 548                               dependencies, and hidden dependency checks. If
 549                               either the .KEEP_STATE: target appears in the
 550                               makefile, or the environment variable KEEP_STATE
 551                               is set (setenv KEEP_STATE), make rebuilds
 552                               everything in order to collect dependency
 553                               information, even if all the targets were up to
 554                               date due to previous make runs. See also the
 555                               Environment Variables section.  This target has
 556                               no effect if used in POSIX mode.
 557 
 558 
 559        .KEEP_STATE_FILE:
 560                               This target has no effect if used in POSIX mode.
 561                               This target implies .KEEP_STATE. If the target
 562                               is followed by a filename, make uses it as the
 563                               state file. If the target is followed by a
 564                               directory name, make looks for a .make.state
 565                               file in that directory. If the target is not
 566                               followed by any name, make looks for .make.state
 567                               file in the current working directory.
 568 
 569 
 570        .MAKE_VERSION:
 571                               A target-entry of the form:
 572 
 573                                 .MAKE_VERSION:  VERSIONnumber
 574 
 575                               enables version checking. If the version of make
 576                               differs from the version indicated by a string
 577                               like VERSION-1.0, make issues a warning message.
 578 
 579 
 580        .NO_PARALLEL:
 581                               Currently, this target has no effect, it is,
 582                               however, reserved for future use.
 583 
 584 
 585        .PARALLEL:
 586                               Currently of no effect, but reserved for future
 587                               use.
 588 
 589 
 590        .POSIX:
 591                               This target enables POSIX mode.
 592 
 593 
 594        .PRECIOUS:
 595                               List of files not to delete. make does not
 596                               remove any of the files listed as dependencies
 597                               for this target when interrupted. make normally
 598                               removes the current target when it receives an
 599                               interrupt. When used in POSIX mode, if the
 600                               target is not followed by a list of files, all
 601                               the file are assumed precious.
 602 
 603 
 604        .SCCS_GET:
 605                               This target contains the rule for retrieving the
 606                               current version of an SCCS file from its history
 607                               file. To suppress automatic retrieval, add an
 608                               entry for this target with an empty rule to your
 609                               makefile.
 610 
 611 
 612        .SCCS_GET_POSIX:
 613                               This target contains the rule for retrieving the
 614                               current version of an SCCS file from its history
 615                               file. make uses this rule when it is running in
 616                               POSIX mode.
 617 
 618 
 619        .SILENT:
 620                               Run silently. When this target appears in the
 621                               makefile, make does not echo commands before
 622                               executing them. When used in POSIX mode, it
 623                               could be followed by target names, and only
 624                               those are executed silently.
 625 
 626 
 627        .SUFFIXES:
 628                               The suffixes list for selecting implicit rules
 629                               (see The Suffixes List).
 630 
 631 
 632        .WAIT:
 633                               Currently of no effect, but reserved for future
 634                               use.
 635 
 636 
 637    Clearing Special Targets
 638        In this version of make, you can clear the definition of the following
 639        special targets by supplying entries for them with no dependencies and
 640        no rule:
 641 
 642 
 643        .DEFAULT, .SCCS_GET,  and .SUFFIXES
 644 
 645    Command Dependencies
 646        When the .KEEP_STATE: target is effective, make checks the command for
 647        building a target against the state file. If the command has changed
 648        since the last make run, make rebuilds the target.
 649 
 650    Hidden Dependencies
 651        When the .KEEP_STATE: target is effective, make reads reports from
 652        cpp(1) and other compilation processors for any "hidden" files, such as
 653        #include files. If the target is out of date with respect to any of
 654        these files, make rebuilds it.
 655 
 656    Macros
 657        Entries of the form
 658 
 659          macro=value
 660 
 661 
 662 
 663        define macros. macro is the name of the macro, and value, which
 664        consists of all characters up to a comment character or unescaped
 665        NEWLINE, is the value. make strips both leading and trailing white
 666        space in accepting the value.
 667 
 668 
 669        Subsequent references to the macro, of the forms: $(name) or ${name}
 670        are replaced by value. The parentheses or brackets can be omitted in a
 671        reference to a macro with a single-character name.
 672 
 673 
 674        Macro references can contain references to other macros, in which case
 675        nested references are expanded first.
 676 
 677    Suffix Replacement Macro References
 678        Substitutions within macros can be made as follows:
 679 
 680               $(name:string1=string2)
 681 
 682 
 683 
 684        where string1 is either a suffix, or a word to be replaced in the macro
 685        definition, and string2 is the replacement suffix or word. Words in a
 686        macro value are separated by SPACE, TAB, and escaped NEWLINE
 687        characters.
 688 
 689    Pattern Replacement Macro References
 690        Pattern matching replacements can also be applied to macros, with a
 691        reference of the form:
 692 
 693               $(name: op%os= np%ns)
 694 
 695 
 696 
 697        where op is the existing (old) prefix and os is the existing (old)
 698        suffix, np and ns are the new prefix and new suffix, respectively, and
 699        the pattern matched by % (a string of zero or more characters), is
 700        carried forward from the value being replaced. For example:
 701 
 702          PROGRAM=fabricate
 703          DEBUG= $(PROGRAM:%=tmp/g)
 704 
 705 
 706 
 707 
 708        sets the value of DEBUG to tmp/fabricatg.
 709 
 710 
 711        Notice that pattern replacement macro references cannot be used in the
 712        dependency list of a pattern matching rule; the % characters are not
 713        evaluated independently. Also, any number of % metacharacters can
 714        appear after the equal-sign.
 715 
 716    Appending to a Macro
 717        Words can be appended to macro values as follows:
 718 
 719               macro += word ...
 720 
 721 
 722    Special-Purpose Macros
 723        When the MAKEFLAGS variable is present in the environment, make takes
 724        options from it, in combination with options entered on the command
 725        line.  make retains this combined value as the MAKEFLAGS macro, and
 726        exports it automatically to each command or shell it invokes.
 727 
 728 
 729        Notice that flags passed by way of MAKEFLAGS are only displayed when
 730        the -d, or -dd options are in effect.
 731 
 732 
 733        The MAKE macro is another special case. It has the value make by
 734        default, and temporarily overrides the -n option for any line in which
 735        it is referred to. This allows nested invocations of make written as:
 736 
 737               $(MAKE) ...
 738 
 739 
 740 
 741        to run recursively, with the -n flag in effect for all commands but
 742        make. This lets you use make -n to test an entire hierarchy of
 743        makefiles.
 744 
 745 
 746        For compatibility with the 4.2 BSD make, the MFLAGS macro is set from
 747        the MAKEFLAGS variable by prepending a -. MFLAGS is not exported
 748        automatically.
 749 
 750 
 751        The SHELL macro, when set to a single-word value such as /usr/bin/csh,
 752        indicates the name of an alternate shell to use. The default is
 753        /bin/sh. Notice that make executes commands that contain no shell
 754        metacharacters itself. Built-in commands, such as dirs in the C shell,
 755        are not recognized unless the command line includes a metacharacter
 756        (for instance, a semicolon). This macro is neither imported from, nor
 757        exported to the environment, regardless of -e. To be sure it is set
 758        properly, you must define this macro within every makefile that
 759        requires it.
 760 
 761 
 762        The syntax of the VPATH macro is:
 763 
 764               VPATH = [ pathname [ : pathname ] ... ]
 765 
 766 
 767 
 768        VPATH specifies a list of directories to search for the files, which
 769        are targets or dependencies, when make is executed.  VPATH is also used
 770        in order to search for the include files mentioned in the particular
 771        makefile.
 772 
 773 
 774        When processing a target or a dependency or an include directive, make
 775        checks the existence of the file with the same name in the current
 776        directory.  If the file is found to be missing, make searches for this
 777        file in the list of directories presented in VPATH (like the PATH
 778        variable in the shell). Unlike the PATH variable, VPATH is used in
 779        order to search for the files with relative pathnames. When make
 780        attempts to apply implicit rules to the target, it also searches for
 781        the dependency files using VPATH.
 782 
 783 
 784        When the file is found using VPATH, internal macros $@, @<, $?, $*, and
 785        their alternative forms (with D or F appended) are set in accordance
 786        with the name derived from VPATH. For instance, if the target
 787        subdir/foo.o is found in the directory /aaa/bbb using VPATH, then the
 788        value of the internal macro $@ for this target is
 789        /aaa/bbb/subdir/foo.o.
 790 
 791 
 792        If a target or a dependency file is found using VPATH, then any
 793        occurrences of the word that is the same as the target name in the
 794        subsequent rules are replaced with the actual name of the target
 795        derived from VPATH.
 796 
 797 
 798        For example:
 799 
 800          VPATH=./subdir
 801          file.o : file.c
 802                   cc -c file.c -o file.o
 803 
 804 
 805 
 806 
 807        If file.c is found in ./subdir, then the command
 808 
 809          cc -c ./subdir/file.c -o file.o
 810 
 811 
 812 
 813 
 814        are executed.
 815 
 816 
 817        The following macros are provided for use with cross-compilation:
 818 
 819        HOST_ARCH
 820                       The processor type of the host system. By default, this
 821                       is the output of the mach(1) command, prepended with -.
 822                       Under normal circumstances, this value should never be
 823                       altered by the user.
 824 
 825 
 826        HOST_MACH
 827                       The machine architecture of the host system. By default,
 828                       this is the output of the arch(1) command, prepended
 829                       with. Under normal circumstances, this value should
 830                       never be altered by the user.
 831 
 832 
 833        TARGET_ARCH
 834                       The processor type of the target system. By default, the
 835                       output of mach, prepended with.
 836 
 837 
 838    Dynamic Macros
 839        There are several dynamically maintained macros that are useful as
 840        abbreviations within rules. They are shown here as references; if you
 841        were to define them, make would simply override the definition.
 842 
 843        $*
 844              The basename of the current target, derived as if selected for
 845              use with an implicit rule.
 846 
 847 
 848        $<
 849              The name of a dependency file, derived as if selected for use
 850              with an implicit rule.
 851 
 852 
 853        $@
 854              The name of the current target. This is the only dynamic macro
 855              whose value is strictly determined when used in a dependency
 856              list. (In which case it takes the form $$@.)
 857 
 858 
 859        $?
 860              The list of dependencies that are newer than the target. Command-
 861              dependency checking is automatically suppressed for lines that
 862              contain this macro, just as if the command had been prefixed with
 863              a ?. See the description of ?, under Special Character Rules
 864              above. You can force this check with the ! command-line prefix.
 865 
 866 
 867        $%
 868              The name of the library member being processed. (See Library
 869              Maintenance below.)
 870 
 871 
 872 
 873        To refer to the $@ dynamic macro within a dependency list, precede the
 874        reference with an additional $ character (as in, $$@). Because make
 875        assigns $< and $* as it would for implicit rules      (according to the
 876        suffixes list and the directory contents), they can be unreliable when
 877        used within explicit target entries.
 878 
 879 
 880        These macros can be modified to apply either to the filename part, or
 881        the directory part of the strings they stand for, by adding an upper
 882        case F or D, respectively (and enclosing the resulting name in
 883        parentheses or braces). Thus, $(@D) refers to the directory part of the
 884        string $@; if there is no directory part, . is assigned. $(@F) refers
 885        to the filename part.
 886 
 887    Conditional Macro Definitions
 888        A macro definition of the form:
 889 
 890          target-list := macro = value
 891 
 892 
 893 
 894        indicates that when processing any of the targets listed and their
 895        dependencies, macro is to be set to the value supplied. Notice that if
 896        a conditional macro is referred to in a dependency list, the $ must be
 897        delayed (use $$ instead). Also, target-list can contain a % pattern, in
 898        which case the macro is conditionally defined for all targets
 899        encountered that match the pattern. A pattern replacement reference can
 900        be used within the value.
 901 
 902 
 903        You can temporarily append to a macros value with a conditional
 904        definition of the form:
 905 
 906          target-list := macro += value
 907 
 908 
 909    Predefined Macros
 910        make supplies the macros shown in the table that follows for compilers
 911        and their options, host architectures, and other commands. Unless these
 912        macros are read in as environment variables, their values are not
 913        exported by make. If you run make with any of these set in the
 914        environment, it is a good idea to add commentary to the makefile to
 915        indicate what value each is expected to take. If -r is in effect, make
 916        does not read the default makefile (./make.rules or
 917        /usr/share/lib/make/make.rules) in which these macro definitions are
 918        supplied.
 919 
 920 
 921 
 922 
 923        +---------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 924        |Table of Predefined Macros |              |                                                                                                                                                                                 |
 925        +---------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 926        |           Use             |    Macro     |                                                                                  Default Value                                                                                  |
 927        +---------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 928        |         Library           |      AR      |                                                                                       ar                                                                                        |
 929        |         Archives          |   ARFLAGS    |                                                                                       rv                                                                                        |
 930        +---------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 931        |                           |              |                                                                                                                                                                                 |
 932        |        Assembler          |      AS      |                                                                                       as                                                                                        |
 933        |         Commands          |   ASFLAGS    |                                                                                                                                                                                 |
 934        |                           |  COMPILE.s   |                                                                                $(AS) $(ASFLAGS)                                                                                 |
 935        |                           |  COMPILE.S   |                                                                         $(CC) $(ASFLAGS) $(CPPFLAGS) -c                                                                         |
 936        +---------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 937        |                           |              |                                                                                                                                                                                 |
 938        |            C              |      CC      |                                                                                       cc                                                                                        |
 939        |         Compiler          |    CFLAGS    |                                                                                                                                                                                 |
 940        |         Commands          |   CPPFLAGS   |                                                                                                                                                                                 |
 941        |                           |  COMPILE.c   |                                                                         $(CC) $(CFLAGS) $(CPPFLAGS) -c                                                                          |
 942        |                           |    LINK.c    |                                                                     $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)                                                                      |
 943        +---------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 944        |                           |              |                                                                                                                                                                                 |
 945        |           C++             |     CCC      |                                                                                       CC                                                                                        |
 946        |         Compiler          |   CCFLAGS    |                                                                                     CFLAGS                                                                                      |
 947        |         Commands          |   CPPFLAGS   |                                                                                                                                                                                 |
 948        |                           |  COMPILE.cc  |                                                                        $(CCC) $(CCFLAGS) $(CPPFLAGS) -c                                                                         |
 949        |                           |   LINK.cc    |                                                                    $(CCC) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS)                                                                     |
 950        |                           |  COMPILE.C   |                                                                        $(CCC) $(CCFLAGS) $(CPPFLAGS) -c                                                                         |
 951        |                           |    LINK.C    |                                                                    $(CCC) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS)                                                                     |
 952        +---------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 953        |                           |              |                                                                                                                                                                                 |
 954        |        FORTRAN 77         |      FC      |                                                                                       f77                                                                                       |
 955        |         Compiler          |    FFLAGS    |                                                                                                                                                                                 |
 956        |         Commands          |  COMPILE.f   |                                                                               $(FC) $(FFLAGS) -c                                                                                |
 957        |                           |    LINK.f    |                                                                           $(FC) $(FFLAGS) $(LDFLAGS)                                                                            |
 958        |                           |  COMPILE.F   |                                                                         $(FC) $(FFLAGS) $(CPPFLAGS) -c                                                                          |
 959        |                           |    LINK.F    |                                                                     $(FC) $(FFLAGS) $(CPPFLAGS) $(LDFLAGS)                                                                      |
 960        +---------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 961        |                           |              |                                                                                                                                                                                 |
 962        |        FORTRAN 90         |      FC      |                                                                                       f90                                                                                       |
 963        |         Compiler          |   F90FLAGS   |                                                                                                                                                                                 |
 964        |         Commands          | COMPILE.f90  |                                                                             $(F90C) $(F90FLAGS) -c                                                                              |
 965        |                           |   LINK.f90   |                                                                         $(F90C) $(F90FLAGS) $(LDFLAGS)                                                                          |
 966        |                           | COMPILE.ftn  |                                                                       $(F90C) $(F90FLAGS) $(CPPFLAGS) -c                                                                        |
 967        |                           |   LINK.ftn   |                                                                   $(F90C) $(F90FLAGS) $(CPPFLAGS) $(LDFLAGS)                                                                    |
 968        +---------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 969        |                           |              |                                                                                                                                                                                 |
 970        |       Link Editor         |      LD      |                                                                                       ld                                                                                        |
 971        |         Command           |   LDFLAGS    |                                                                                                                                                                                 |
 972        +---------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 973        |                           |              |                                                                                                                                                                                 |
 974        |           lex             |     LEX      |                                                                                       lex                                                                                       |
 975        |         Command           |    LFLAGS    |                                                                                                                                                                                 |
 976        |                           |    LEX.l     |                                                                               $(LEX) $(LFLAGS) -t                                                                               |
 977        +---------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 978        |                           |              |                                                                                                                                                                                 |
 979        |           lint            |     LINT     |                                                                                      lint                                                                                       |
 980        |         Command           |  LINTFLAGS   |                                                                                                                                                                                 |
 981        |                           |    LINT.c    |                                                                        $(LINT) $(LINTFLAGS) $(CPPFLAGS)                                                                         |
 982        +---------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 983        |                           |              |                                                                                                                                                                                 |
 984        |         Modula 2          |     M2C      |                                                                                       m2c                                                                                       |
 985        |         Commands          |   M2FLAGS    |                                                                                                                                                                                 |
 986        |                           |   MODFLAGS   |                                                                                                                                                                                 |
 987        |                           |   DEFFLAGS   |                                                                                                                                                                                 |
 988        |                           | COMPILE.def  |                                                                          $(M2C) $(M2FLAGS) $(DEFFLAGS)                                                                          |
 989        |                           | COMPILE.mod  |                                                                          $(M2C) $(M2FLAGS) $(MODFLAGS)                                                                          |
 990        +---------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 991        |                           |              |                                                                                                                                                                                 |
 992        |          Pascal           |      PC      |                                                                                       pc                                                                                        |
 993        |         Compiler          |    PFLAGS    |                                                                                                                                                                                 |
 994        |         Commands          |  COMPILE.p   |                                                                         $(PC) $(PFLAGS) $(CPPFLAGS) -c                                                                          |
 995        |                           |    LINK.p    |                                                                     $(PC) $(PFLAGS) $(CPPFLAGS) $(LDFLAGS)                                                                      |
 996        +---------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 997        |                           |              |                                                                                                                                                                                 |
 998        |          Ratfor           |    RFLAGS    |                                                                                                                                                                                 |
 999        |       Compilation         |  COMPILE.r   |                                                                          $(FC) $(FFLAGS) $(RFLAGS) -c                                                                           |
1000        |         Commands          |    LINK.r    |                                                                      $(FC) $(FFLAGS) $(RFLAGS) $(LDFLAGS)                                                                       |
1001        +---------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1002        |                           |              |                                                                                                                                                                                 |
1003        |        rm Command         |      RM      |                                                                                      rm -f                                                                                      |
1004        +---------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1005        |                           |              |                                                                                                                                                                                 |
1006        |           sccs            |  SCCSFLAGS   |                                                                                                                                                                                 |
1007        |         Command           | SCCSGETFLAGS |                                                                                       -s                                                                                        |
1008        +---------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1009        |                           |              |                                                                                                                                                                                 |
1010        |           yacc            |     YACC     |                                                                                      yacc                                                                                       |
1011        |         Command           |    YFLAGS    |                                                                                                                                                                                 |
1012        |                           |    YACC.y    |                                                                                $(YACC) $(YFLAGS)                                                                                |
1013        +---------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1014        |                           |              |                                                                                                                                                                                 |
1015        |      Suffixes List        |   SUFFIXES   | .o .c .c~ .cc .cc~ .y .y~ .l .l~ .s .s~ .sh .sh~ .S .S~ .ln .h .h~ .f .f~ .F .F~  .mod .mod~ .sym .def .def~ .p .p~ .r .r~ .cps .cps~ .C .C~ .Y .Y~ .L .L .f90 .f90~ .ftn .ftn~ |
1016        +---------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1017 
1018    Implicit Rules
1019        When a target has no entry in the makefile, make attempts to determine
1020        its class (if any) and apply the rule for that class. An implicit rule
1021        describes how to build any target of a given class, from an associated
1022        dependency file. The class of a target can be determined either by a
1023        pattern, or by a suffix; the corresponding dependency file (with the
1024        same basename) from which such a target might be built. In addition to
1025        a predefined set of implicit rules, make allows you to define your own,
1026        either by pattern, or by suffix.
1027 
1028    Pattern Matching Rules
1029        A target entry of the form:
1030 
1031          tp%ts:dp%ds
1032               rule
1033 
1034 
1035 
1036 
1037        is a pattern matching rule, in which tp is a target prefix, ts is a
1038        target suffix, dp is a dependency prefix, and ds is a dependency suffix
1039        (any of which can be null). The % stands for a basename of zero or more
1040        characters that is matched in the target, and is used to construct the
1041        name of a dependency. When make encounters a match in its search for an
1042        implicit rule, it uses the rule in that target entry to build the
1043        target from the dependency file. Pattern-matching implicit rules
1044        typically make use of the $@ and $< dynamic macros as placeholders for
1045        the target and dependency names. Other, regular dependencies can occur
1046        in the dependency list; however, none of the regular dependencies can
1047        contain %. An entry of the form:
1048 
1049          tp%ts:[dependency ...] dp%ds[dependency ...]
1050               rule
1051 
1052 
1053 
1054 
1055        is a valid pattern matching rule.
1056 
1057    Suffix Rules
1058        When no pattern matching rule applies, make checks the target name to
1059        see if it ends with a suffix in the known suffixes list. If so, make
1060        checks for any suffix rules, as well as a dependency file with same
1061        root and another recognized suffix, from which to build it.
1062 
1063 
1064        The target entry for a suffix rule takes the form:
1065 
1066          DsTs: rule
1067 
1068 
1069 
1070 
1071        where Ts is the suffix of the target, Ds is the suffix of the
1072        dependency file, and rule is the rule for building a target in the
1073        class.  Both Ds and Ts must appear in the suffixes list. (A suffix need
1074        not begin with a . to be recognized.)
1075 
1076 
1077        A suffix rule with only one suffix describes how to build a target
1078        having a null (or no) suffix from a dependency file with the indicated
1079        suffix. For instance, the .c rule could be used to build an executable
1080        program named file from a C source file named file.c. If a target with
1081        a null suffix has an explicit dependency, make omits the search for a
1082        suffix rule.
1083 
1084 
1085 
1086 
1087        +-------------------------------------------------------------+-------------------------------+
1088        |Table of Standard Implicit (Suffix) Rules for Assembly Files |                               |
1089        +-------------------------------------------------------------+-------------------------------+
1090        |                     Implicit Rule Name                      |         Command Line          |
1091        +-------------------------------------------------------------+-------------------------------+
1092        |                            .s.o                             |     $(COMPILE.s) -o $@ $<     |
1093        +-------------------------------------------------------------+-------------------------------+
1094        |                                                             |                               |
1095        |                            .s.a                             |     $(COMPILE.s) -o $% $<     |
1096        |                                                             |    $(AR) $(ARFLAGS) $@ $%     |
1097        |                                                             |           $(RM) $%            |
1098        +-------------------------------------------------------------+-------------------------------+
1099        |                                                             |                               |
1100        |                           .s~.o                             | $(GET) $(GFLAGS) -p $< >   $*.s |
1101        |                                                             |    $(COMPILE.s) -o $@ $*.s    |
1102        +-------------------------------------------------------------+-------------------------------+
1103        |                                                             |                               |
1104        |                            .S.o                             |     $(COMPILE.S) -o $@ $<     |
1105        +-------------------------------------------------------------+-------------------------------+
1106        |                                                             |                               |
1107        |                            .S.a                             |     $(COMPILE.S) -o $% $<     |
1108        |                                                             |    $(AR) $(ARFLAGS) $@ $%     |
1109        |                                                             |           $(RM) $%            |
1110        +-------------------------------------------------------------+-------------------------------+
1111        |                                                             |                               |
1112        |                           .S~.o                             | $(GET) $(GFLAGS) -p $< >   $*.S |
1113        |                                                             |    $(COMPILE.S) -o $@ $*.S    |
1114        +-------------------------------------------------------------+-------------------------------+
1115        |                                                             |                               |
1116        |                           .S~.a                             | $(GET) $(GFLAGS) -p $< >   $*.S |
1117        |                                                             |    $(COMPILE.S) -o $% $*.S    |
1118        |                                                             |    $(AR) $(ARFLAGS) $@ $%     |
1119        |                                                             |           $(RM) $%            |
1120        +-------------------------------------------------------------+-------------------------------+
1121 
1122 
1123 
1124 
1125        +------------------------------------------------------+---------------------------------------+
1126        |Table of Standard Implicit (Suffix) Rules for C Files |                                       |
1127        +------------------------------------------------------+---------------------------------------+
1128        |                 Implicit Rule Name                   |             Command Line              |
1129        +------------------------------------------------------+---------------------------------------+
1130        |                         .c                           |     $(LINK.c) -o $@ $< $(LDLIBS)      |
1131        +------------------------------------------------------+---------------------------------------+
1132        |                                                      |                                       |
1133        |                        .c.ln                         |   $(LINT.c) $(OUTPUT_OPTION) -i $<    |
1134        +------------------------------------------------------+---------------------------------------+
1135        |                                                      |                                       |
1136        |                        .c.o                          |   $(COMPILE.c) $(OUTPUT_OPTION) $<    |
1137        +------------------------------------------------------+---------------------------------------+
1138        |                                                      |                                       |
1139        |                        .c.a                          |         $(COMPILE.c) -o $% $<              |
1140        |                                                      |        $(AR) $(ARFLAGS) $@ $%         |
1141        |                                                      |               $(RM) $%                |
1142        +------------------------------------------------------+---------------------------------------+
1143        |                                                      |                                       |
1144        |                         .c~                          |     $(GET) $(GFLAGS) -p $< > $*.c     |
1145        |                                                      | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $*.c |
1146        +------------------------------------------------------+---------------------------------------+
1147        |                                                      |                                       |
1148        |                        .c~.o                         |     $(GET) $(GFLAGS) -p $< > $*.c     |
1149        |                                                      |        $(CC) $(CFLAGS) -c $*.c        |
1150        +------------------------------------------------------+---------------------------------------+
1151        |                                                      |                                       |
1152        |                       .c~.ln                         |     $(GET) $(GFLAGS) -p $< > $*.c     |
1153        |                                                      |  $(LINT.c) $(OUTPUT_OPTION) -c $*.c   |
1154        +------------------------------------------------------+---------------------------------------+
1155        |                                                      |                                       |
1156        |                        .c~.a                         |     $(GET) $(GFLAGS) -p $< > $*.c     |
1157        |                                                      |        $(COMPILE.c) -o $% $*.c        |
1158        |                                                      |        $(AR) $(ARFLAGS) $@ $%         |
1159        |                                                      |               $(RM) $%                |
1160        +------------------------------------------------------+---------------------------------------+
1161 
1162 
1163 
1164 
1165        +--------------------------------------------------------+--------------------------------------+
1166        |Table of Standard Implicit (Suffix) Rules for C++ Files |                                      |
1167        +--------------------------------------------------------+--------------------------------------+
1168        |                  Implicit Rule Name                    |             Command Line             |
1169        +--------------------------------------------------------+--------------------------------------+
1170        |                          .cc                           |    $(LINK.cc) -o $@ $< $(LDLIBS)     |
1171        +--------------------------------------------------------+--------------------------------------+
1172        |                                                        |                                      |
1173        |                         .cc.o                          |  $(COMPILE.cc) $(OUTPUT_OPTION) $<   |
1174        +--------------------------------------------------------+--------------------------------------+
1175        |                                                        |                                      |
1176        |                         .cc.a                          |        $(COMPILE.cc) -o $% $<             |
1177        |                                                        |        $(AR) $(ARFLAGS) $@ $%        |
1178        |                                                        |               $(RM) $%               |
1179        +--------------------------------------------------------+--------------------------------------+
1180        |                                                        |                                      |
1181        |                         .cc~                           |    $(GET) $(GFLAGS) -p $< > $*.cc    |
1182        |                                                        |   $(LINK.cc) -o $@ $*.cc $(LDLIBS)   |
1183        +--------------------------------------------------------+--------------------------------------+
1184        |                                                        |                                      |
1185        |                         .cc.o                          |  $(COMPILE.cc) $(OUTPUT_OPTION) $<   |
1186        +--------------------------------------------------------+--------------------------------------+
1187        |                                                        |                                      |
1188        |                        .cc~.o                          |    $(GET) $(GFLAGS) -p $< > $*.cc    |
1189        |                                                        | $(COMPILE.cc) $(OUTPUT_OPTION) $*.cc |
1190        +--------------------------------------------------------+--------------------------------------+
1191        |                                                        |                                      |
1192        |                         .cc.a                          |        $(COMPILE.cc) -o $% $<             |
1193        |                                                        |        $(AR) $(ARFLAGS) $@ $%        |
1194        |                                                        |               $(RM) $%               |
1195        +--------------------------------------------------------+--------------------------------------+
1196        |                                                        |                                      |
1197        |                        .cc~.a                          |    $(GET) $(GFLAGS) -p $< > $*.cc    |
1198        |                                                        |      $(COMPILE.cc) -o $% $*.cc       |
1199        |                                                        |        $(AR) $(ARFLAGS) $@ $%        |
1200        |                                                        |               $(RM) $%               |
1201        +--------------------------------------------------------+--------------------------------------+
1202        |                                                        |                                      |
1203        |                          .C                            |     $(LINK.C) -o $@ $< $(LDLIBS)     |
1204        +--------------------------------------------------------+--------------------------------------+
1205        |                                                        |                                      |
1206        |                          .C~                           |    $(GET) $(GFLAGS) -p $< > $*.C     |
1207        |                                                        |    $(LINK.C) -o $@ $*.C $(LDLIBS)    |
1208        +--------------------------------------------------------+--------------------------------------+
1209        |                                                        |                                      |
1210        |                         .C.o                           |   $(COMPILE.C) $(OUTPUT_OPTION) $<   |
1211        +--------------------------------------------------------+--------------------------------------+
1212        |                                                        |                                      |
1213        |                         .C~.o                          |    $(GET) $(GFLAGS) -p $< > $*.C     |
1214        |                                                        |  $(COMPILE.C) $(OUTPUT_OPTION) $*.C  |
1215        +--------------------------------------------------------+--------------------------------------+
1216        |                                                        |                                      |
1217        |                         .C.a                           |        $(COMPILE.C) -o $% $<              |
1218        |                                                        |        $(AR) $(ARFLAGS) $@ $%        |
1219        |                                                        |               $(RM) $%               |
1220        +--------------------------------------------------------+--------------------------------------+
1221        |                                                        |                                      |
1222        |                         .C~.a                          |    $(GET) $(GFLAGS) -p $< > $*.C     |
1223        |                                                        |       $(COMPILE.C) -o $% $*.C        |
1224        |                                                        |        $(AR) $(ARFLAGS) $@ $%        |
1225        |                                                        |               $(RM) $%               |
1226        +--------------------------------------------------------+--------------------------------------+
1227 
1228 
1229 
1230 
1231        +---------------------------------------------------------------+---------------------------------------+
1232        |Table of Standard Implicit (Suffix) Rules for FORTRAN 77 Files |                                       |
1233        +---------------------------------------------------------------+---------------------------------------+
1234        |                      Implicit Rule Name                       |             Command Line              |
1235        +---------------------------------------------------------------+---------------------------------------+
1236        |                              .f                               |     $(LINK.f) -o $@ $<      $(LDLIBS)      |
1237        +---------------------------------------------------------------+---------------------------------------+
1238        |                                                               |                                       |
1239        |                             .f.o                              |   $(COMPILE.f) $(OUTPUT_OPTION) $<    |
1240        +---------------------------------------------------------------+---------------------------------------+
1241        |                                                               |                                       |
1242        |                             .f.a                              |         $(COMPILE.f) -o $% $<              |
1243        |                                                               |        $(AR) $(ARFLAGS) $@ $%         |
1244        |                                                               |               $(RM) $%                |
1245        +---------------------------------------------------------------+---------------------------------------+
1246        |                                                               |                                       |
1247        |                              .f                               |     $(LINK.f) -o $@ $<      $(LDLIBS)      |
1248        +---------------------------------------------------------------+---------------------------------------+
1249        |                                                               |                                       |
1250        |                             .f~                               |     $(GET) $(GFLAGS) -p $< > $*.f     |
1251        |                                                               | $(FC) $(FFLAGS) $(LDFLAGS) -o $@ $*.f |
1252        +---------------------------------------------------------------+---------------------------------------+
1253        |                                                               |                                       |
1254        |                            .f~.o                              |     $(GET) $(GFLAGS) -p $< > $*.f     |
1255        |                                                               |        $(FC) $(FFLAGS) -c $*.f        |
1256        +---------------------------------------------------------------+---------------------------------------+
1257        |                                                               |                                       |
1258        |                            .f~.a                              |     $(GET) $(GFLAGS) -p $< > $*.f     |
1259        |                                                               |        $(COMPILE.f) -o $% $*.f        |
1260        |                                                               |        $(AR) $(ARFLAGS) $@ $%         |
1261        |                                                               |               $(RM) $%                |
1262        +---------------------------------------------------------------+---------------------------------------+
1263        |                                                               |                                       |
1264        |                              .F                               |     $(LINK.F) -o $@ $<      $(LDLIBS)      |
1265        +---------------------------------------------------------------+---------------------------------------+
1266        |                                                               |                                       |
1267        |                             .F.o                              |   $(COMPILE.F) $(OUTPUT_OPTION) $<    |
1268        +---------------------------------------------------------------+---------------------------------------+
1269        |                                                               |                                       |
1270        |                             .F.a                              |         $(COMPILE.F) -o $% $<              |
1271        |                                                               |        $(AR) $(ARFLAGS) $@ $%         |
1272        |                                                               |               $(RM) $%                |
1273        +---------------------------------------------------------------+---------------------------------------+
1274        |                                                               |                                       |
1275        |                             .F~                               |     $(GET) $(GFLAGS) -p $< > $*.F     |
1276        |                                                               | $(FC) $(FFLAGS) $(LDFLAGS) -o $@ $*.F |
1277        +---------------------------------------------------------------+---------------------------------------+
1278        |                                                               |                                       |
1279        |                            .F~.o                              |     $(GET) $(GFLAGS) -p $< > $*.F     |
1280        |                                                               |        $(FC) $(FFLAGS) -c $*.F        |
1281        +---------------------------------------------------------------+---------------------------------------+
1282        |                                                               |                                       |
1283        |                            .F~.a                              |     $(GET) $(GFLAGS) -p $< > $*.F     |
1284        |                                                               |        $(COMPILE.F) -o $% $*.F        |
1285        |                                                               |        $(AR) $(ARFLAGS) $@ $%         |
1286        |                                                               |               $(RM) $%                |
1287        +---------------------------------------------------------------+---------------------------------------+
1288 
1289 
1290 
1291 
1292        +---------------------------------------------------------------+----------------------------------------+
1293        |Table of Standard Implicit (Suffix) Rules for FORTRAN 90 Files |                                        |
1294        +---------------------------------------------------------------+----------------------------------------+
1295        |                      Implicit Rule Name                       |              Command Line              |
1296        +---------------------------------------------------------------+----------------------------------------+
1297        |                             .f90                              |     $(LINK.f90) -o $@ $< $(LDLIBS)  |
1298        +---------------------------------------------------------------+----------------------------------------+
1299        |                                                               |                                        |
1300        |                            .f90~                              |    $(GET) $(GFLAGS) -p $< > $*.f90       |
1301        |                                                               |   $(LINK.f90) -o $@ $*.f90 $(LDLIBS)   |
1302        +---------------------------------------------------------------+----------------------------------------+
1303        |                                                               |                                        |
1304        |                            .f90.o                             |   $(COMPILE.f90) $(OUTPUT_OPTION) $<        |
1305        +---------------------------------------------------------------+----------------------------------------+
1306        |                                                               |                                        |
1307        |                           .f90~.o                             |    $(GET) $(GFLAGS) -p $< > $*.f90       |
1308        |                                                               | $(COMPILE.f90) $(OUTPUT_OPTION) $*.f90 |
1309        +---------------------------------------------------------------+----------------------------------------+
1310        |                                                               |                                        |
1311        |                            .f90.a                             |        $(COMPILE.f90) -o $% $<              |
1312        |                                                               |         $(AR) $(ARFLAGS) $@ $%         |
1313        |                                                               |                $(RM) $%                |
1314        +---------------------------------------------------------------+----------------------------------------+
1315        |                                                               |                                        |
1316        |                           .f90~.a                             |    $(GET) $(GFLAGS) -p $< > $*.f90       |
1317        |                                                               |      $(COMPILE.f90) -o $% $*.f90       |
1318        |                                                               |         $(AR) $(ARFLAGS) $@ $%         |
1319        |                                                               |                $(RM) $%                |
1320        +---------------------------------------------------------------+----------------------------------------+
1321        |                                                               |                                        |
1322        |                             .ftn                              |     $(LINK.ftn) -o $@ $< $(LDLIBS)  |
1323        +---------------------------------------------------------------+----------------------------------------+
1324        |                                                               |                                        |
1325        |                            .ftn~                              |    $(GET) $(GFLAGS) -p $< > $*.ftn       |
1326        |                                                               |   $(LINK.ftn) -o $@ $*.ftn $(LDLIBS)   |
1327        +---------------------------------------------------------------+----------------------------------------+
1328        |                                                               |                                        |
1329        |                            .ftn.o                             |   $(COMPILE.ftn) $(OUTPUT_OPTION) $<        |
1330        +---------------------------------------------------------------+----------------------------------------+
1331        |                                                               |                                        |
1332        |                           .ftn~.o                             |    $(GET) $(GFLAGS) -p $< > $*.ftn       |
1333        |                                                               | $(COMPILE.ftn) $(OUTPUT_OPTION) $*.ftn |
1334        +---------------------------------------------------------------+----------------------------------------+
1335        |                                                               |                                        |
1336        |                            .ftn.a                             |        $(COMPILE.ftn) -o $% $<              |
1337        |                                                               |         $(AR) $(ARFLAGS) $@ $%         |
1338        |                                                               |                $(RM) $%                |
1339        +---------------------------------------------------------------+----------------------------------------+
1340        |                                                               |                                        |
1341        |                           .ftn~.a                             |    $(GET) $(GFLAGS) -p $< > $*.ftn       |
1342        |                                                               |      $(COMPILE.ftn) -o $% $*.ftn       |
1343        |                                                               |         $(AR) $(ARFLAGS) $@ $%         |
1344        |                                                               |                $(RM) $%                |
1345        +---------------------------------------------------------------+----------------------------------------+
1346 
1347 
1348 
1349 
1350        +--------------------------------------------------------+--------------------------------+
1351        |Table of Standard Implicit (Suffix) Rules for lex Files |                                |
1352        +--------------------------------------------------------+--------------------------------+
1353        |                  Implicit Rule Name                    |          Command Line          |
1354        +--------------------------------------------------------+--------------------------------+
1355        |                          .l                            |           $(RM) $*.c           |
1356        |                                                        |       $(LEX.l) $< > $*.c         |
1357        |                                                        | $(LINK.c) -o $@ $*.c $(LDLIBS) |
1358        |                                                        |           $(RM) $*.c           |
1359        +--------------------------------------------------------+--------------------------------+
1360        |                                                        |                                |
1361        |                         .l.c                           |            $(RM) $@            |
1362        |                                                        |        $(LEX.l) $< > $@  |
1363        +--------------------------------------------------------+--------------------------------+
1364        |                                                        |                                |
1365        |                         .l.ln                          |           $(RM) $*.c           |
1366        |                                                        |       $(LEX.l) $< > $*.c         |
1367        |                                                        |    $(LINT.c) -o $@ -i $*.c     |
1368        |                                                        |           $(RM) $*.c           |
1369        +--------------------------------------------------------+--------------------------------+
1370        |                                                        |                                |
1371        |                         .l.o                           |           $(RM) $*.c           |
1372        |                                                        |       $(LEX.l) $< > $*.c         |
1373        |                                                        |    $(COMPILE.c) -o $@ $*.c     |
1374        |                                                        |           $(RM) $*.c           |
1375        +--------------------------------------------------------+--------------------------------+
1376        |                                                        |                                |
1377        |                          .l~                           | $(GET) $(GFLAGS) -p $< > $*.l    |
1378        |                                                        |     $(LEX) $(LFLAGS) $*.l      |
1379        |                                                        |  $(CC) $(CFLAGS) -c lex.yy.c   |
1380        |                                                        |         rm -f lex.yy.c         |
1381        |                                                        |         mv lex.yy.c $@         |
1382        +--------------------------------------------------------+--------------------------------+
1383        |                                                        |                                |
1384        |                         .l~.c                          | $(GET) $(GFLAGS) -p $< > $*.l    |
1385        |                                                        |     $(LEX) $(LFLAGS) $*.l      |
1386        |                                                        |         mv lex.yy.c $@         |
1387        +--------------------------------------------------------+--------------------------------+
1388        |                                                        |                                |
1389        |                        .l~.ln                          | $(GET) $(GFLAGS) -p $< > $*.l    |
1390        |                                                        |           $(RM) $*.c           |
1391        |                                                        |      $(LEX.l) $*.l > $*.c   |
1392        |                                                        |    $(LINT.c) -o $@ -i $*.c     |
1393        |                                                        |           $(RM) $*.c           |
1394        +--------------------------------------------------------+--------------------------------+
1395        |                                                        |                                |
1396        |                         .l~.o                          | $(GET) $(GFLAGS) -p $< > $*.l    |
1397        |                                                        |     $(LEX) $(LFLAGS) $*.l      |
1398        |                                                        |  $(CC) $(CFLAGS) -c lex.yy.c   |
1399        |                                                        |         rm -f lex.yy.c         |
1400        |                                                        |         mv lex.yy.c $@         |
1401        +--------------------------------------------------------+--------------------------------+
1402 
1403 
1404 
1405 
1406        +-------------------------------------------------------------+-----------------------------------+
1407        |Table of Standard Implicit (Suffix) Rules for Modula 2 Files |                                   |
1408        +-------------------------------------------------------------+-----------------------------------+
1409        |                     Implicit Rule Name                      |           Command Line            |
1410        +-------------------------------------------------------------+-----------------------------------+
1411        |                            .mod                             |   $(COMPILE.mod) -o $@ -e $@ $<        |
1412        +-------------------------------------------------------------+-----------------------------------+
1413        |                                                             |                                   |
1414        |                           .mod.o                            |      $(COMPILE.mod) -o $@ $<   |
1415        +-------------------------------------------------------------+-----------------------------------+
1416        |                                                             |                                   |
1417        |                          .def.sym                           |      $(COMPILE.def) -o $@ $<   |
1418        +-------------------------------------------------------------+-----------------------------------+
1419        |                                                             |                                   |
1420        |                         .def~.sym                           |  $(GET) $(GFLAGS) -p $< > $*.def    |
1421        |                                                             |    $(COMPILE.def) -o$@ $*.def     |
1422        +-------------------------------------------------------------+-----------------------------------+
1423        |                                                             |                                   |
1424        |                           .mod~                             |  $(GET) $(GFLAGS) -p $< > $*.mod    |
1425        |                                                             | $(COMPILE.mod) -o $@ -e $@ $*.mod |
1426        +-------------------------------------------------------------+-----------------------------------+
1427        |                                                             |                                   |
1428        |                          .mod~.o                            |  $(GET) $(GFLAGS) -p $< > $*.mod    |
1429        |                                                             |    $(COMPILE.mod) -o $@ $*.mod    |
1430        +-------------------------------------------------------------+-----------------------------------+
1431        |                                                             |                                   |
1432        |                          .mod~.a                            |  $(GET) $(GFLAGS) -p $< > $*.mod    |
1433        |                                                             |    $(COMPILE.mod) -o $% $*.mod    |
1434        |                                                             |      $(AR) $(ARFLAGS) $@ $%       |
1435        |                                                             |             $(RM) $%              |
1436        +-------------------------------------------------------------+-----------------------------------+
1437 
1438 
1439 
1440 
1441        +---------------------------------------------------------+---------------------------------+
1442        |Table of Standard Implicit (Suffix) Rules for NeWS Files |                                 |
1443        +---------------------------------------------------------+---------------------------------+
1444        |                   Implicit Rule Name                    |          Command Line           |
1445        +---------------------------------------------------------+---------------------------------+
1446        |                         .cps.h                          |           cps $*.cps            |
1447        +---------------------------------------------------------+---------------------------------+
1448        |                        .cps~.h                          | $(GET) $(GFLAGS) -p $< > $*.cps |
1449        |                                                         |    $(CPS) $(CPSFLAGS) $*.cps    |
1450        +---------------------------------------------------------+---------------------------------+
1451 
1452 
1453 
1454 
1455        +-----------------------------------------------------------+------------------------------------+
1456        |Table of Standard Implicit (Suffix) Rules for Pascal Files |                                    |
1457        +-----------------------------------------------------------+------------------------------------+
1458        |                    Implicit Rule Name                     |            Command Line            |
1459        +-----------------------------------------------------------+------------------------------------+
1460        |                            .p                             |    $(LINK.p) -o $@ $< $(LDLIBS) |
1461        +-----------------------------------------------------------+------------------------------------+
1462        |                                                           |                                    |
1463        |                           .p.o                            |  $(COMPILE.p) $(OUTPUT_OPTION) $<       |
1464        +-----------------------------------------------------------+------------------------------------+
1465        |                                                           |                                    |
1466        |                           .p~                             |   $(GET) $(GFLAGS) -p $< >   $*.p    |
1467        |                                                           |   $(LINK.p) -o $@ $*.p $(LDLIBS)   |
1468        +-----------------------------------------------------------+------------------------------------+
1469        |                                                           |                                    |
1470        |                          .p~.o                            |   $(GET) $(GFLAGS) -p $< >   $*.p    |
1471        |                                                           | $(COMPILE.p) $(OUTPUT_OPTION) $*.p |
1472        +-----------------------------------------------------------+------------------------------------+
1473        |                                                           |                                    |
1474        |                          .p~.a                            |   $(GET) $(GFLAGS) -p $< >   $*.p    |
1475        |                                                           |      $(COMPILE.p) -o $% $*.p       |
1476        |                                                           |       $(AR) $(ARFLAGS) $@ $%       |
1477        |                                                           |              $(RM) $%              |
1478        +-----------------------------------------------------------+------------------------------------+
1479 
1480 
1481 
1482 
1483        +-----------------------------------------------------------+------------------------------------+
1484        |Table of Standard Implicit (Suffix) Rules for Ratfor Files |                                    |
1485        +-----------------------------------------------------------+------------------------------------+
1486        |                    Implicit Rule Name                     |            Command Line            |
1487        +-----------------------------------------------------------+------------------------------------+
1488        |                            .r                             |    $(LINK.r) -o $@ $< $(LDLIBS) |
1489        +-----------------------------------------------------------+------------------------------------+
1490        |                                                           |                                    |
1491        |                           .r.o                            |  $(COMPILE.r) $(OUTPUT_OPTION) $<       |
1492        +-----------------------------------------------------------+------------------------------------+
1493        |                                                           |                                    |
1494        |                           .r.a                            |       $(COMPILE.r) -o $% $<     |
1495        |                                                           |       $(AR) $(ARFLAGS) $@ $%       |
1496        |                                                           |              $(RM) $%              |
1497        +-----------------------------------------------------------+------------------------------------+
1498        |                                                           |                                    |
1499        |                           .r~                             |   $(GET) $(GFLAGS) -p $< >   $*.r    |
1500        |                                                           |   $(LINK.r) -o $@ $*.r $(LDLIBS)   |
1501        +-----------------------------------------------------------+------------------------------------+
1502        |                                                           |                                    |
1503        |                          .r~.o                            |   $(GET) $(GFLAGS) -p $< >   $*.r    |
1504        |                                                           | $(COMPILE.r) $(OUTPUT_OPTION) $*.r |
1505        +-----------------------------------------------------------+------------------------------------+
1506        |                                                           |                                    |
1507        |                          .r~.a                            |   $(GET) $(GFLAGS) -p $< >   $*.r    |
1508        |                                                           |      $(COMPILE.r) -o $% $*.r       |
1509        |                                                           |       $(AR) $(ARFLAGS) $@ $%       |
1510        |                                                           |              $(RM) $%              |
1511        +-----------------------------------------------------------+------------------------------------+
1512 
1513 
1514 
1515 
1516        +---------------------------------------------------------+-----------------------------------------------+
1517        |Table of Standard Implicit (Suffix) Rules for SCCS Files |                                               |
1518        +---------------------------------------------------------+-----------------------------------------------+
1519        |                   Implicit Rule Name                    |                 Command Line                  |
1520        +---------------------------------------------------------+-----------------------------------------------+
1521        |                       .SCCS_GET                         | sccs $(SCCSFLAGS) get $(SCCSGETFLAGS) $@ -G$@ |
1522        |                                                         |                                               |
1523        +---------------------------------------------------------+-----------------------------------------------+
1524        |                                                         |                                               |
1525        |                    .SCCS_GET_POSIX                      |   sccs $(SCCSFLAGS) get $(SCCSGETFLAGS) $@    |
1526        +---------------------------------------------------------+-----------------------------------------------+
1527        |                                                         |                                               |
1528        |                       .GET_POSIX                        |             $(GET) $(GFLAGS) s.$@             |
1529        +---------------------------------------------------------+-----------------------------------------------+
1530 
1531 
1532 
1533 
1534        +------------------------------------------------------------+--------------------------------+
1535        |Table of Standard Implicit (Suffix) Rules for Shell Scripts |                                |
1536        +------------------------------------------------------------+--------------------------------+
1537        |                    Implicit Rule Name                      |          Command Line          |
1538        +------------------------------------------------------------+--------------------------------+
1539        |                            .sh                             |           cat $< >$@             |
1540        |                                                            |          chmod +x $@           |
1541        +------------------------------------------------------------+--------------------------------+
1542        |                                                            |                                |
1543        |                           .sh~                             | $(GET) $(GFLAGS) -p $< > $*.sh |
1544        |                                                            |          cp $*.sh $@           |
1545        |                                                            |          chmod a+x $@          |
1546        +------------------------------------------------------------+--------------------------------+
1547 
1548 
1549 
1550 
1551        +---------------------------------------------------------+-----------------------------------+
1552        |Table of Standard Implicit (Suffix) Rules for yacc Files |                                   |
1553        +---------------------------------------------------------+-----------------------------------+
1554        |                   Implicit Rule Name                    |           Command Line            |
1555        +---------------------------------------------------------+-----------------------------------+
1556        |                           .y                            |           $(YACC.y) $<         |
1557        |                                                         | $(LINK.c) -o $@ y.tab.c $(LDLIBS) |
1558        |                                                         |           $(RM) y.tab.c           |
1559        +---------------------------------------------------------+-----------------------------------+
1560        |                                                         |                                   |
1561        |                          .y.c                           |           $(YACC.y) $<         |
1562        |                                                         |           mv y.tab.c $@           |
1563        +---------------------------------------------------------+-----------------------------------+
1564        |                                                         |                                   |
1565        |                         .y.ln                           |           $(YACC.y) $<         |
1566        |                                                         |    $(LINT.c) -o $@ -i y.tab.c     |
1567        |                                                         |           $(RM) y.tab.c           |
1568        +---------------------------------------------------------+-----------------------------------+
1569        |                                                         |                                   |
1570        |                          .y.o                           |           $(YACC.y) $<         |
1571        |                                                         |    $(COMPILE.c) -o $@ y.tab.c     |
1572        |                                                         |           $(RM) y.tab.c           |
1573        +---------------------------------------------------------+-----------------------------------+
1574        |                                                         |                                   |
1575        |                          .y~                            |   $(GET) $(GFLAGS) -p $< > $*.y   |
1576        |                                                         |      $(YACC) $(YFLAGS) $*.y       |
1577        |                                                         |    $(COMPILE.c) -o $@ y.tab.c     |
1578        |                                                         |           $(RM) y.tab.c           |
1579        +---------------------------------------------------------+-----------------------------------+
1580        |                                                         |                                   |
1581        |                         .y~.c                           |   $(GET) $(GFLAGS) -p $< > $*.y   |
1582        |                                                         |      $(YACC) $(YFLAGS) $*.y       |
1583        |                                                         |           mv y.tab.c $@           |
1584        +---------------------------------------------------------+-----------------------------------+
1585        |                                                         |                                   |
1586        |                         .y~.ln                          |   $(GET) $(GFLAGS) -p $< > $*.y   |
1587        |                                                         |          $(YACC.y) $*.y           |
1588        |                                                         |    $(LINT.c) -o $@ -i y.tab.c     |
1589        |                                                         |           $(RM) y.tab.c           |
1590        +---------------------------------------------------------+-----------------------------------+
1591        |                                                         |                                   |
1592        |                         .y~.o                           |   $(GET) $(GFLAGS) -p $< > $*.y   |
1593        |                                                         |      $(YACC) $(YFLAGS) $*.y       |
1594        |                                                         |    $(CC) $(CFLAGS) -c y.tab.c     |
1595        |                                                         |           rm -f y.tab.c           |
1596        |                                                         |           mv y.tab.o $@           |
1597        +---------------------------------------------------------+-----------------------------------+
1598 
1599 
1600        make reads in the standard set of implicit rules from the file
1601        /usr/share/lib/make/make.rules, unless -r is in effect, or there is a
1602        make.rules file in the local directory that does not include that file.
1603 
1604    The Suffixes List
1605        The suffixes list is given as the list of dependencies for the
1606        .SUFFIXES: special-function target. The default list is contained in the
1607        SUFFIXES macro (See Table of Predefined Macros for the standard list of
1608        suffixes). You can define additional .SUFFIXES: targets; a .SUFFIXES
1609        target with no dependencies clears the list of suffixes.  Order is
1610        significant within the list; make selects a rule that corresponds to
1611        the target's suffix and the first dependency-file suffix found in the
1612        list. To place suffixes at the head of the list, clear the list and
1613        replace it with the new suffixes, followed by the default list:
1614 
1615             .SUFFIXES:
1616             .SUFFIXES: suffixes $(SUFFIXES)
1617 
1618 
1619 
1620        A tilde (~) indicates that if a dependency file with the indicated
1621        suffix (minus the ~) is under SCCS its most recent version should be
1622        retrieved, if necessary, before the target is processed.
1623 
1624    Library Maintenance
1625        A target name  of the form:
1626 
1627             lib(member ...)
1628 
1629 
1630 
1631        refers to a member, or a space-separated list of members, in an ar(1)
1632        library.
1633 
1634 
1635        The dependency of the library member on the corresponding file must be
1636        given as an explicit entry in the makefile. This can be handled by a
1637        pattern matching rule of the form:
1638 
1639             lib(%.s): %.s
1640 
1641 
1642 
1643        where .s is the suffix of the member; this suffix is typically .o for
1644        object libraries.
1645 
1646 
1647        A target name of the form:
1648 
1649             lib((symbol))
1650 
1651 
1652 
1653        refers to the member of a randomized object library that defines the
1654        entry point named symbol.
1655 
1656    Command Execution
1657        Command lines are executed one at a time, each by its own process or
1658        shell. Shell commands, notably cd, are ineffectual across an unescaped
1659        NEWLINE in the makefile. A line is printed (after macro expansion) just
1660        before being executed. This is suppressed if it starts with a @, if
1661        there is a .SILENT: entry in the makefile, or if make is run with the -s
1662        option. Although the -n option specifies printing without execution,
1663        lines containing the macro $(MAKE) are executed regardless, and lines
1664        containing the @ special character are printed. The -t (touch) option
1665        updates the modification date of a file without executing any rules.
1666        This can be dangerous when sources are maintained by more than one
1667        person.
1668 
1669 
1670        make invokes the shell with the -e (exit-on-errors) argument. Thus, with
1671        semicolon-separated command sequences, execution of the later commands
1672        depends on the success of the former. This behavior can be overridden
1673        by starting the command line with a -, or by writing a shell script
1674        that returns a non-zero status only as it finds appropriate.
1675 
1676    Bourne Shell Constructs
1677        To use the Bourne shell if control structure for branching, use a
1678        command line of the form:
1679 
1680          if expression ; \
1681          then command ; \
1682               ... ; \
1683          else command; \
1684               ... ; \
1685          fi
1686 
1687 
1688 
1689        Although composed of several input lines, the escaped NEWLINE
1690        characters insure that make treats them all as one (shell) command
1691        line.
1692 
1693 
1694        To use the Bourne shell for control structure for loops, use a command
1695        line of the form:
1696 
1697          for var in list ; \
1698          do command; \
1699               ... ; \done
1700 
1701 
1702 
1703        To refer to a shell variable, use a double-dollar-sign ($$). This
1704        prevents expansion of the dollar-sign by make.
1705 
1706    Command Substitutions
1707        To incorporate the standard output of a shell command in a macro, use a
1708        definition of the form:
1709 
1710             MACRO:sh =command
1711 
1712 
1713 
1714        The command is executed only once, standard error output is discarded,
1715        and NEWLINE characters are replaced with SPACEs. If the command has a
1716        non-zero exit status, make halts with an error.
1717 
1718 
1719        To capture the output of a shell command in a macro reference, use a
1720        reference of the form:
1721 
1722          $(MACRO:sh)
1723 
1724 
1725 
1726        where MACRO is the name of a macro containing a valid Bourne shell
1727        command line. In this case, the command is executed whenever the
1728        reference is evaluated. As with shell command substitutions, the
1729        reference is replaced with the standard output of the command. If the
1730        command has a non-zero exit status, make halts with an error.
1731 
1732 
1733        In contrast to commands in rules, the command is not subject for macro
1734        substitution; therefore, a dollar sign ($) need not be replaced with a
1735        double dollar sign ($$).
1736 
1737    Signals
1738        INT, SIGTERM, and QUIT signals received from the keyboard halt make and
1739        remove the target file being processed unless that target is in the
1740        dependency list for .PRECIOUS:.
1741 
1742 EXAMPLES
1743        Example 1 Defining dependencies
1744 
1745 
1746        This makefile says that pgm depends on two files a.o and b.o, and that
1747        they in turn depend on their corresponding source files (a.c and b.c)
1748        along with a common file incl.h:
1749 
1750 
1751          pgm:  a.o  b.o
1752               $(LINK.c) -o $@a.o  b.o
1753          a.o:  incl.h  a.c
1754               cc -c a.c
1755          b.o:  incl.h  b.c
1756               cc -c b.c
1757 
1758 
1759        Example 2 Using implicit rules
1760 
1761 
1762        The following makefile uses implicit rules to express the same
1763        dependencies:
1764 
1765 
1766          pgm:  a.o  b.o
1767               cc  a.o  b.o -o pgm
1768          a.o  b.o:  incl.h
1769 
1770 
1771 ENVIRONMENT VARIABLES
1772        See environ(5) for descriptions of the following environment variables
1773        that affect the execution of make: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES,
1774        and NLSPATH.
1775 
1776        KEEP_STATE
1777                         This environment variable has the same effect as the
1778                         .KEEP_STATE: special-function target. It enables
1779                         command dependencies, hidden dependencies and writing
1780                         of the state file.
1781 
1782 
1783        USE_SVR4_MAKE
1784                         This environment variable causes make to invoke the
1785                         generic System V version of make (/usr/lib/svr4.make).
1786                         See sysV-make(1).
1787 
1788 
1789        MAKEFLAGS
1790                         This variable is interpreted as a character string
1791                         representing a series of option characters to be used
1792                         as the default options. The implementation accepts
1793                         both of the following formats (but need not accept
1794                         them when intermixed):
1795 
1796                             1.     The characters are option letters without
1797                                    the leading hyphens or blank character
1798                                    separation used on a command line.
1799 
1800                             2.     The characters are formatted in a manner
1801                                    similar to a portion of the make command
1802                                    line: options are preceded by hyphens and
1803                                    blank-character-separated. The macro=name
1804                                    macro definition operands can also be
1805                                    included. The difference between the
1806                                    contents of MAKEFLAGS and the command line
1807                                    is that the contents of the variable is not
1808                                    subjected to the word expansions associated
1809                                    with parsing the command line values. See
1810                                    wordexp(3C).
1811 
1812                                    When the command-line options -f or -p are
1813                                    used, they take effect regardless of
1814                                    whether they also appear in MAKEFLAGS. If
1815                                    they otherwise appear in MAKEFLAGS, the
1816                                    result is undefined.
1817                         The MAKEFLAGS variable is accessed from the
1818                         environment before the makefile is read. At that time,
1819                         all of the options (except -f and -p) and command-line
1820                         macros not already included in MAKEFLAGS are added to
1821                         the MAKEFLAGS macro. The MAKEFLAGS macro is passed
1822                         into the environment as an environment variable for
1823                         all child processes. If the MAKEFLAGS macro is
1824                         subsequently set by the makefile, it replaces the
1825                         MAKEFLAGS variable currently found in the environment.
1826 
1827 
1828        PROJECTDIR
1829                         Provides a directory to be used to search for SCCS
1830                         files not found in the current  directory. In all of
1831                         the following cases, the search for SCCS files is made
1832                         in  the directory SCCS in the identified directory. If
1833                         the value of PROJECTDIR begins with a slash, it shall
1834                         be considered an absolute pathname. Otherwise, the
1835                         value of PROJECTDIR is treated as a user name and that
1836                         user's initial working directory shall be examined for
1837                         a subdirectory src or source. If such a directory is
1838                         found, it shall be used.  Otherwise, the value is used
1839                         as a relative pathname.
1840 
1841                         If PROJECTDIR is not set or has a null value, the
1842                         search for SCCS files shall be made in the directory
1843                         SCCS in the current directory. The setting of
1844                         PROJECTDIR affects all files listed in the remainder
1845                         of this utility description for files  with a
1846                         component named SCCS.
1847 
1848 
1849 EXIT STATUS
1850        When the -q option is specified, the make utility exits with one of the
1851        following values:
1852 
1853        0
1854              Successful completion.
1855 
1856 
1857        1
1858              The target was not up-to-date.
1859 
1860 
1861        >1
1862              An error occurred.
1863 
1864 
1865 
1866        When the -q option is not specified, the make utility exits with one of
1867        the following values:
1868 
1869        0
1870              Successful completion
1871 
1872 
1873        >0
1874              An error occurred
1875 
1876 
1877 FILES
1878        makefile
1879        Makefile
1880            current version(s) of make description file
1881 
1882 
1883        s.makefile
1884        s.Makefile
1885            SCCS history files for the above makefile(s) in the current
1886            directory
1887 
1888 
1889        SCCS/s.makefile
1890        SCCS/s.Makefile
1891            SCCS history files for the above makefile(s)
1892 
1893 
1894        make.rules
1895            default file for user-defined targets, macros, and implicit rules
1896 
1897 
1898        /usr/share/lib/make/make.rules
1899            makefile for standard implicit rules and macros (not read if
1900            make.rules is)
1901 
1902 
1903        .make.state
1904            state file in the local directory
1905 
1906 
1907 ATTRIBUTES
1908        See attributes(5) for descriptions of the following attributes:
1909 
1910    /usr/xpg4/bin/make
1911 
1912        +--------------------+-------------------+
1913        |  ATTRIBUTE TYPE    |  ATTRIBUTE VALUE  |
1914        +--------------------+-------------------+
1915        |Interface Stability | Committed         |
1916        +--------------------+-------------------+
1917        |Standard            | See standards(5). |
1918        +--------------------+-------------------+
1919 
1920 SEE ALSO
1921        ar(1), arch(1), cd(1), cpp(1), lex(1), mach(1), sccs-get(1), sh(1),
1922        sysV-make(1), yacc(1), wordexp(3C), passwd(4), attributes(5),
1923        environ(5), POSIX.2(5), standards(5)
1924 
1925 
1926        Solaris Advanced User's Guide
1927 
1928 DIAGNOSTICS
1929        Don't know how to make target target
1930            There is no makefile entry for target, and none of make's implicit
1931            rules apply (there is no dependency file with a suffix in the
1932            suffixes list, or the target's suffix is not in the list).
1933 
1934 
1935        *** target removed.
1936            make was interrupted while building target. Rather than leaving a
1937            partially-completed version that is newer than its dependencies,
1938            make removes the file named target.
1939 
1940 
1941        *** target not removed.
1942            make was interrupted while building target and target was not
1943            present in the directory.
1944 
1945 
1946        *** target could not be removed, reason
1947            make was interrupted while building target, which was not removed
1948            for the indicated reason.
1949 
1950 
1951        Read of include file file failed
1952            The makefile indicated in an include directive was not found, or
1953            was inaccessible.
1954 
1955 
1956        Loop detected when expanding macro value macro'
1957            A reference to the macro being defined was found in the definition.
1958 
1959 
1960        Could not write state file file
1961            You used the .KEEP_STATE: target, but do not have write permission
1962            on the state file.
1963 
1964 
1965        ***Error code n
1966            The previous shell command returned a nonzero error code.
1967 
1968 
1969        *** signal message
1970            The previous shell command was aborted due to a signal. If - core
1971            dumped appears after the message, a core file was created.
1972 
1973 
1974        Conditional macro conflict encountered
1975            Displayed only when -d is in effect, this message indicates that two
1976            or more parallel targets currently being processed depend on a
1977            target which is built differently for each by virtue of conditional
1978            macros. Since the target cannot simultaneously satisfy both
1979            dependency relationships, it is conflicted.
1980 
1981 
1982 BUGS
1983        Some commands return nonzero status inappropriately; to overcome this
1984        difficulty, prefix the offending command line in the rule with a.
1985 
1986 
1987        Filenames with the characters =, :, or @, do not work.
1988 
1989 
1990        You cannot build file.o from lib(file.o).
1991 
1992 
1993        Options supplied by MAKEFLAGS should be reported for nested make
1994        commands. Use the -d option to find out what options the nested command
1995        picks up from MAKEFLAGS.
1996 
1997 
1998        This version of make is incompatible in certain respects with previous
1999        versions:
2000 
2001            o      The -d option output is much briefer in this version. -dd now
2002                   produces the equivalent voluminous output.
2003 
2004            o      make attempts to derive values for the dynamic macros $*,
2005                   $<, and $?, while processing explicit      targets. It uses the
2006                   same method as for implicit rules; in some cases this can
2007                   lead either to unexpected values, or to an empty value being
2008                   assigned. (Actually, this was true for earlier versions as
2009                   well, even though the documentation stated otherwise.)
2010 
2011            o      make no longer searches for SCCS history (s.) files.
2012 
2013            o      Suffix replacement in macro references are now applied after
2014                   the macro is expanded.
2015 
2016 
2017        There is no guarantee that makefiles created for this version of make
2018        work with earlier versions.
2019 
2020 
2021        If there is no make.rules file in the current directory, and the file
2022        /usr/share/lib/make/make.rules is missing, make stops before processing
2023        any targets. To force make to run anyway, create an empty make.rules
2024        file in the current directory.
2025 
2026 
2027        Once a dependency is made, make assumes the dependency file is present
2028        for the remainder of the run. If a rule subsequently removes that file
2029        and future targets depend on its existence, unexpected errors can
2030        result.
2031 
2032 
2033        When hidden dependency checking is in effect, the $? macro's value
2034        includes the names of hidden dependencies.  This can lead to improper
2035        filename arguments to commands when $? is used in a rule.
2036 
2037 
2038        Pattern replacement macro references cannot be used in the dependency
2039        list of a pattern matching rule.
2040 
2041 
2042        Unlike previous versions, this version of make strips a leading ./ from
2043        the value of the $@ dynamic macro.
2044 
2045 
2046        With automatic SCCS retrieval, this version of make does not support
2047        tilde suffix rules.
2048 
2049 
2050        The only dynamic macro whose value is strictly determined when used in
2051        a dependency list is $@ (takes the form $$@).
2052 
2053 
2054        make invokes the shell with the -e argument. This cannot be inferred
2055        from the syntax of the rule alone.
2056 
2057 
2058 
2059                                 April 23, 2008                        MAKE(1S)