summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2021-11-27 21:57:37 -0500
committerPaul Smith <psmith@gnu.org>2021-11-27 22:00:12 -0500
commit3ecf97d3af0f47800b85edae3ef26d20c0bba2f3 (patch)
treebe0948caf95618681aff2f101076ba5b79b1a6c7
parent21d3865973f0de5af3ca8b0d164f93bcc84a15bf (diff)
downloadmake-git-3ecf97d3af0f47800b85edae3ef26d20c0bba2f3.tar.gz
[SV 48643] Update the implicit rule search docs
* NEWS: Announce the change. * doc/make.texi (Implicit Rule Search): Update the definition of "ought to exist" and add the extra step for compatibility mode.
-rw-r--r--NEWS8
-rw-r--r--doc/make.texi11
2 files changed, 17 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 9d8ff2b3..f0a9f75a 100644
--- a/NEWS
+++ b/NEWS
@@ -78,6 +78,14 @@ https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=109&se
made as a side-effect of some other target's recipe are now noticed as
expected.
+* GNU make has sometimes chosen unexpected, and sub-optimal, chains of
+ implicit rules due to the definition of "ought to exist" in the implicit
+ rule search algorithm, which considered any prerequisite mentioned in the
+ makefile as "ought to exist". This algorithm has been modified to prefer
+ prerequisites mentioned explicitly in the target being built and only if
+ that results in no matching rule, will GNU make consider prerequisites
+ mentioned in other targets as "ought to exist".
+
* GNU Make can now be built for MS-Windows using the Tiny C tcc compiler.
Port provided by Christian Jullien <eligis@orange.fr>
diff --git a/doc/make.texi b/doc/make.texi
index 5eea2a94..f97f15ff 100644
--- a/doc/make.texi
+++ b/doc/make.texi
@@ -27,7 +27,7 @@ of @cite{The GNU Make Manual}, for GNU @code{make} version @value{VERSION}.
Copyright @copyright{} 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007,
2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019,
-2020 Free Software Foundation, Inc.
+2020, 2021 Free Software Foundation, Inc.
@quotation
Permission is granted to copy, distribute and/or modify this document
@@ -10964,7 +10964,7 @@ the front of each prerequisite name.@refill
@item
Test whether all the prerequisites exist or ought to exist. (If a
file name is mentioned in the makefile as a target or as an explicit
-prerequisite, then we say it ought to exist.)
+prerequisite of target T, then we say it ought to exist.)
If all prerequisites exist or ought to exist, or there are no prerequisites,
then this rule applies.
@@ -10995,6 +10995,13 @@ made by implicit rules, then this rule applies.
@end enumerate
@item
+If no pattern rule has been found then try step 5 and step 6 again with a
+modified definition of ``ought to exist'': if a filename is mentioned as a
+target or as an explicit prerequisite of @emph{any} target, then it ought to
+exist. This check is only present for backward-compatibility with older
+versions of GNU make: we don't recommend relying on it.
+
+@item
If no implicit rule applies, the rule for @code{.DEFAULT}, if any,
applies. In that case, give @var{t} the same recipe that
@code{.DEFAULT} has. Otherwise, there is no recipe for @var{t}.