summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2013-09-29 13:15:00 -0400
committerPaul Smith <psmith@gnu.org>2013-09-29 13:15:00 -0400
commit415840be4dc756e11dcd308cb88b807f0044d5b6 (patch)
treefda9c6a2c91276cc5a847a1c9eeded682002a29a /tests
parent2759bfc91b69186d478142cf7b4df38b716bf321 (diff)
downloadmake-415840be4dc756e11dcd308cb88b807f0044d5b6.tar.gz
Reset GNUMAKEFLAGS after parsing.
If we don't do this we'll continually add flags on recursion. This is mainly for users to set in their environment before invoking make.
Diffstat (limited to 'tests')
-rw-r--r--tests/ChangeLog5
-rw-r--r--tests/scripts/variables/GNUMAKEFLAGS14
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 9e2deb37..c785d34b 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,8 @@
+2013-09-29 Paul Smith <psmith@gnu.org>
+
+ * scripts/variables/GNUMAKEFLAGS: Verify that GNUMAKEFLAGS is
+ cleared and options are not duplicated.
+
2013-09-23 Paul Smith <psmith@gnu.org>
* scripts/options/print-directory: Rename dash-w to
diff --git a/tests/scripts/variables/GNUMAKEFLAGS b/tests/scripts/variables/GNUMAKEFLAGS
index edef66e3..bd6979cf 100644
--- a/tests/scripts/variables/GNUMAKEFLAGS
+++ b/tests/scripts/variables/GNUMAKEFLAGS
@@ -23,4 +23,18 @@ all: ; @echo $(MAKEFLAGS)
echo erR --trace --no-print-directory
erR --trace --no-print-directory");
+# Verify that re-exec / recursion doesn't duplicate flags from GNUMAKEFLAGS
+
+$extraENV{GNUMAKEFLAGS} = '-I/tmp -Oline';
+
+run_make_test(q!
+recurse: ; @echo $@; echo MAKEFLAGS = $$MAKEFLAGS; echo GNUMAKEFLAGS = $$GNUMAKEFLAGS; #MAKEPATH# -f #MAKEFILE# all
+all: ; @echo $@; echo MAKEFLAGS = $$MAKEFLAGS; echo GNUMAKEFLAGS = $$GNUMAKEFLAGS
+-include x.mk
+x.mk: ; @echo $@; echo MAKEFLAGS = $$MAKEFLAGS; echo GNUMAKEFLAGS = $$GNUMAKEFLAGS; echo > $@
+!,
+ "", "x.mk\nMAKEFLAGS = -I/tmp -Oline\nGNUMAKEFLAGS =\nrecurse\nMAKEFLAGS = -I/tmp -Oline\nGNUMAKEFLAGS =\n#MAKE#[1]: Entering directory '#PWD#'\nall\nMAKEFLAGS = w -I/tmp -Oline\nGNUMAKEFLAGS =\n#MAKE#[1]: Leaving directory '#PWD#'\n");
+
+unlink('x.mk');
+
1;