Formerly make.texinfo.~54~

This commit is contained in:
Roland McGrath 1992-11-13 23:19:57 +00:00
parent 9e258d2369
commit 7d8fafa4b7

View file

@ -8,8 +8,8 @@
@set EDITION 0.37 @set EDITION 0.37
@set VERSION 3.63 Beta @set VERSION 3.63 Beta
@set UPDATED 15 September 1992 @set UPDATED 13 November 1992
@set UPDATE-MONTH September 1992 @set UPDATE-MONTH November 1992
@c finalout @c finalout
@ -100,7 +100,6 @@ for @code{make} Version @value{VERSION}.@refill
This manual describes @code{make} and contains the following chapters:@refill This manual describes @code{make} and contains the following chapters:@refill
@end ifinfo @end ifinfo
@c !!!!! Edit descriptions.
@menu @menu
* Overview:: Overview of @code{make}. * Overview:: Overview of @code{make}.
* Copying:: Your rights and freedoms. * Copying:: Your rights and freedoms.
@ -2669,9 +2668,8 @@ how the sub-@code{make} relates to the top-level @code{make}.
* MAKE Variable:: The special effects of using @samp{$(MAKE)}. * MAKE Variable:: The special effects of using @samp{$(MAKE)}.
* Variables/Recursion:: How to communicate variables to a sub-@code{make}. * Variables/Recursion:: How to communicate variables to a sub-@code{make}.
* Options/Recursion:: How to communicate options to a sub-@code{make}. * Options/Recursion:: How to communicate options to a sub-@code{make}.
* -w Option:: How to use the @samp{-w} or @samp{--print-directory} * -w Option:: How the @samp{-w} or @samp{--print-directory} option
option to debug helps debug use of recursive @code{make} commands.
makefiles with recursive @code{make} commands.
@end menu @end menu
@node MAKE Variable, Variables/Recursion, , Recursion @node MAKE Variable, Variables/Recursion, , Recursion
@ -4123,21 +4121,23 @@ $(patsubst %.c,%.o,x.c.c bar.c)
@noindent @noindent
produces the value @samp{x.c.o bar.o}. produces the value @samp{x.c.o bar.o}.
@c !!!! This needs more work. Substitution references (@pxref{Substitution Refs, ,Substitution
There are shorthand representations for the @code{patsubst} function. References}) are a simpler way to get the effect of the @code{patsubst}
function:
@example @example
$(@var{var}:%@var{pattern}=@var{replacement}) $(@var{var}:@var{pattern}=@var{replacement})
@end example @end example
@noindent @noindent
is equivalent to is equivalent to
@example @example
$(patsubst %@var{pattern},@var{replacement},$(@var{var}) $(patsubst @var{pattern},@var{replacement},$(@var{var}))
@end example @end example
and The second shorthand simplifies one of the most common uses of
@code{patsubst}: replacing the suffix at the end of file names.
@example @example
$(@var{var}:@var{suffix}=@var{replacement}) $(@var{var}:@var{suffix}=@var{replacement})
@ -4150,6 +4150,27 @@ is equivalent to
$(patsubst %@var{suffix},%@var{replacement},$(@var{var})) $(patsubst %@var{suffix},%@var{replacement},$(@var{var}))
@end example @end example
@noindent
For example, you might have a list of object files:
@example
objects = foo.o bar.o baz.o
@end example
@noindent
To get the list of corresponding source files, you could simply write:
@example
$(objects:.o=.c)
@end example
@noindent
instead of using the general form:
@example
$(patsubst %.o,%.c,$(objects))
@end example
@item $(strip @var{string}) @item $(strip @var{string})
@findex strip @findex strip
Removes leading and trailing whitespace from @var{string} and replaces Removes leading and trailing whitespace from @var{string} and replaces
@ -4375,7 +4396,7 @@ $(basename src/foo.c hacks)
@noindent @noindent
produces the result @samp{src/foo hacks}. produces the result @samp{src/foo hacks}.
@c !!! plural convention with dots (be consistent) @c plural convention with dots (be consistent)
@item $(addsuffix @var{suffix},@var{names}@dots{}) @item $(addsuffix @var{suffix},@var{names}@dots{})
@findex addsuffix @findex addsuffix
The argument @var{names} is regarded as a series of names, separated The argument @var{names} is regarded as a series of names, separated
@ -6555,6 +6576,7 @@ main use is as subroutine libraries for linking.
@menu @menu
* Archive Members:: Archive members as targets. * Archive Members:: Archive members as targets.
* Archive Update:: The implicit rule for archive member targets. * Archive Update:: The implicit rule for archive member targets.
* !!! :: the .X.a kludge
@end menu @end menu
@node Archive Members, Archive Update, , Archives @node Archive Members, Archive Update, , Archives
@ -6730,7 +6752,7 @@ Execution of recursive commands to run @code{make} via the variable
@code{MAKE} even if @samp{-n}, @samp{-q} or @samp{-t} is specified. @code{MAKE} even if @samp{-n}, @samp{-q} or @samp{-t} is specified.
@xref{Recursion, ,Recursive Use of @code{make}}. @xref{Recursion, ,Recursive Use of @code{make}}.
@c !!!! what about the kludge for this??? @c !!! what about the kludge for this???
@item @item
Support for suffix @samp{.a} in suffix rules. In GNU @code{make}, Support for suffix @samp{.a} in suffix rules. In GNU @code{make},
this is actually implemented by chaining with one pattern rule for this is actually implemented by chaining with one pattern rule for