[DTrace-devel] [PATCH v5 3/9] build: avoid building config.mk unnecessarily
Nick Alcock
nick.alcock at oracle.com
Fri Feb 2 18:37:37 UTC 2024
'make help' and similar targets in a clean tree can take quite a
long time, and can even fail(!), because the unconditional inclusion
of config.mk forces all the Makeconfig machinery to run even if we
are doing nothing that might ever need any of it.
Include it only when we're not asking for things like help,
make dist, make clean and things like that. (A surprising amount
does depend on config.mk and more will depend on it once we start
to optionally bake installation paths into it, but this subset
seems likely never to need it.)
Signed-off-by: Nick Alcock <nick.alcock at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>
---
GNUmakefile | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/GNUmakefile b/GNUmakefile
index 06da5ab771b6..5dfe02272221 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -122,7 +122,12 @@ $(shell mkdir -p $(objdir))
include Makeoptions
include Makefunctions
include Makeconfig
+
+# Building config.mk is quite expensive: avoid doing it when only
+# documentation targets and such things are invoked.
+ifeq ($(strip $(filter %clean help% dist tags TAGS gtags,$(MAKECMDGOALS))),)
-include $(objdir)/config.mk
+endif
include Build $(sort $(wildcard */Build))
-include $(objdir)/*.deps
include Makerules
--
2.43.0.272.gce700b77fd
More information about the DTrace-devel
mailing list