diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
| commit | 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch) | |
| tree | f1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/gnu_make/value-function.html | |
new repository
Diffstat (limited to 'devdocs/gnu_make/value-function.html')
| -rw-r--r-- | devdocs/gnu_make/value-function.html | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/devdocs/gnu_make/value-function.html b/devdocs/gnu_make/value-function.html new file mode 100644 index 00000000..29bc0ed1 --- /dev/null +++ b/devdocs/gnu_make/value-function.html @@ -0,0 +1,14 @@ + <h1 class="section">The value Function</h1> <p>The <code>value</code> function provides a way for you to use the value of a variable <em>without</em> having it expanded. Please note that this does not undo expansions which have already occurred; for example if you create a simply expanded variable its value is expanded during the definition; in that case the <code>value</code> function will return the same result as using the variable directly. </p> <p>The syntax of the <code>value</code> function is: </p> <div class="example"> <pre class="example">$(value <var>variable</var>) +</pre> +</div> <p>Note that <var>variable</var> is the <em>name</em> of a variable, not a <em>reference</em> to that variable. Therefore you would not normally use a ‘<samp>$</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.) </p> <p>The result of this function is a string containing the value of <var>variable</var>, without any expansion occurring. For example, in this makefile: </p> <div class="example"> <pre class="example">FOO = $PATH + +all: + @echo $(FOO) + @echo $(value FOO) +</pre> +</div> <p>The first output line would be <code>ATH</code>, since the “$P” would be expanded as a <code>make</code> variable, while the second output line would be the current value of your <code>$PATH</code> environment variable, since the <code>value</code> function avoided the expansion. </p> <p>The <code>value</code> function is most often used in conjunction with the <code>eval</code> function (see <a href="eval-function">Eval Function</a>). </p><div class="_attribution"> + <p class="_attribution-p"> + Copyright © 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 Free Software Foundation, Inc. <br>Licensed under the GNU Free Documentation License.<br> + <a href="https://www.gnu.org/software/make/manual/html_node/Value-Function.html" class="_attribution-link">https://www.gnu.org/software/make/manual/html_node/Value-Function.html</a> + </p> +</div> |
