@set EDITION 0.37
@set VERSION 3.63 Beta
-@set UPDATED 15 September 1992
-@set UPDATE-MONTH September 1992
+@set UPDATED 13 November 1992
+@set UPDATE-MONTH November 1992
@c finalout
This manual describes @code{make} and contains the following chapters:@refill
@end ifinfo
-@c !!!!! Edit descriptions.
@menu
* Overview:: Overview of @code{make}.
* Copying:: Your rights and freedoms.
* MAKE Variable:: The special effects of using @samp{$(MAKE)}.
* Variables/Recursion:: How to communicate variables 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}
- option to debug
- makefiles with recursive @code{make} commands.
+* -w Option:: How the @samp{-w} or @samp{--print-directory} option
+ helps debug use of recursive @code{make} commands.
@end menu
@node MAKE Variable, Variables/Recursion, , Recursion
@noindent
produces the value @samp{x.c.o bar.o}.
-@c !!!! This needs more work.
-There are shorthand representations for the @code{patsubst} function.
+Substitution references (@pxref{Substitution Refs, ,Substitution
+References}) are a simpler way to get the effect of the @code{patsubst}
+function:
@example
-$(@var{var}:%@var{pattern}=@var{replacement})
+$(@var{var}:@var{pattern}=@var{replacement})
@end example
@noindent
is equivalent to
@example
-$(patsubst %@var{pattern},@var{replacement},$(@var{var})
+$(patsubst @var{pattern},@var{replacement},$(@var{var}))
@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
$(@var{var}:@var{suffix}=@var{replacement})
$(patsubst %@var{suffix},%@var{replacement},$(@var{var}))
@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})
@findex strip
Removes leading and trailing whitespace from @var{string} and replaces
@noindent
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{})
@findex addsuffix
The argument @var{names} is regarded as a series of names, separated
@menu
* Archive Members:: Archive members as targets.
* Archive Update:: The implicit rule for archive member targets.
+* !!! :: the .X.a kludge
@end menu
@node Archive Members, Archive Update, , Archives
@code{MAKE} even if @samp{-n}, @samp{-q} or @samp{-t} is specified.
@xref{Recursion, ,Recursive Use of @code{make}}.
-@c !!!! what about the kludge for this???
+@c !!! what about the kludge for this???
@item
Support for suffix @samp{.a} in suffix rules. In GNU @code{make},
this is actually implemented by chaining with one pattern rule for