summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2023-07-16 05:41:37 +0200
committerAlejandro Colomar <alx@kernel.org>2023-07-16 05:45:29 +0200
commitc98d237c22e9e898ae7d05e2222e7eac47791bd3 (patch)
treebd712e7bfd851bbef0b0fd12c2a2d569ef4d208e
parentba45d94564a1bab30afa945f537f89c2542fe4df (diff)
Makefile: Improve Makefile troubleshooting
Add an empty double-colon rule that targets the makefiles, to instruct make(1) to not remake makefiles. This improves (considerably reduces) the output of 'make -d'. Suggested-by: Dmitry Goncharov <dgoncharov@users.sf.net> Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r--Makefile1
-rw-r--r--share/mk/make.mk23
2 files changed, 24 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index dd9d527bf..2a757607f 100644
--- a/Makefile
+++ b/Makefile
@@ -145,6 +145,7 @@ include $(MAKEFILEDIR)/lint/c.mk
include $(MAKEFILEDIR)/lint/man/_.mk
include $(MAKEFILEDIR)/lint/man/man.mk
include $(MAKEFILEDIR)/lint/man/mdoc.mk
+include $(MAKEFILEDIR)/make.mk
include $(MAKEFILEDIR)/verbose.mk
diff --git a/share/mk/make.mk b/share/mk/make.mk
new file mode 100644
index 000000000..7bbdc166f
--- /dev/null
+++ b/share/mk/make.mk
@@ -0,0 +1,23 @@
+########################################################################
+# Copyright 2023, Alejandro Colomar <alx@kernel.org>
+# SPDX-License-Identifier: GPL-3.0-or-later
+########################################################################
+
+
+ifndef MAKEFILE_MAKE_INCLUDED
+MAKEFILE_MAKE_INCLUDED := 1
+
+
+include $(MAKEFILEDIR)/cmd.mk
+
+
+MK := $(srcdir)/Makefile
+MK += $(shell $(FIND) $(MAKEFILEDIR) -type f \
+ | $(GREP) '\.mk$$' \
+ | $(SORT))
+
+
+$(MK):: ;
+
+
+endif # include guard