diff options
author | Dmitry Goncharov <dgoncharov@users.sf.net> | 2022-08-03 00:22:48 -0400 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2022-08-07 17:31:50 -0400 |
commit | 6faa02247ee85244601cfb9baa9d6281faa70c17 (patch) | |
tree | b59ed4d75932ea4ed9e1a288f8f0c30031d462d9 /doc | |
parent | c72e1ec44673e89fceab4cc9a672f38aeb83abbc (diff) | |
download | make-git-6faa02247ee85244601cfb9baa9d6281faa70c17.tar.gz |
* doc/make.texi (Remaking Makefiles): [SV 61623] Add optimization
Diffstat (limited to 'doc')
-rw-r--r-- | doc/make.texi | 16 |
1 files changed, 15 insertions, 1 deletions
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 |