aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2018-09-14 15:33:23 +0900
committerTom Rini <trini@konsulko.com>2021-06-17 10:42:15 -0400
commit4899100539e0533570dd3358b41fbc6b2eb53a03 (patch)
treebec7b99aec46a03fd9bf7b0d2a8aca1e9bf6e9e4
parente4e67d24d26ba8c241e08b5a1f7a1361971b4e37 (diff)
downloadu-boot-WIP/kbuild-resync-v4.20.zip
u-boot-WIP/kbuild-resync-v4.20.tar.gz
u-boot-WIP/kbuild-resync-v4.20.tar.bz2
kbuild: add --include-dir flag only for out-of-tree buildWIP/kbuild-resync-v4.20
The --include-dir flag is used to include check-in Makefiles from $(objtree) without $(srctree)/ prefix. Obviously, this is unneeded for in-tree build. Add the flag just before changing the working directory. This becomes effective after invoking sub-make. Add a little bit comments about it. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-rw-r--r--Makefile14
1 files changed, 10 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index baa329f..1f95e28 100644
--- a/Makefile
+++ b/Makefile
@@ -12,10 +12,9 @@ NAME =
# Comments in this file are targeted only to the developer, do not
# expect to learn how to build the kernel reading this file.
-# o Do not use make's built-in rules and variables
-# (this increases performance and avoids hard-to-debug behaviour);
-# o Look for make include files relative to root of kernel src
-MAKEFLAGS += -rR --include-dir=$(CURDIR)
+# Do not use make's built-in rules and variables
+# (this increases performance and avoids hard-to-debug behaviour)
+MAKEFLAGS += -rR
# Determine target architecture for the sandbox
include include/host_arch.h
@@ -162,6 +161,13 @@ KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) \
$(if $(KBUILD_OUTPUT),, \
$(error failed to create output directory "$(saved-output)"))
+# Look for make include files relative to root of kernel src
+#
+# This does not become effective immediately because MAKEFLAGS is re-parsed
+# once after the Makefile is read. It is OK since we are going to invoke
+# 'sub-make' below.
+MAKEFLAGS += --include-dir=$(CURDIR)
+
PHONY += $(MAKECMDGOALS) sub-make
$(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make