summaryrefslogtreecommitdiff
path: root/tests/scripts/options
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2005-06-25 18:57:28 +0000
committerPaul Smith <psmith@gnu.org>2005-06-25 18:57:28 +0000
commit978819e1d6e9354b5b20d15c875bef98579873ae (patch)
treee601b286b4cd0ceb5cace61bea3d1bc6074480b3 /tests/scripts/options
parent467115baae38eba41b3800b4e0e84afb7f3ec99b (diff)
downloadgunmake-978819e1d6e9354b5b20d15c875bef98579873ae.tar.gz
Add a new variable: MAKE_RESTARTS, to count how many times make has re-exec'd.
When rebuilding makefiles, unset -B if MAKE_RESTARTS is >0.
Diffstat (limited to 'tests/scripts/options')
-rw-r--r--tests/scripts/options/dash-B36
1 files changed, 35 insertions, 1 deletions
diff --git a/tests/scripts/options/dash-B b/tests/scripts/options/dash-B
index 4ac377f..864a01f 100644
--- a/tests/scripts/options/dash-B
+++ b/tests/scripts/options/dash-B
@@ -31,9 +31,43 @@ utouch(1000, 'foo');
run_make_test(undef, '', "#MAKE#: Nothing to be done for `all'.");
run_make_test(undef, '-B', 'cp bar.x foo');
-
# Clean up
rmfiles('bar.x', 'foo');
+# Test -B with the re-exec feature: we don't want to re-exec forever
+# Savannah bug # 7566
+
+run_make_test('
+all: ; @:
+$(info MAKE_RESTARTS=$(MAKE_RESTARTS))
+include foo.x
+foo.x: ; @touch $@
+',
+ '-B', 'MAKE_RESTARTS=
+#MAKEFILE#:4: foo.x: No such file or directory
+MAKE_RESTARTS=1');
+
+rmfiles('foo.x');
+
+# Test -B with the re-exec feature: we DO want -B in the "normal" part of the
+# makefile.
+
+&touch('blah.x');
+
+run_make_test('
+all: blah.x ; @echo $@
+$(info MAKE_RESTARTS=$(MAKE_RESTARTS))
+include foo.x
+foo.x: ; @touch $@
+blah.x: ; @echo $@
+',
+ '-B', 'MAKE_RESTARTS=
+#MAKEFILE#:4: foo.x: No such file or directory
+MAKE_RESTARTS=1
+blah.x
+all');
+
+rmfiles('foo.x', 'blah.x');
+
1;