From 7296991d6c2feec34099934af75c35b5c0a47e3a Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sun, 2 Oct 2022 10:18:21 -0400 Subject: [SV 63098] Temporarily revert the change to pattern rule behavior The fix for SV 12078 caused a backward-compatibility issue with some makefiles. In order to allow users to resolve this issue, revert that change for this release cycle: it will be reinstated in the next release cycle. Introduce a warning if we detect that the recipe of a multi-target pattern rule doesn't create all the targets. * NEWS: Announce the future backward-incompatibility. * doc/make.texi (Pattern Intro): Describe the behavior and that it will change in the future. * src/remake.c (check_also_make): Check for also_make targets that were not created and generate a warning. (update_goal_chain): Call the new function. (check_dep): Ditto. (update_file_1): Defer implicit rule detection until after we check all the also_make files (as it used to be). * tests/scripts/features/patternrules: Add tests of the new warning. Skip the tests for SV 12078. --- doc/make.texi | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'doc') diff --git a/doc/make.texi b/doc/make.texi index 4bcd4fbe..79dc34dc 100644 --- a/doc/make.texi +++ b/doc/make.texi @@ -10623,6 +10623,15 @@ always treated as grouped targets (@pxref{Multiple Targets, , Multiple Targets in a Rule}) regardless of whether they use the @code{:} or @code{&:} separator. +There is one exception: if a pattern target is out of date or does +not exist and the makefile does not need to build it, then it will not cause +the other targets to be considered out of date. Note that this historical +exception will be removed in future versions of GNU @code{make} and should not +be relied on. If this situation is detected @code{make} will generate a +warning @emph{pattern recipe did not update peer target}; however, @code{make} +cannot detect all such situations. Please be sure that your recipe updates +@emph{all} the target patterns when it runs. + @node Pattern Examples, Automatic Variables, Pattern Intro, Pattern Rules @subsection Pattern Rule Examples -- cgit v1.2.1