]> git.ipfire.org Git - thirdparty/make.git/commit
[SV 63856] Fix pruning of double-colon rules
authorDmitry Goncharov <dgoncharov@users.sf.net>
Sun, 2 Apr 2023 15:04:26 +0000 (11:04 -0400)
committerPaul Smith <psmith@gnu.org>
Sun, 2 Apr 2023 15:12:19 +0000 (11:12 -0400)
commit80727d709c3a14c5f7b4ab14d7c59b8709dc133e
treec1fc9ecb2b581d4ddba3280f8004dfd92c76c092
parentcd46baab90296a75e03c73ad5c1f6f5bc3eb6cb3
[SV 63856] Fix pruning of double-colon rules

Given this setup:

  $ cat Makefile
  A::; @echo A-1 && sleep 1 && echo A-1 done
  A::; @echo A-2 && sleep 1 && echo A-2 done
  A::; @echo A-3 && sleep 1 && echo A-3 done
  B::; @echo B-1 && sleep 1 && echo B-1 done
  B::; @echo B-2 && sleep 1 && echo B-2 done
  B::; @echo B-3 && sleep 1 && echo B-3 done

  $ make -j8 A .WAIT B

All recipes for A should be started sequentially and complete before
any recipe for B is started, then all recipes for B should be started
sequentially.  This wasn't happening because the double-colon target
was getting pruned too early.

* src/remake.c (update_file): Don't prune a target if it's a double
colon rule which is complete, but there are other recipes to run for
this target: we want those other recipes to be run first.
* tests/scripts/targets/WAIT: Test .WAIT with double colon rules.
src/remake.c
tests/scripts/targets/WAIT