Follow-up Comment #3, bug #55242 (project make): I tried these patches (some updates were needed as remake.c has changed slightly). They do fix the original issue but I thought of a new test to add:
# Allow included files to be updated as side-effects of prereqs. Here a.mk # already exists, but b (which is rebuilt) updates it so we should re-exec. touch('a.mk'); unlink('b'); run_make_test(q! all:; @echo hello=$(hello) include a.mk a.mk: b b: ; @echo hello=world >a.mk !, '', "touch b\nhello=world"); This does not pass; even though a.mk was rebuilt we don't re-exec because a.mk was pre-existing, we don't look to see if it's timestamp has changed. We could continue on to fix this too, but I'm not convinced we should do that. In general, make doesn't actually check timestamps of targets unless make believes that they've been updated. I'm not sure that it's correct to break this general rule and do something unique and special for rebuilt makefiles in particular (or, I guess, this patch does something special for goal targets). The way to "correct" the original makefile provided in the bug is the same as when you run into this situation in any other target which is not an included makefile: it is to add a recipe to the *a.mk* rule. The recipe can be a "do nothing" empty recipe: as long as make sees there is SOME recipe then it will consider the target updated. So for example, instead of this: all:; @echo hello=$(hello) include a.mk a.mk: b b: ; @echo hello=world >a.mk if you added a semicolon (empty recipe) to *a.mk* like this: all:; @echo hello=$(hello) include a.mk a.mk: b ; b: ; @echo hello=world >a.mk then it would work fine. My inclination is to close this as "Not a Bug". Comments welcome. _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?55242> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/