]> git.ipfire.org Git - thirdparty/make.git/commit
[SV 60595] Restart whenever any makefile is rebuilt
authorPaul Smith <psmith@gnu.org>
Mon, 31 May 2021 18:37:09 +0000 (14:37 -0400)
committerPaul Smith <psmith@gnu.org>
Fri, 3 Sep 2021 16:08:11 +0000 (12:08 -0400)
commit7c4e6b0299774280e3a93060c70c661f459aaf40
treee180f55dc5a19c8ae643837388b575120e2eb6cf
parentb9c4fc441b2d66312a592bf4eab67ef7fbe4c645
[SV 60595] Restart whenever any makefile is rebuilt

Previously if an included makefile was rebuilt as a prerequisite of
another included makefile which didn't need to be rebuilt, make would
not realize that it needed to re-exec itself.

Ensure that if any included makefile target is rebuilt we re-exec.
Also ensure that if an included makefile is not readable, and our rule
for rebuilding it doesn't actually change it, we will still fail.

* src/remake.c (update_goal_chain): If a goal's update was successful
then check its status, even if no actual commands were run because it
was already up to date.
(show_goal_error): Remove superfluous cast.
* src/main.c (main): If the makefile remake did nothing, check that we
were able to successfully include all the makefiles we care about; if
not fail.  When generating error messages about included makefiles be
sure to show the filename/linenumber information.
* test/scripts/features/reinvoke: Add tests for this behavior.
* test/scripts/options/dash-k: Update error messages.
src/main.c
src/remake.c
tests/scripts/features/reinvoke
tests/scripts/options/dash-k