summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorDmitry Goncharov <dgoncharov@users.sf.net>2022-12-18 10:29:17 -0500
committerPaul Smith <psmith@gnu.org>2022-12-18 20:06:38 -0500
commit7d8756a4a369fcc389ada4d916d6b687b8391eee (patch)
treeb81009d791f50cfcdee2db7b4988512da492f0cd /doc
parent8e805c7ba66b731cdd8284940f1a807ccd0d5cd4 (diff)
downloadmake-git-7d8756a4a369fcc389ada4d916d6b687b8391eee.tar.gz
[SV 63537] Document and test flippable switches
* doc/make.texi (Options/Recursion): Clarify that MAKEFLAGS values from the environment have precedence over those set in the makefile. * tests/scripts/variables/MAKEFLAGS: Check boolean switches -k/-S, -w/--no-print-directory and -s/--no-silent as follows: 1. A switch can be enabled or disabled on the command line. 2. A switch can be enabled or disabled in env. 3. A switch can be enabled or disabled in makefile. 4. Command line beats env and makefile. 5. Env beats makefile. 6. MAKEFLAGS contains each specified switch at parse and build time. 7. If switches are specified in multiple origins, MAKEFLAGS contains the winning switch at parse and build time. 8. MAKEFLAGS does not contain the losing switch. Also test that --debug settings from different origins are combined together into one option.
Diffstat (limited to 'doc')
-rw-r--r--doc/make.texi10
1 files changed, 6 insertions, 4 deletions
diff --git a/doc/make.texi b/doc/make.texi
index 18d4375e..84f473e4 100644
--- a/doc/make.texi
+++ b/doc/make.texi
@@ -5070,10 +5070,12 @@ set up automatically by @code{make} to contain the flag letters that
@code{make} received. Thus, if you do @w{@samp{make -ks}} then
@code{MAKEFLAGS} gets the value @samp{ks}.
-As a consequence, every sub-@code{make} gets a value for @code{MAKEFLAGS}
-in its environment. In response, it takes the flags from that value and
-processes them as if they had been given as arguments.
-@xref{Options Summary, ,Summary of Options}.
+As a consequence, every sub-@code{make} gets a value for @code{MAKEFLAGS} in
+its environment. In response, it takes the flags from that value and
+processes them as if they had been given as arguments. @xref{Options Summary,
+,Summary of Options}. This means that, unlike other environment variables,
+@code{MAKEFLAGS} specified in the environment take precedence over
+@code{MAKEFLAGS} specified in the makefile.
The value of @code{MAKEFLAGS} is a possibly empty group of characters
representing single-letter options that take no argument, followed by a space