summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2020-05-11 12:50:12 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2020-05-26 00:03:16 +0900
commit93fdddfefc831981c8cffc3db90275e9b1d8a0e5 (patch)
treeca406524ec5f52f3c4a13bf28f74443238ebbf15 /Makefile
parent827365ffdaa9aa9c0b423800c4d0e72b1fbb938e (diff)
kbuild: add this-makefile as a shorthand for $(lastword $(MAKEFILE_LIST))
Make it clearer, and self-documenting. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile6
1 files changed, 4 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 385e0930ca6d..fcf31edc7522 100644
--- a/Makefile
+++ b/Makefile
@@ -157,12 +157,14 @@ MAKEFLAGS += --include-dir=$(abs_srctree)
need-sub-make := 1
endif
+this-makefile := $(lastword $(MAKEFILE_LIST))
+
ifneq ($(filter 3.%,$(MAKE_VERSION)),)
# 'MAKEFLAGS += -rR' does not immediately become effective for GNU Make 3.x
# We need to invoke sub-make to avoid implicit rules in the top Makefile.
need-sub-make := 1
# Cancel implicit rules for this Makefile.
-$(lastword $(MAKEFILE_LIST)): ;
+$(this-makefile): ;
endif
export abs_srctree abs_objtree
@@ -172,7 +174,7 @@ ifeq ($(need-sub-make),1)
PHONY += $(MAKECMDGOALS) sub-make
-$(filter-out _all sub-make $(lastword $(MAKEFILE_LIST)), $(MAKECMDGOALS)) _all: sub-make
+$(filter-out _all sub-make $(this-makefile), $(MAKECMDGOALS)) _all: sub-make
@:
# Invoke a second make in the output directory, passing relevant variables