Ignore:
Timestamp:
Jun 17, 2012, 10:45:31 PM (13 years ago)
Author:
bird
Message:

kmk: Merged in changes from GNU make 3.82. Previous GNU make base version was gnumake-2008-10-28-CVS.

Location:
trunk/src/kmk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk

    • Property svn:ignore
      •  

        old new  
        1313stamp-*
        1414makebook*
         15
        1516.*gdbinit
         17.gdb_history
         18
        1619*.dep
        1720*.dvi
         
        3134*.pg
        3235*.pgs
         36
        3337README
        3438README.DOS
        3539README.W32
         40README.OS2
        3641aclocal.m4
        3742autom4te.cache
         
        5257config.h.W32
        5358config.h-vms
         59
        5460loadavg
        5561loadavg.c
        5662make
         63
        5764.deps
        5865.dep_segment
         66ID
         67TAGS
         68
        5969_*
        6070sun4
         
        7282sol2
        7383i486-linux
         84
        7485customs
         86
        7587install-sh
        7688mkinstalldirs
         89
         90.directive.asc
  • trunk/src/kmk/doc

    • Property svn:ignore
      •  

        old new  
        11Makefile
        22Makefile.in
         3version.texi
        34fdl.texi
        45make-stds.texi
         
        2021make.ps
        2122make.pdf
         23stamp-vti
  • trunk/src/kmk/doc/make.texi

    r1993 r2591  
    44
    55@include version.texi
    6 @set EDITION 0.70
    7 @set RCSID $Id: make.texi,v 1.52 2008/05/18 15:11:40 psmith Exp $
     6@set EDITION 0.71
     7@set RCSID $Id: make.texi,v 1.66 2010/07/19 07:10:54 psmith Exp $
    88
    99@settitle GNU @code{make}
     
    1414@syncodeindex pg cp
    1515@c FSF publishers: format makebook.texi instead of using this file directly.
    16 @c ISBN provided by Lisa M. Opus Goldstein <opus@gnu.org>, 5 May 2004
    17 @set ISBN 1-882114-83-5
     16@c ISBN confirmed by Jasimin Huang <jasimin@fsf.org> on 25 Mar 2009
     17@set ISBN 1-882114-83-3
    1818@c %**end of header
    1919
     
    2727
    2828Copyright @copyright{} 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
    29 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007
    30 Free Software Foundation, Inc.
     291996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007,
     302008, 2009, 2010 Free Software Foundation, Inc.
    3131
    3232@quotation
     
    3939License.''
    4040
    41 (a) The FSF's Back-Cover Text is: ``You are free to copy and modify
    42 this GNU Manual. Buying copies from GNU Press supports the FSF in
     41(a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
     42modify this GNU manual.  Buying copies from the FSF supports it in
    4343developing GNU and promoting software freedom.''
    4444@end quotation
     
    202202* Interrupts::                  What happens when a recipe is interrupted.
    203203* Recursion::                   Invoking @code{make} from makefiles.
    204 * Sequences::                   Defining canned recipes.
     204* Canned Recipes::              Defining canned recipes.
    205205* Empty Recipes::               Defining useful, do-nothing recipes.
    206206
     
    234234* Override Directive::          How to set a variable in the makefile even if
    235235                                  the user has set it with a command argument.
    236 * Defining::                    An alternate way to set a variable
    237                                   to a verbatim string.
     236* Multi-Line::                  An alternate way to set a variable
     237                                  to a multi-line string.
    238238* Environment::                 Variable values can come from the environment.
    239239* Target-specific::             Variable values can be defined on a per-target
     
    241241* Pattern-specific::            Target-specific variable values can be applied
    242242                                  to a group of targets that match a pattern.
     243* Suppressing Inheritance::     Suppress inheritance of variables.
    243244* Special Variables::           Variables with special meaning or behavior.
    244245
     
    524525
    525526@cindex tabs in rules
    526 A @dfn{recipe} is an action that @code{make} carries out.
    527 A recipe may have more than one command, each on its own line.
    528 @strong{Please note:} you need to put a tab character at the beginning of
    529 every command line!  This is an obscurity that catches the unwary.  If
    530 you prefer to prefix your recipes with a character other than tab,
    531 you can set the @code{.CMDPREFIX} variable to an alternate character
    532 (@pxref{Special Variables}).
     527A @dfn{recipe} is an action that @code{make} carries out.  A recipe
     528may have more than one command, either on the same line or each on its
     529own line.  @strong{Please note:} you need to put a tab character at
     530the beginning of every recipe line!  This is an obscurity that catches
     531the unwary.  If you prefer to prefix your recipes with a character
     532other than tab, you can set the @code{.RECIPEPREFIX} variable to an
     533alternate character (@pxref{Special Variables}).
    533534
    534535Usually a recipe is in a rule with prerequisites and serves to create a
     
    629630prerequisites.  These recipes say how to update the target file.  A
    630631tab character (or whatever character is specified by the
    631 @code{.CMDPREFIX} variable; @pxref{Special Variables}) must come at
     632@code{.RECIPEPREFIX} variable; @pxref{Special Variables}) must come at
    632633the beginning of every line in the recipe to distinguish recipes from
    633634other lines in the makefile.  (Bear in mind that @code{make} does not
    634635know anything about how the recipes work.  It is up to you to supply
    635636recipes that will update the target file properly.  All @code{make}
    636 does is execute the commands in the recipe you have specified when the
    637 target file needs to be updated.)@refill
     637does is execute the recipe you have specified when the target file
     638needs to be updated.)@refill
    638639@cindex recipe
    639640
     
    996997@item
    997998Defining a variable from a verbatim string containing multiple lines
    998 (@pxref{Defining, ,Defining Variables Verbatim}).
     999(@pxref{Multi-Line, ,Defining Multi-Line Variables}).
    9991000@end itemize
    10001001
     
    10971098Extra spaces are allowed and ignored at the beginning of the line, but
    10981099the first character must not be a tab (or the value of
    1099 @code{.CMDPREFIX})---if the line begins with a tab, it will be
     1100@code{.RECIPEPREFIX})---if the line begins with a tab, it will be
    11001101considered a recipe line.  Whitespace is required between
    11011102@code{include} and the file names, and between file names; extra
     
    11711172
    11721173If you want @code{make} to simply ignore a makefile which does not exist
    1173 and cannot be remade, with no error message, use the @w{@code{-include}}
     1174or cannot be remade, with no error message, use the @w{@code{-include}}
    11741175directive instead of @code{include}, like this:
    11751176
     
    11791180
    11801181This acts like @code{include} in every way except that there is no
    1181 error (not even a warning) if any of the @var{filenames} do not exist.
     1182error (not even a warning) if any of the @var{filenames} (or any
     1183prerequisites of any of the @var{filenames}) do not exist or cannot be
     1184remade.
     1185
    11821186For compatibility with some other @code{make} implementations,
    11831187@code{sinclude} is another name for @w{@code{-include}}.
     
    11911195If the environment variable @code{MAKEFILES} is defined, @code{make}
    11921196considers its value as a list of names (separated by whitespace) of
    1193 additional makefiles to be read before the others.  This works much like
    1194 the @code{include} directive: various directories are searched for those
    1195 files (@pxref{Include, ,Including Other Makefiles}).  In addition, the
    1196 default goal is never taken from one of these makefiles and it is not an
    1197 error if the files listed in @code{MAKEFILES} are not found.@refill
     1197additional makefiles to be read before the others.  This works much
     1198like the @code{include} directive: various directories are searched
     1199for those files (@pxref{Include, ,Including Other Makefiles}).  In
     1200addition, the default goal is never taken from one of these makefiles
     1201(or any makefile included by them) and it is not an error if the files
     1202listed in @code{MAKEFILES} are not found.@refill
    11981203
    11991204@cindex recursion, and @code{MAKEFILES} variable
     
    12691274
    12701275When you use the @samp{-t} or @samp{--touch} option
    1271 (@pxref{Instead of Execution, ,Instead of Executing the Recipe}),
     1276(@pxref{Instead of Execution, ,Instead of Executing Recipes}),
    12721277you would not want to use an out-of-date makefile to decide which
    12731278targets to touch.  So the @samp{-t} option has no effect on updating
     
    13871392define @var{immediate}
    13881393  @var{deferred}
     1394endef
     1395
     1396define @var{immediate} =
     1397  @var{deferred}
     1398endef
     1399
     1400define @var{immediate} ?=
     1401  @var{deferred}
     1402endef
     1403
     1404define @var{immediate} :=
     1405  @var{immediate}
     1406endef
     1407
     1408define @var{immediate} +=
     1409  @var{deferred} or @var{immediate}
    13891410endef
    13901411@end example
     
    17481769@cindex tab character (in commands)
    17491770The @var{recipe} lines start with a tab character (or the first
    1750 character in the value of the @code{.CMDPREFIX} variable;
     1771character in the value of the @code{.RECIPEPREFIX} variable;
    17511772@pxref{Special Variables}).  The first recipe line may appear on the line
    17521773after the prerequisites, with a tab character, or may appear on the
     
    18021823GNU @code{make}: normal prerequisites such as described in the
    18031824previous section, and @dfn{order-only} prerequisites.  A normal
    1804 prerequisite makes two statements: first, it imposes an order of
    1805 execution of recipes: any recipes necessary to build any of a
    1806 target's prerequisites will be fully executed before any recipe
    1807 necessary to build the target.  Second, it imposes a dependency
    1808 relationship: if any prerequisite is newer than the target, then the
    1809 target is considered out-of-date and must be rebuilt.
     1825prerequisite makes two statements: first, it imposes an order in which
     1826recipes will be invoked: the recipes for all prerequisites of a target
     1827will be completed before the recipe for the target is run.  Second, it
     1828imposes a dependency relationship: if any prerequisite is newer than
     1829the target, then the target is considered out-of-date and must be
     1830rebuilt.
    18101831
    18111832Normally, this is exactly what you want: if a target's prerequisite is
     
    19491970@noindent
    19501971then the value of the variable @code{objects} is the actual string
    1951 @samp{*.o}.  However, if you use the value of @code{objects} in a target,
    1952 prerequisite, or recipe, wildcard expansion will take place at that time.
    1953 To set @code{objects} to the expansion, instead use:
     1972@samp{*.o}.  However, if you use the value of @code{objects} in a
     1973target or prerequisite, wildcard expansion will take place there.  If
     1974you use the value of @code{objects} in a recipe, the shell may perform
     1975wildcard expansion when the recipe runs.  To set @code{objects} to the
     1976expansion, instead use:
    19541977
    19551978@example
     
    24032426
    24042427When a prerequisite's name has the form @samp{-l@var{name}}, @code{make}
    2405 handles it specially by searching for the file @file{lib@var{name}.so} in
    2406 the current directory, in directories specified by matching @code{vpath}
     2428handles it specially by searching for the file @file{lib@var{name}.so},
     2429and, if it is not found, for the file @file{lib@var{name}.a} in the current
     2430directory, in directories specified by matching @code{vpath}
    24072431search paths and the @code{VPATH} search path, and then in the
    24082432directories @file{/lib}, @file{/usr/lib}, and @file{@var{prefix}/lib}
     
    24102434@code{make} behave as if @var{prefix} is defined to be the root of the
    24112435DJGPP installation tree).
    2412 
    2413 If that file is not found, then the file @file{lib@var{name}.a} is
    2414 searched for, in the same directories as above.
    24152436
    24162437For example, if there is a @file{/usr/lib/libcurses.a} library on your
     
    24352456@samp{-l@var{name}} is seen, @code{make} will replace the percent in
    24362457each pattern in the list with @var{name} and perform the above directory
    2437 searches using that library filename.  If no library is found, the next
    2438 word in the list will be used.
     2458searches using each library filename.
    24392459
    24402460The default value for @code{.LIBPATTERNS} is @samp{lib%.so lib%.a},
     
    28542874recipes in parallel (unless its makefile also contains this target).
    28552875Any prerequisites on this target are ignored.
     2876
     2877@findex .ONESHELL
     2878@item .ONESHELL
     2879@cindex recipe execution, single invocation
     2880
     2881If @code{.ONESHELL} is mentioned as a target, then when a target is
     2882built all lines of the recipe will be given to a single invocation of
     2883the shell rather than each line being invoked separately
     2884(@pxref{Execution, ,Recipe Execution}).
     2885
     2886@findex .POSIX
     2887@item .POSIX
     2888@cindex POSIX-conforming mode, setting
     2889
     2890If @code{.POSIX} is mentioned as a target, then the makefile will be
     2891parsed and run in POSIX-conforming mode.  This does @emph{not} mean
     2892that only POSIX-conforming makefiles will be accepted: all advanced
     2893GNU @code{make} features are still available.  Rather, this target
     2894causes @code{make} to behave as required by POSIX in those areas
     2895where @code{make}'s default behavior differs.
     2896
     2897In particular, if this target is mentioned then recipes will be
     2898invoked as if the shell had been passed the @code{-e} flag: the first
     2899failing command in a recipe will cause the recipe to fail immediately.
    28562900@end table
    28572901
     
    31683212@cindex @code{::} rules (double-colon)
    31693213
    3170 @dfn{Double-colon} rules are rules written with @samp{::} instead of
    3171 @samp{:} after the target names.  They are handled differently from
    3172 ordinary rules when the same target appears in more than one rule.
     3214@dfn{Double-colon} rules are explicit rules written with @samp{::}
     3215instead of @samp{:} after the target names.  They are handled
     3216differently from ordinary rules when the same target appears in more
     3217than one rule.  Pattern rules with double-colons have an entirely
     3218different meaning (@pxref{Match-Anything Rules}).
    31733219
    31743220When a target appears in multiple rules, all the rules must be the same
     
    33513397Users use many different shell programs, but recipes in makefiles are
    33523398always interpreted by @file{/bin/sh} unless the makefile specifies
    3353 otherwise.  @xref{Execution, ,Command Execution}.
     3399otherwise.  @xref{Execution, ,Recipe Execution}.
    33543400
    33553401@menu
     
    33613407* Interrupts::                  What happens when a recipe is interrupted.
    33623408* Recursion::                   Invoking @code{make} from makefiles.
    3363 * Sequences::                   Defining canned recipes.
     3409* Canned Recipes::              Defining canned recipes.
    33643410* Empty Recipes::               Defining useful, do-nothing recipes.
    33653411@end menu
     
    33793425
    33803426Each line in the recipe must start with a tab (or the first character
    3381 in the value of the @code{.CMDPREFIX} variable; @pxref{Special
     3427in the value of the @code{.RECIPEPREFIX} variable; @pxref{Special
    33823428Variables}), except that the first recipe line may be attached to the
    33833429target-and-prerequisites line with a semicolon in between.  @emph{Any}
     
    36293675@cindex @code{--dry-run}
    36303676@cindex @code{--recon}
    3631 When @code{make} is given the flag @samp{-n} or @samp{--just-print}
    3632 it only echoes recipes, it won't execute them.  @xref{Options Summary,
    3633 ,Summary of Options}.  In this case and only this case, even the
    3634 recipe lines starting with @samp{@@} are printed.  This flag is useful for
    3635 finding out which recipes @code{make} thinks are necessary without
    3636 actually doing them.
     3677When @code{make} is given the flag @samp{-n} or @samp{--just-print} it
     3678only echoes most recipes, without executing them.  @xref{Options
     3679Summary, ,Summary of Options}.  In this case even the recipe lines
     3680starting with @samp{@@} are printed.  This flag is useful for finding
     3681out which recipes @code{make} thinks are necessary without actually
     3682doing them.
    36373683
    36383684@cindex @code{-s}
     
    36543700
    36553701When it is time to execute recipes to update a target, they are
    3656 executed by invoking a new subshell for each line of the recipe.  (In
    3657 practice, @code{make} may take shortcuts that do not affect the
    3658 results.)
     3702executed by invoking a new subshell for each line of the recipe,
     3703unless the @code{.ONESHELL} special target is in effect
     3704(@pxref{One Shell, ,Using One Shell})  (In practice, @code{make} may
     3705take shortcuts that do not affect the results.)
    36593706
    36603707@cindex @code{cd} (shell command)
     
    36843731
    36853732@menu
     3733* One Shell::                   One shell for all lines in a recipe
    36863734* Choosing the Shell::          How @code{make} chooses the shell used
    36873735                                  to run recipes.
    36883736@end menu
    36893737
    3690 @node Choosing the Shell,  , Execution, Execution
     3738@node One Shell, Choosing the Shell, Execution, Execution
     3739@subsection Using One Shell
     3740@cindex recipe lines, single shell
     3741@cindex @code{.ONESHELL}, use of
     3742@findex .ONESHELL
     3743
     3744Sometimes you would prefer that all the lines in the recipe be passed
     3745to a single invocation of the shell.  There are generally two
     3746situations where this is useful: first, it can improve performance in
     3747makefiles where recipes consist of many command lines, by avoiding
     3748extra processes.  Second, you might want newlines to be included in
     3749your recipe command (for example perhaps you are using a very
     3750different interpreter as your @code{SHELL}).  If the @code{.ONESHELL}
     3751special target appears anywhere in the makefile then @emph{all}
     3752recipe lines for each target will be provided to a single invocation
     3753of the shell.  Newlines between recipe lines will be preserved.  For
     3754example:
     3755
     3756@example
     3757.ONESHELL:
     3758foo : bar/lose
     3759        cd $(@@D)
     3760        gobble $(@@F) > ../$@@
     3761@end example
     3762
     3763@noindent
     3764would now work as expected even though the commands are on different
     3765recipe lines.
     3766
     3767If @code{.ONESHELL} is provided, then only the first line of the
     3768recipe will be checked for the special prefix characters (@samp{@@},
     3769@samp{-}, and @samp{+}).  Subsequent lines will include the special
     3770characters in the recipe line when the @code{SHELL} is invoked.  If
     3771you want your recipe to start with one of these special characters
     3772you'll need to arrange for them to not be the first characters on the
     3773first line, perhaps by adding a comment or similar.  For example, this
     3774would be a syntax error in Perl because the first @samp{@@} is removed
     3775by make:
     3776
     3777@example
     3778.ONESHELL:
     3779SHELL = /usr/bin/perl
     3780.SHELLFLAGS = -e
     3781show :
     3782        @@f = qw(a b c);
     3783        print "@@f\n";
     3784@end example
     3785
     3786@noindent
     3787However, either of these alternatives would work properly:
     3788
     3789@example
     3790.ONESHELL:
     3791SHELL = /usr/bin/perl
     3792.SHELLFLAGS = -e
     3793show :
     3794        # Make sure "@@" is not the first character on the first line
     3795        @@f = qw(a b c);
     3796        print "@@f\n";
     3797@end example
     3798
     3799@noindent
     3800or
     3801
     3802@example
     3803.ONESHELL:
     3804SHELL = /usr/bin/perl
     3805.SHELLFLAGS = -e
     3806show :
     3807        my @@f = qw(a b c);
     3808        print "@@f\n";
     3809@end example
     3810
     3811As a special feature, if @code{SHELL} is determined to be a
     3812POSIX-style shell, the special prefix characters in ``internal''
     3813recipe lines will @emph{removed} before the recipe is processed.  This
     3814feature is intended to allow existing makefiles to add the
     3815@code{.ONESHELL} special target and still run properly without
     3816extensive modifications.  Since the special prefix characters are not
     3817legal at the beginning of a line in a POSIX shell script this is not a
     3818loss in functionality.  For example, this works as expected:
     3819
     3820@example
     3821.ONESHELL:
     3822foo : bar/lose
     3823        @@cd $(@@D)
     3824        @@gobble $(@@F) > ../$@@
     3825@end example
     3826
     3827Even with this special feature, however, makefiles with
     3828@code{.ONESHELL} will behave differently in ways that could be
     3829noticeable.  For example, normally if any line in the recipe fails,
     3830that causes the rule to fail and no more recipe lines are processed.
     3831Under @code{.ONESHELL} a failure of any but the final recipe line will
     3832not be noticed by @code{make}.  You can modify @code{.SHELLFLAGS} to
     3833add the @code{-e} option to the shell which will cause any failure
     3834anywhere in the command line to cause the shell to fail, but this
     3835could itself cause your recipe to behave differently.  Ultimately you
     3836may need to harden your recipe lines to allow them to work with
     3837@code{.ONESHELL}.
     3838
     3839@node Choosing the Shell,  , One Shell, Execution
    36913840@subsection Choosing the Shell
    36923841@cindex shell, choosing the
    36933842@cindex @code{SHELL}, value of
     3843@cindex @code{.SHELLFLAGS}, value of
    36943844
    36953845@vindex SHELL
     3846@vindex .SHELLFLAGS
    36963847The program used as the shell is taken from the variable @code{SHELL}.
    36973848If this variable is not set in your makefile, the program
    3698 @file{/bin/sh} is used as the shell.
     3849@file{/bin/sh} is used as the shell.  The argument(s) passed to the
     3850shell are taken from the variable @code{.SHELLFLAGS}.  The default
     3851value of @code{.SHELLFLAGS} is @code{-c} normally, or @code{-ec} in
     3852POSIX-conforming mode.
    36993853
    37003854@cindex environment, @code{SHELL} in
     
    37863940on MS-DOS unaltered if you have e.g.@: @file{sh.exe} installed in some
    37873941directory along your @code{PATH}.
     3942
     3943@vindex SHELL
     3944@vindex .SHELLFLAGS
    37883945
    37893946@node Parallel, Errors, Execution, Recipes
     
    40144171times to prevent other sorts of trouble.
    40154172
    4016 @node Recursion, Sequences, Interrupts, Recipes
     4173@node Recursion, Canned Recipes, Interrupts, Recipes
    40174174@section Recursive Use of @code{make}
    40184175@cindex recursion
     
    43604517ensure that there are only @samp{N} jobs running at the same time
    43614518between them all.  Note that any job that is marked recursive
    4362 (@pxref{Instead of Execution, ,Instead of Executing the Recipes})
     4519(@pxref{Instead of Execution, ,Instead of Executing Recipes})
    43634520doesn't count against the total jobs (otherwise we could get @samp{N}
    43644521sub-@code{make}s running and have no slots left over for any real work!)
     
    44964653disable it.
    44974654
    4498 @node Sequences, Empty Recipes, Recursion, Recipes
     4655@node Canned Recipes, Empty Recipes, Recursion, Recipes
    44994656@section Defining Canned Recipes
    45004657@cindex canned recipes
     
    45094666not conflict with other variable names.
    45104667
    4511 Here is an example of defining a canned recipes:
    4512 
    4513 @example
    4514 define run-yacc
     4668Here is an example of defining a canned recipe:
     4669
     4670@example
     4671define run-yacc =
    45154672yacc $(firstword $^)
    45164673mv y.tab.c $@@
     
    45264683parentheses, variable names, and so on, all become part of the value of the
    45274684variable you are defining.
    4528 @xref{Defining, ,Defining Variables Verbatim},
     4685@xref{Multi-Line, ,Defining Multi-Line Variables},
    45294686for a complete explanation of @code{define}.
    45304687
     
    45674724
    45684725@example
    4569 define frobnicate
     4726define frobnicate =
    45704727@@echo "frobnicating target $@@"
    45714728frob-step-1 $< -o $@@-step-1
     
    45904747(@xref{Echoing, ,Recipe Echoing}, for a full explanation of @samp{@@}.)
    45914748
    4592 @node Empty Recipes,  , Sequences, Recipes
     4749@node Empty Recipes,  , Canned Recipes, Recipes
    45934750@section Using Empty Recipes
    45944751@cindex empty recipes
     
    46854842* Override Directive::          How to set a variable in the makefile even if
    46864843                                  the user has set it with a command argument.
    4687 * Defining::                    An alternate way to set a variable
    4688                                   to a verbatim string.
     4844* Multi-Line::                  An alternate way to set a variable
     4845                                  to a multi-line string.
     4846* Undefine Directive::          How to undefine a variable so that it appears
     4847                                  as if it was never set.
    46894848* Environment::                 Variable values can come from the environment.
    46904849* Target-specific::             Variable values can be defined on a per-target
     
    46924851* Pattern-specific::            Target-specific variable values can be applied
    46934852                                  to a group of targets that match a pattern.
     4853* Suppressing Inheritance::     Suppress inheritance of variables.
    46944854* Special Variables::           Variables with special meaning or behavior.
    46954855@end menu
     
    47614921Variables of this sort are defined by lines using @samp{=}
    47624922(@pxref{Setting, ,Setting Variables}) or by the @code{define} directive
    4763 (@pxref{Defining, ,Defining Variables Verbatim}).  The value you specify
     4923(@pxref{Multi-Line, ,Defining Multi-Line Variables}).  The value you specify
    47644924is installed verbatim; if it contains references to other variables,
    47654925these references are expanded whenever this variable is substituted (in
     
    51885348dir = foo
    51895349$(dir)_sources := $(wildcard $(dir)/*.c)
    5190 define $(dir)_print
     5350define $(dir)_print =
    51915351lpr $($(dir)_sources)
    51925352endef
     
    52175377You can specify a value in the makefile, either
    52185378with an assignment (@pxref{Setting, ,Setting Variables}) or with a
    5219 verbatim definition (@pxref{Defining, ,Defining Variables Verbatim}).@refill
     5379verbatim definition (@pxref{Multi-Line, ,Defining Multi-Line Variables}).@refill
    52205380
    52215381@item
     
    54255585value.
    54265586
    5427 @node Override Directive, Defining, Appending, Using Variables
     5587@node Override Directive, Multi-Line, Appending, Using Variables
    54285588@section The @code{override} Directive
    54295589@findex override
     
    54585618@xref{Appending, ,Appending More Text to Variables}.
    54595619
     5620Variable assignments marked with the @code{override} flag have a
     5621higher priority than all other assignments, except another
     5622@code{override}.  Subsequent assignments or appends to this variable
     5623which are not marked @code{override} will be ignored.
     5624
    54605625The @code{override} directive was not invented for escalation in the war
    54615626between makefiles and command arguments.  It was invented so you can alter
     
    54755640
    54765641@example
    5477 override define foo
     5642override define foo =
    54785643bar
    54795644endef
     
    54855650@end iftex
    54865651@ifnottex
    5487 @xref{Defining, ,Defining Variables Verbatim}.
     5652@xref{Multi-Line, ,Defining Multi-Line Variables}.
    54885653@end ifnottex
    54895654
    5490 @node Defining, Environment, Override Directive, Using Variables
    5491 @section Defining Variables Verbatim
     5655@node Multi-Line, Undefine Directive, Override Directive, Using Variables
     5656@section Defining Multi-Line Variables
    54925657@findex define
    54935658@findex endef
     5659@cindex multi-line variable definition
     5660@cindex variables, multi-line
    54945661@cindex verbatim variable definition
    54955662@cindex defining variables verbatim
     
    54985665Another way to set the value of a variable is to use the @code{define}
    54995666directive.  This directive has an unusual syntax which allows newline
    5500 characters to be included in the value, which is convenient for defining
    5501 both canned sequences of commands
    5502 (@pxref{Sequences, ,Defining Canned Command Sequences}), and also
    5503 sections of makefile syntax to use with @code{eval} (@pxref{Eval Function}).
    5504 
    5505 The @code{define} directive is followed on the same line by the name of the
    5506 variable and nothing more.  The value to give the variable appears on the
    5507 following lines.  The end of the value is marked by a line containing just
    5508 the word @code{endef}.  Aside from this difference in syntax, @code{define}
    5509 works just like @samp{=}: it creates a recursively-expanded variable
    5510 (@pxref{Flavors, ,The Two Flavors of Variables}).
    5511 The variable name may contain function and variable references, which
    5512 are expanded when the directive is read to find the actual variable name
     5667characters to be included in the value, which is convenient for
     5668defining both canned sequences of commands (@pxref{Canned Recipes,
     5669,Defining Canned Recipes}), and also sections of makefile syntax to
     5670use with @code{eval} (@pxref{Eval Function}).@refill
     5671
     5672The @code{define} directive is followed on the same line by the name
     5673of the variable being defined and an (optional) assignment operator,
     5674and nothing more.  The value to give the variable appears on the
     5675following lines.  The end of the value is marked by a line containing
     5676just the word @code{endef}.  Aside from this difference in syntax,
     5677@code{define} works just like any other variable definition.  The
     5678variable name may contain function and variable references, which are
     5679expanded when the directive is read to find the actual variable name
    55135680to use.
     5681
     5682You may omit the variable assignment operator if you prefer.  If
     5683omitted, @code{make} assumes it to be @samp{=} and creates a
     5684recursively-expanded variable (@pxref{Flavors, ,The Two Flavors of Variables}).
     5685When using a @samp{+=} operator, the value is appended to the previous
     5686value as with any other append operation: with a single space
     5687separating the old and new values.
    55145688
    55155689You may nest @code{define} directives: @code{make} will keep track of
     
    55185692prefix character are considered part of a recipe, so any @code{define}
    55195693or @code{endef} strings appearing on such a line will not be
    5520 considered @code{make} operators.
    5521 
    5522 @example
    5523 define two-lines
     5694considered @code{make} directives.
     5695
     5696@example
     5697define two-lines =
    55245698echo foo
    55255699echo $(bar)
     
    55515725
    55525726@example
    5553 override define two-lines
     5727override define two-lines =
    55545728foo
    55555729$(bar)
     
    55605734@xref{Override Directive, ,The @code{override} Directive}.
    55615735
    5562 @node Environment, Target-specific, Defining, Using Variables
     5736@node Undefine Directive, Environment, Multi-Line, Using Variables
     5737@section Undefining Variables
     5738@findex undefine
     5739@cindex undefining variable
     5740
     5741If you want to clear a variable, setting its value to empty is usually
     5742sufficient. Expanding such a variable will yield the same result (empty
     5743string) regardless of whether it was set or not. However, if you are
     5744using the @code{flavor} (@pxref{Flavor Function}) and
     5745@code{origin} (@pxref{Origin Function}) functions, there is a difference
     5746between a variable that was never set and a variable with an empty value.
     5747In such situations you may want to use the @code{undefine} directive to
     5748make a variable appear as if it was never set. For example:
     5749
     5750@example
     5751foo := foo
     5752bar = bar
     5753
     5754undefine foo
     5755undefine bar
     5756
     5757$(info $(origin foo))
     5758$(info $(flavor bar))
     5759@end example
     5760
     5761This example will print ``undefined'' for both variables.
     5762
     5763If you want to undefine a command-line variable definition, you can use
     5764the @code{override} directive together with @code{undefine}, similar to
     5765how this is done for variable definitions:
     5766
     5767@example
     5768override undefine CFLAGS
     5769@end example
     5770
     5771@node Environment, Target-specific, Undefine Directive, Using Variables
    55635772@section Variables from the Environment
    55645773
     
    56265835@end example
    56275836
    5628 @noindent
    5629 or like this:
    5630 
    5631 @example
    5632 @var{target} @dots{} : override @var{variable-assignment}
    5633 @end example
    5634 
    5635 @noindent
    5636 or like this:
    5637 
    5638 @example
    5639 @var{target} @dots{} : export @var{variable-assignment}
    5640 @end example
     5837Target-specific variable assignments can be prefixed with any or all of the
     5838special keywords @code{export}, @code{override}, or @code{private};
     5839these apply their normal behavior to this instance of the variable only.
    56415840
    56425841Multiple @var{target} values create a target-specific variable value for
     
    56845883ignore the target-specific values from any other targets.
    56855884
    5686 @node Pattern-specific, Special Variables, Target-specific, Using Variables
     5885@node Pattern-specific, Suppressing Inheritance, Target-specific, Using Variables
    56875886@section Pattern-specific Variable Values
    56885887@cindex pattern-specific variables
     
    56935892@code{make} supports pattern-specific variable values.  In this form,
    56945893the variable is defined for any target that matches the pattern
    5695 specified.  If a target matches more than one pattern, all the
    5696 matching pattern-specific variables are interpreted in the order in
    5697 which they were defined in the makefile, and collected together into
    5698 one set.  Variables defined in this way are searched after any
    5699 target-specific variables defined explicitly for that target, and
    5700 before target-specific variables defined for the parent target.
     5894specified.
    57015895
    57025896Set a pattern-specific variable value like this:
     
    57055899@var{pattern} @dots{} : @var{variable-assignment}
    57065900@end example
    5707 
    5708 @noindent
    5709 or like this:
    5710 
    5711 @example
    5712 @var{pattern} @dots{} : override @var{variable-assignment}
    5713 @end example
    5714 
    5715 @noindent
    57165901where @var{pattern} is a %-pattern.  As with target-specific variable
    57175902values, multiple @var{pattern} values create a pattern-specific variable
     
    57305915matching the pattern @code{%.o}.
    57315916
    5732 @node Special Variables,  , Pattern-specific, Using Variables
     5917If a target matches more than one pattern, the matching pattern-specific
     5918variables with longer stems are interpreted first. This results in more
     5919specific variables taking precedence over the more generic ones, for
     5920example:
     5921
     5922@example
     5923%.o: %.c
     5924        $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@@
     5925
     5926lib/%.o: CFLAGS := -fPIC -g
     5927%.o: CFLAGS := -g
     5928
     5929all: foo.o lib/bar.o
     5930@end example
     5931
     5932In this example the first definition of the @code{CFLAGS} variable
     5933will be used to update @file{lib/bar.o} even though the second one
     5934also applies to this target. Pattern-specific variables which result
     5935in the same stem length are considered in the order in which they
     5936were defined in the makefile.
     5937
     5938Pattern-specific variables are searched after any target-specific
     5939variables defined explicitly for that target, and before target-specific
     5940variables defined for the parent target.
     5941
     5942@node Suppressing Inheritance, Special Variables, Pattern-specific, Using Variables
     5943@section Suppressing Inheritance
     5944@findex private
     5945@cindex suppressing inheritance
     5946@cindex inheritance, suppressing
     5947
     5948As described in previous sections, @code{make} variables are inherited
     5949by prerequisites.  This capability allows you to modify the behavior
     5950of a prerequisite based on which targets caused it to be rebuilt.  For
     5951example, you might set a target-specific variable on a @code{debug}
     5952target, then running @samp{make debug} will cause that variable to be
     5953inherited by all prerequisites of @code{debug}, while just running
     5954@samp{make all} (for example) would not have that assignment.
     5955
     5956Sometimes, however, you may not want a variable to be inherited.  For
     5957these situations, @code{make} provides the @code{private} modifier.
     5958Although this modifier can be used with any variable assignment, it
     5959makes the most sense with target- and pattern-specific variables.  Any
     5960variable marked @code{private} will be visible to its local target but
     5961will not be inherited by prerequisites of that target.  A global
     5962variable marked @code{private} will be visible in the global scope but
     5963will not be inherited by any target, and hence will not be visible
     5964in any recipe.
     5965
     5966As an example, consider this makefile:
     5967@example
     5968EXTRA_CFLAGS =
     5969
     5970prog: private EXTRA_CFLAGS = -L/usr/local/lib
     5971prog: a.o b.o
     5972@end example
     5973
     5974Due to the @code{private} modifier, @code{a.o} and @code{b.o} will not
     5975inherit the @code{EXTRA_CFLAGS} variable assignment from the
     5976@code{progs} target.
     5977
     5978@node Special Variables,  , Suppressing Inheritance, Using Variables
    57335979@comment  node-name,  next,  previous,  up
    57345980@section Other Special Variables
     
    58346080variable).  You should not set, modify, or export this variable.
    58356081
    5836 @vindex .CMDPREFIX @r{(change the recipe prefix character)}
    5837 @item .CMDPREFIX
     6082@vindex .RECIPEPREFIX @r{(change the recipe prefix character)}
     6083@item .RECIPEPREFIX
    58386084The first character of the value of this variable is used as the
    58396085character make assumes is introducing a recipe line.  If the variable
     
    58436089@example
    58446090@group
    5845 .CMDPREFIX = >
     6091.RECIPEPREFIX = >
    58466092all:
    58476093> @@echo Hello, world
     
    58496095@end example
    58506096
    5851 The value of @code{.CMDPREFIX} can be changed multiple times; once set
     6097The value of @code{.RECIPEPREFIX} can be changed multiple times; once set
    58526098it stays in effect for all rules parsed until it is modified.
    58536099
     
    71757421all: $(PROGRAMS)
    71767422
    7177 define PROGRAM_template
     7423define PROGRAM_template =
    71787424 $(1): $$($(1)_OBJS) $$($(1)_LIBS:%=-l%)
    71797425 ALL_OBJS   += $$($(1)_OBJS)
     
    72287474@item environment
    72297475
    7230 if @var{variable} was defined as an environment variable and the
    7231 @samp{-e} option is @emph{not} turned on (@pxref{Options Summary, ,Summary of Options}).
     7476if @var{variable} was inherited from the environment provided to
     7477@code{make}.
    72327478
    72337479@item environment override
    72347480
    7235 if @var{variable} was defined as an environment variable and the
    7236 @w{@samp{-e}} option @emph{is} turned on (@pxref{Options Summary,
    7237 ,Summary of Options}).@refill
     7481if @var{variable} was inherited from the environment provided to
     7482@code{make}, and is overriding a setting for @var{variable} in the
     7483makefile as a result of the @w{@samp{-e}} option (@pxref{Options
     7484Summary, ,Summary of Options}).@refill
    72387485
    72397486@item file
     
    74767723The exit status is one if you use the @samp{-q} flag and @code{make}
    74777724determines that some target is not already up to date.
    7478 @xref{Instead of Execution, ,Instead of Executing the Recipes}.
     7725@xref{Instead of Execution, ,Instead of Executing Recipes}.
    74797726@end table
    74807727
     
    76537900
    76547901@node Instead of Execution, Avoiding Compilation, Goals, Running
    7655 @section Instead of Executing the Recipes
     7902@section Instead of Executing Recipes
    76567903@cindex execution, instead of
    76577904@cindex recipes, instead of executing
     
    76737920
    76747921``No-op''.  The activity is to print what recipe would be used to make
    7675 the targets up to date, but not actually execute it.
     7922the targets up to date, but not actually execute it.  Some recipes are
     7923still executed, even with this flag (@pxref{MAKE Variable, ,How the @code{MAKE} Variable Works}).
    76767924
    76777925@item -t
     
    77157963
    77167964With the @samp{-n} flag, @code{make} prints the recipe that it would
    7717 normally execute but does not execute it.
     7965normally execute but usually does not execute it.
    77187966
    77197967With the @samp{-t} flag, @code{make} ignores the recipes in the rules
     
    77417989not run unless they too begin with @samp{+} or contain @samp{$(MAKE)} or
    77427990@samp{$@{MAKE@}} (@xref{MAKE Variable, ,How the @code{MAKE} Variable Works}.)
     7991
     7992@cindex phony targets and recipe execution
     7993The @samp{-t} flag prevents phony targets (@pxref{Phony Targets}) from
     7994being updated, unless there are recipe lines beginning with @samp{+}
     7995or containing @samp{$(MAKE)} or @samp{$@{MAKE@}}.
    77437996
    77447997The @samp{-W} flag provides two features:
     
    80078260@xref{Environment, ,Variables from the Environment}.
    80088261
     8262@item --eval=@var{string}
     8263@cindex @code{--eval}
     8264@c Extra blank line here makes the table look better.
     8265
     8266Evaluate @var{string} as makefile syntax.  This is a command-line
     8267version of the @code{eval} function (@pxref{Eval Function}).  The
     8268evaluation is performed after the default rules and variables have
     8269been defined, but before any makefiles are read.
     8270
    80098271@item -f @var{file}
    80108272@cindex @code{-f}
     
    80908352@c Extra blank line here makes the table look better.
    80918353
    8092 Print the recipe that would be executed, but do not execute it.
    8093 @xref{Instead of Execution, ,Instead of Executing the Recipes}.
     8354Print the recipe that would be executed, but do not execute it (except
     8355in certain circumstances).
     8356@xref{Instead of Execution, ,Instead of Executing Recipes}.
    80948357
    80958358@item -o @var{file}
     
    81288391return an exit status that is zero if the specified targets are already
    81298392up to date, one if any remaking is required, or two if an error is
    8130 encountered.  @xref{Instead of Execution, ,Instead of Executing the
     8393encountered.  @xref{Instead of Execution, ,Instead of Executing
    81318394Recipes}.@refill
    81328395
     
    81908453instead of running their recipes.  This is used to pretend that the
    81918454recipes were done, in order to fool future invocations of
    8192 @code{make}.  @xref{Instead of Execution, ,Instead of Executing the Recipes}.
     8455@code{make}.  @xref{Instead of Execution, ,Instead of Executing Recipes}.
    81938456
    81948457@item -v
     
    82318494@code{make}, except that the modification time is changed only in the
    82328495imagination of @code{make}.
    8233 @xref{Instead of Execution, ,Instead of Executing the Recipes}.
     8496@xref{Instead of Execution, ,Instead of Executing Recipes}.
    82348497
    82358498@item --warn-undefined-variables
     
    84218684@pindex .c
    84228685@file{@var{n}.o} is made automatically from @file{@var{n}.c} with
    8423 a recipe of the form @samp{$(CC) -c $(CPPFLAGS) $(CFLAGS)}.@refill
     8686a recipe of the form @samp{$(CC) $(CPPFLAGS) $(CFLAGS) -c}.@refill
    84248687
    84258688@item Compiling C++ programs
     
    84318694@file{@var{n}.o} is made automatically from @file{@var{n}.cc},
    84328695@file{@var{n}.cpp}, or @file{@var{n}.C} with a recipe of the form
    8433 @samp{$(CXX) -c $(CPPFLAGS) $(CXXFLAGS)}.  We encourage you to use the
     8696@samp{$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c}.  We encourage you to use the
    84348697suffix @samp{.cc} for C++ source files instead of @samp{.C}.@refill
    84358698
     
    84398702@pindex .p
    84408703@file{@var{n}.o} is made automatically from @file{@var{n}.p}
    8441 with the recipe @samp{$(PC) -c $(PFLAGS)}.@refill
     8704with the recipe @samp{$(PC) $(PFLAGS) -c}.@refill
    84428705
    84438706@item Compiling Fortran and Ratfor programs
     
    84548717@table @samp
    84558718@item .f
    8456 @samp{$(FC) -c $(FFLAGS)}.
     8719@samp{$(FC) $(FFLAGS) -c}.
    84578720@item .F
    8458 @samp{$(FC) -c $(FFLAGS) $(CPPFLAGS)}.
     8721@samp{$(FC) $(FFLAGS) $(CPPFLAGS) -c}.
    84598722@item .r
    8460 @samp{$(FC) -c $(FFLAGS) $(RFLAGS)}.
     8723@samp{$(FC) $(FFLAGS) $(RFLAGS) -c}.
    84618724@end table
    84628725
     
    84698732@table @samp
    84708733@item .F
    8471 @samp{$(FC) -F $(CPPFLAGS) $(FFLAGS)}.
     8734@samp{$(FC) $(CPPFLAGS) $(FFLAGS) -F}.
    84728735@item .r
    8473 @samp{$(FC) -F $(FFLAGS) $(RFLAGS)}.
     8736@samp{$(FC) $(FFLAGS) $(RFLAGS) -F}.
    84748737@end table
    84758738
     
    90669329pattern.  @xref{Last Resort}.
    90679330
     9331More than one pattern rule may match a target.  In this case
     9332@code{make} will choose the ``best fit'' rule.  @xref{Pattern Match,
     9333,How Patterns Match}.
     9334
    90689335@c !!! The end of of this paragraph should be rewritten.  --bob
    90699336Pattern rules may have more than one target.  Unlike normal rules,
     
    90819348@cindex target, multiple in pattern rule
    90829349
    9083 The order in which pattern rules appear in the makefile is important
    9084 since this is the order in which they are considered.
    9085 Of equally applicable
    9086 rules, only the first one found is used.  The rules you write take precedence
    9087 over those that are built in.  Note however, that a rule whose
    9088 prerequisites actually exist or are mentioned always takes priority over a
    9089 rule with prerequisites that must be made by chaining other implicit rules.
    9090 @cindex pattern rules, order of
    9091 @cindex order of pattern rules
    9092 
    90939350@node Pattern Examples, Automatic Variables, Pattern Intro, Pattern Rules
    90949351@subsection Pattern Rule Examples
     
    94039660@file{src/car}.@refill
    94049661
     9662@cindex pattern rules, order of
     9663@cindex order of pattern rules
     9664A pattern rule can be used to build a given file only if there is a
     9665target pattern that matches the file name, @emph{and} all
     9666prerequisites in that rule either exist or can be built.  The rules
     9667you write take precedence over those that are built in. Note however,
     9668that a rule whose prerequisites actually exist or are mentioned always
     9669takes priority over a rule with prerequisites that must be made by
     9670chaining other implicit rules.
     9671
     9672@cindex stem, shortest
     9673It is possible that more than one pattern rule will meet these
     9674criteria.  In that case, @code{make} will choose the rule with the
     9675shortest stem (that is, the pattern that matches most specifically).
     9676If more than one pattern rule has the shortest stem, @code{make} will
     9677choose the first one found in the makefile.
     9678
     9679This algorithm results in more specific rules being preferred over
     9680more generic ones; for example:
     9681
     9682@example
     9683%.o: %.c
     9684        $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@@
     9685
     9686%.o : %.f
     9687        $(COMPILE.F) $(OUTPUT_OPTION) $<
     9688
     9689lib/%.o: lib/%.c
     9690        $(CC) -fPIC -c $(CFLAGS) $(CPPFLAGS) $< -o $@@
     9691@end example
     9692
     9693Given these rules and asked to build @file{bar.o} where both
     9694@file{bar.c} and @file{bar.f} exist, @code{make} will choose the first
     9695rule and compile @file{bar.c} into @file{bar.o}.  In the same
     9696situation where @file{bar.c} does not exist, then @code{make} will
     9697choose the second rule and compile @file{bar.f} into @file{bar.o}.
     9698
     9699If @code{make} is asked to build @file{lib/bar.o} and both
     9700@file{lib/bar.c} and @file{lib/bar.f} exist, then the third rule will
     9701be chosen since the stem for this rule (@samp{bar}) is shorter than
     9702the stem for the first rule (@samp{lib/bar}).  If @file{lib/bar.c}
     9703does not exist then the third rule is not eligible and the second rule
     9704will be used, even though the stem is longer.
     9705
    94059706@node Match-Anything Rules, Canceling Rules, Pattern Match, Pattern Rules
    94069707@subsection Match-Anything Pattern Rules
     
    1008410385The ``what if'' flag (@samp{-W} in GNU @code{make}) was (as far as we know)
    1008510386invented by Andrew Hume in @code{mk}.
    10086 @xref{Instead of Execution, ,Instead of Executing the Recipes}.
     10387@xref{Instead of Execution, ,Instead of Executing Recipes}.
    1008710388
    1008810389@item
     
    1010210403@item
    1010310404The special significance of @samp{+} characters preceding recipe lines
    10104 (@pxref{Instead of Execution, ,Instead of Executing the Recipes}) is
     10405(@pxref{Instead of Execution, ,Instead of Executing Recipes}) is
    1010510406mandated by @cite{IEEE Standard 1003.2-1992} (POSIX.2).
    1010610407
     
    1014710448@item
    1014810449Make verbatim variable definitions with @code{define}.
    10149 @xref{Defining, ,Defining Variables Verbatim}.
     10450@xref{Multi-Line, ,Defining Multi-Line Variables}.
    1015010451
    1015110452@item
     
    1035510656@table @code
    1035610657@item define @var{variable}
     10658@itemx define @var{variable} =
     10659@itemx define @var{variable} :=
     10660@itemx define @var{variable} +=
     10661@itemx define @var{variable} ?=
    1035710662@itemx endef
    10358 
    10359 Define a multi-line, recursively-expanded variable.@*
    10360 @xref{Sequences}.
     10663Define multi-line variables.@*
     10664@xref{Multi-Line}.
     10665
     10666@item undefine @var{variable}
     10667Undefining variables.@*
     10668@xref{Undefine Directive}.
    1036110669
    1036210670@item ifdef @var{variable}
     
    1037010678@itemx else
    1037110679@itemx endif
    10372 
    1037310680Conditionally evaluate part of the makefile.@*
    1037410681@xref{Conditionals}.
     
    1037710684@itemx -include @var{file}
    1037810685@itemx sinclude @var{file}
    10379 
    1038010686Include another makefile.@*
    1038110687@xref{Include, ,Including Other Makefiles}.
    1038210688
    10383 @item override @var{variable} = @var{value}
    10384 @itemx override @var{variable} := @var{value}
    10385 @itemx override @var{variable} += @var{value}
    10386 @itemx override @var{variable} ?= @var{value}
    10387 @itemx override define @var{variable}
    10388 @itemx endef
    10389 
     10689@item override @var{variable-assignment}
    1039010690Define a variable, overriding any previous definition, even one from
    1039110691the command line.@*
     
    1039310693
    1039410694@item export
    10395 
    1039610695Tell @code{make} to export all variables to child processes by default.@*
    1039710696@xref{Variables/Recursion, , Communicating Variables to a Sub-@code{make}}.
    1039810697
    1039910698@item export @var{variable}
    10400 @itemx export @var{variable} = @var{value}
    10401 @itemx export @var{variable} := @var{value}
    10402 @itemx export @var{variable} += @var{value}
    10403 @itemx export @var{variable} ?= @var{value}
     10699@itemx export @var{variable-assignment}
    1040410700@itemx unexport @var{variable}
    1040510701Tell @code{make} whether or not to export a particular variable to child
    1040610702processes.@*
    1040710703@xref{Variables/Recursion, , Communicating Variables to a Sub-@code{make}}.
     10704
     10705@item private @var{variable-assignment}
     10706Do not allow this variable assignment to be inherited by prerequisites.@*
     10707@xref{Suppressing Inheritance}.
    1040810708
    1040910709@item vpath @var{pattern} @var{path}
     
    1051510815
    1051610816@item $(error @var{text}@dots{})
    10517 
    1051810817When this function is evaluated, @code{make} generates a fatal error
    1051910818with the message @var{text}.@*
     
    1052110820
    1052210821@item $(warning @var{text}@dots{})
    10523 
    1052410822When this function is evaluated, @code{make} generates a warning with
    1052510823the message @var{text}.@*
     
    1052710825
    1052810826@item $(shell @var{command})
    10529 
    1053010827Execute a shell command and return its output.@*
    1053110828@xref{Shell Function, , The @code{shell} Function}.
    1053210829
    1053310830@item $(origin @var{variable})
    10534 
    1053510831Return a string describing how the @code{make} variable @var{variable} was
    1053610832defined.@*
     
    1053810834
    1053910835@item $(flavor @var{variable})
    10540 
    1054110836Return a string describing the flavor of the @code{make} variable
    1054210837@var{variable}.@*
     
    1054410839
    1054510840@item $(foreach @var{var},@var{words},@var{text})
    10546 
    1054710841Evaluate @var{text} with @var{var} bound to each word in @var{words},
    1054810842and concatenate the results.@*
    1054910843@xref{Foreach Function, ,The @code{foreach} Function}.
    1055010844
     10845@item $(if @var{condition},@var{then-part}[,@var{else-part}])
     10846Evaluate the condition @var{condition}; if it's non-empty substitute
     10847the expansion of the @var{then-part} otherwise substitute the
     10848expansion of the @var{else-part}.@*
     10849@xref{Conditional Functions, ,Functions for Conditionals}.
     10850
     10851@item $(or @var{condition1}[,@var{condition2}[,@var{condition3}@dots{}]])
     10852Evaluate each condition @var{conditionN} one at a time; substitute the
     10853first non-empty expansion.  If all expansions are empty, substitute
     10854the empty string.@*
     10855@xref{Conditional Functions, ,Functions for Conditionals}.
     10856
     10857@item $(and @var{condition1}[,@var{condition2}[,@var{condition3}@dots{}]])
     10858Evaluate each condition @var{conditionN} one at a time; if any
     10859expansion results in the empty string substitute the empty string.  If
     10860all expansions result in a non-empty string, substitute the expansion
     10861of the last @var{condition}.@*
     10862@xref{Conditional Functions, ,Functions for Conditionals}.
     10863
    1055110864@item $(call @var{var},@var{param},@dots{})
    10552 
    1055310865Evaluate the variable @var{var} replacing any references to @code{$(1)},
    1055410866@code{$(2)} with the first, second, etc.@: @var{param} values.@*
     
    1055610868
    1055710869@item $(eval @var{text})
    10558 
    1055910870Evaluate @var{text} then read the results as makefile commands.
    1056010871Expands to the empty string.@*
     
    1056210873
    1056310874@item $(value @var{var})
    10564 
    1056510875Evaluates to the contents of the variable @var{var}, with no expansion
    1056610876performed on it.@*
     
    1074711057second form of the error above.  Remember that every line in the
    1074811058recipe must begin with a tab character (unless you set
    10749 @code{.CMDPREFIX}; @pxref{Special Variables}).  Eight spaces do not
     11059@code{.RECIPEPREFIX}; @pxref{Special Variables}).  Eight spaces do not
    1075011060count.  @xref{Rule Syntax}.
    1075111061
     
    1100711317#### End of system configuration section. ####
    1100811318
    11009 SRC1 =  tar.c create.c extract.c buffer.c \
    11010         getoldopt.c update.c gnu.c mangle.c
    11011 SRC2 =  version.c list.c names.c diffarch.c \
    11012         port.c wildmat.c getopt.c
    11013 SRC3 =  getopt1.c regex.c getdate.y
    11014 SRCS =  $(SRC1) $(SRC2) $(SRC3)
    11015 OBJ1 =  tar.o create.o extract.o buffer.o \
    11016         getoldopt.o update.o gnu.o mangle.o
    11017 OBJ2 =  version.o list.o names.o diffarch.o \
    11018         port.o wildmat.o getopt.o
    11019 OBJ3 =  getopt1.o regex.o getdate.o $(RTAPELIB)
    11020 OBJS =  $(OBJ1) $(OBJ2) $(OBJ3)
     11319@group
     11320SRCS_C  = tar.c create.c extract.c buffer.c   \
     11321          getoldopt.c update.c gnu.c mangle.c \
     11322          version.c list.c names.c diffarch.c \
     11323          port.c wildmat.c getopt.c getopt1.c \
     11324          regex.c
     11325SRCS_Y  = getdate.y
     11326SRCS    = $(SRCS_C) $(SRCS_Y)
     11327OBJS    = $(SRCS_C:.c=.o) $(SRCS_Y:.y=.o) $(RTAPELIB)
     11328@end group
    1102111329@group
    1102211330AUX =   README COPYING ChangeLog Makefile.in  \
Note: See TracChangeset for help on using the changeset viewer.