]> git.ipfire.org Git - thirdparty/make.git/commitdiff
* doc/make.texi (Remaking Makefiles): [SV 61623] Add optimization
authorDmitry Goncharov <dgoncharov@users.sf.net>
Wed, 3 Aug 2022 04:22:48 +0000 (00:22 -0400)
committerPaul Smith <psmith@gnu.org>
Sun, 7 Aug 2022 21:31:50 +0000 (17:31 -0400)
doc/make.texi

index 6dd9a8e8d48b66a40f23176762f18396345d556a..430ae11f679729e9ca10ecd6a36bdaef688227d4 100644 (file)
@@ -1399,11 +1399,25 @@ makefile and restart, and never do anything else.  So, to avoid this,
 @code{make} will @strong{not} attempt to remake makefiles which are specified
 as targets of a double-colon rule with a recipe but no prerequisites.
 
-Phony targets (@pxref{Phony Targets}) have the same issue: they are never
+Phony targets (@pxref{Phony Targets}) have the same effect: they are never
 considered up-to-date and so an included file marked as phony would cause
 @code{make} to restart continuously.  To avoid this @code{make} will not
 attempt to remake makefiles which are marked phony.
 
+You can take advantage of this to optimize startup time: if you know you don't
+need your @file{Makefile} to be remade you can prevent make from trying to
+remake it by adding either:
+
+@example
+.PHONY: Makefile
+@end example
+
+or:
+
+@example
+Makefile:: ;
+@end example
+
 If you do not specify any makefiles to be read with @samp{-f} or
 @samp{--file} options, @code{make} will try the default makefile names;
 @pxref{Makefile Names, ,What Name to Give Your Makefile}.  Unlike