From: Dmitry Goncharov Date: Wed, 3 Aug 2022 04:22:48 +0000 (-0400) Subject: * doc/make.texi (Remaking Makefiles): [SV 61623] Add optimization X-Git-Tag: 4.3.90~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6faa02247ee85244601cfb9baa9d6281faa70c17;p=thirdparty%2Fmake.git * doc/make.texi (Remaking Makefiles): [SV 61623] Add optimization --- diff --git a/doc/make.texi b/doc/make.texi index 6dd9a8e8..430ae11f 100644 --- a/doc/make.texi +++ b/doc/make.texi @@ -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