diff options
author | Paul Smith <psmith@gnu.org> | 2023-02-21 20:32:12 -0500 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2023-02-21 20:53:48 -0500 |
commit | 8b8cc3a825b0e9e176db5d90084c814e3744a300 (patch) | |
tree | 2f36ba8fe6274849c6fb9b38882bf4f5b5a39a00 /tests | |
parent | 9b6fedef1ce34391e60cc96d1cb52b9884a8339a (diff) | |
download | make-git-8b8cc3a825b0e9e176db5d90084c814e3744a300.tar.gz |
Use a recursive environment if any command needs it
We only create one target environment for all commands in a recipe.
Ensure it's set for recursive make if ANY command is recursive, not
just the first one.
* src/job.c (start_job_command): Check for any recursive command.
* tests/scripts/features/jobserver: Test recursion on second line.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/scripts/features/jobserver | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/scripts/features/jobserver b/tests/scripts/features/jobserver index e12facf0..a2f06ee8 100644 --- a/tests/scripts/features/jobserver +++ b/tests/scripts/features/jobserver @@ -132,6 +132,42 @@ all a: ; @echo $@ '--jobserver-style=foo -j8', "#MAKE#: *** unknown jobserver auth style 'foo'. Stop.", 512); +# Ensure the jobserver is not disabled even if only later commands are recursive + +run_make_test(q! +.RECIPEPREFIX := > +all: +> @echo $@ 1 +> @echo $@ 2 +> @$(MAKE) -f #MAKEFILE# recurse + +recurse: ; @echo $@ +!, + "$np -j8", "all 1\nall 2\nrecurse"); + +if ($port_type ne 'W32') { + run_make_test(undef, "$np --jobserver-style=pipe -j8", + "all 1\nall 2\nrecurse"); +} + +# And with + instead of $(MAKE) + +run_make_test(q! +.RECIPEPREFIX := > +all: +> @echo $@ 1 +> @echo $@ 2 +> @+#MAKEPATH# -f #MAKEFILE# recurse + +recurse: ; @echo $@ +!, + "$np -j8", "all 1\nall 2\nrecurse"); + +if ($port_type ne 'W32') { + run_make_test(undef, "$np --jobserver-style=pipe -j8", + "all 1\nall 2\nrecurse"); +} + if (exists $FEATURES{'jobserver-fifo'}) { # sv 62908. # Test that when mkfifo fails, make switches to pipe and succeeds. |