summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@kolpackov.net>2005-11-17 07:27:28 +0000
committerBoris Kolpackov <boris@kolpackov.net>2005-11-17 07:27:28 +0000
commit1fd3f9d79cdf3f03450129020d3310b726003ed3 (patch)
tree8a1869edb1370956940a676841a3a2048a51c6e3 /doc
parent3dd1faa5c849dbeb59a88653068c010699ce86f7 (diff)
downloadgunmake-1fd3f9d79cdf3f03450129020d3310b726003ed3.tar.gz
Implemented the flavor function which returns the flavor of
a variable ('simple', 'recursive', or 'undefined').
Diffstat (limited to 'doc')
-rw-r--r--doc/make.texi54
1 files changed, 52 insertions, 2 deletions
diff --git a/doc/make.texi b/doc/make.texi
index 62ad82e..ed864f9 100644
--- a/doc/make.texi
+++ b/doc/make.texi
@@ -273,6 +273,7 @@ Functions for Transforming Text
* Value Function:: Return the un-expanded value of a variable.
* Eval Function:: Evaluate the arguments as makefile syntax.
* Origin Function:: Find where a variable got its value.
+* Flavor Function:: Find out the flavor of a variable.
* Shell Function:: Substitute the output of a shell command.
* Make Control Functions:: Functions that control how make runs.
@@ -6020,6 +6021,7 @@ call, just as a variable might be substituted.
* Value Function:: Return the un-expanded value of a variable.
* Eval Function:: Evaluate the arguments as makefile syntax.
* Origin Function:: Find where a variable got its value.
+* Flavor Function:: Find out the flavor of a variable.
* Shell Function:: Substitute the output of a shell command.
* Make Control Functions:: Functions that control how make runs.
@end menu
@@ -6939,7 +6941,7 @@ clean:
@end group
@end example
-@node Origin Function, Shell Function, Eval Function, Functions
+@node Origin Function, Flavor Function, Eval Function, Functions
@section The @code{origin} Function
@findex origin
@cindex variables, origin of
@@ -7048,7 +7050,49 @@ Here the redefinition takes place if @samp{$(origin bletch)} returns either
@samp{environment} or @samp{environment override}.
@xref{Text Functions, , Functions for String Substitution and Analysis}.
-@node Shell Function, Make Control Functions, Origin Function, Functions
+@node Flavor Function, Shell Function, Origin Function, Functions
+@section The @code{flavor} Function
+@findex flavor
+@cindex variables, flavor of
+@cindex flavor of variable
+
+The @code{flavor} function is unlike most other functions (and like
+@code{origin} function) in that it does not operate on the values of
+variables; it tells you something @emph{about} a variable. Specifically,
+it tells you the flavor of a variable
+(@pxref{Flavors, ,The Two Flavors of Variables}).
+
+The syntax of the @code{flavor} function is:
+
+@example
+$(flavor @var{variable})
+@end example
+
+Note that @var{variable} is the @emph{name} of a variable to inquire about;
+not a @emph{reference} to that variable. Therefore you would not normally
+use a @samp{$} or parentheses when writing it. (You can, however, use a
+variable reference in the name if you want the name not to be a constant.)
+
+The result of this function is a string that identifies the flavor of the
+variable @var{variable}:
+
+@table @samp
+@item undefined
+
+if @var{variable} was never defined.
+
+@item recursive
+
+if @var{variable} is a recursively expanded variable.
+
+@item simple
+
+if @var{variable} is a simply expanded variable.
+
+@end table
+
+
+@node Shell Function, Make Control Functions, Flavor Function, Functions
@section The @code{shell} Function
@findex shell
@cindex commands, expansion
@@ -10217,6 +10261,12 @@ Return a string describing how the @code{make} variable @var{variable} was
defined.@*
@xref{Origin Function, , The @code{origin} Function}.
+@item $(flavor @var{variable})
+
+Return a string describing the flavor of the @code{make} variable
+@var{variable}.@*
+@xref{Flavor Function, , The @code{flavor} Function}.
+
@item $(foreach @var{var},@var{words},@var{text})
Evaluate @var{text} with @var{var} bound to each word in @var{words},