summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2019-09-03 16:28:36 -0400
committerPaul Smith <psmith@gnu.org>2019-09-07 18:27:26 -0400
commit09676240506f6d7f76d5beb6d80734a89168b0be (patch)
tree19eda0f213f4e0eb07ffbe21648bf31e35fc8e8b /doc
parentba950a796a460da92258c26c67244d17818eca1e (diff)
downloadmake-git-09676240506f6d7f76d5beb6d80734a89168b0be.tar.gz
* doc/make.tex (Substitution Refs): Clarify patsubst relationship.
Diffstat (limited to 'doc')
-rw-r--r--doc/make.texi18
1 files changed, 10 insertions, 8 deletions
diff --git a/doc/make.texi b/doc/make.texi
index 12f70c62..9a3a2cde 100644
--- a/doc/make.texi
+++ b/doc/make.texi
@@ -5523,17 +5523,19 @@ replaced; other occurrences of @var{a} in the value are unaltered. For
example:@refill
@example
-foo := a.o b.o c.o
+foo := a.o b.o l.a c.o
bar := $(foo:.o=.c)
@end example
@noindent
-sets @samp{bar} to @samp{a.c b.c c.c}. @xref{Setting, ,Setting Variables}.
+sets @samp{bar} to @samp{a.c b.c l.a c.c}. @xref{Setting, ,Setting Variables}.
-A substitution reference is actually an abbreviation for use of the
-@code{patsubst} expansion function (@pxref{Text Functions, ,Functions for String Substitution and Analysis}). We provide
-substitution references as well as @code{patsubst} for compatibility with
-other implementations of @code{make}.
+A substitution reference is shorthand for the @code{patsubst}
+expansion function (@pxref{Text Functions, ,Functions for String Substitution and Analysis}):
+@samp{$(@var{var}:@var{a}=@var{b})} is equivalent to
+@samp{$(patsubst %@var{a},%@var{b},@var{var})}. We provide
+substitution references as well as @code{patsubst} for compatibility
+with other implementations of @code{make}.
@findex patsubst
Another type of substitution reference lets you use the full power of
@@ -5548,13 +5550,13 @@ for a description of the @code{patsubst} function.@refill
@group
@exdent For example:
-foo := a.o b.o c.o
+foo := a.o b.o l.a c.o
bar := $(foo:%.o=%.c)
@end group
@end example
@noindent
-sets @samp{bar} to @samp{a.c b.c c.c}.
+sets @samp{bar} to @samp{a.c b.c l.a c.c}.
@node Computed Names, , Substitution Refs, Advanced
@subsection Computed Variable Names