summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2018-09-14 02:33:23 -0400
committerMasahiro Yamada <yamada.masahiro@socionext.com>2018-10-04 09:56:01 -0400
commit80463f1b7bf9f822fd3495139bcf3ef254fdca10 (patch)
tree8cdacffa9330a8026f9f9a6013096cd9f01107a4 /Makefile
parent00d78ab2ba756af7b9a4dacd437b7a882bd18a4b (diff)
kbuild: add --include-dir flag only for out-of-tree build
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>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 10 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 8f6dbfce1e7e..2087e797c954 100644
--- a/Makefile
+++ b/Makefile
@@ -15,10 +15,9 @@ NAME = Merciless Moray
15PHONY := _all 15PHONY := _all
16_all: 16_all:
17 17
18# o Do not use make's built-in rules and variables 18# Do not use make's built-in rules and variables
19# (this increases performance and avoids hard-to-debug behaviour); 19# (this increases performance and avoids hard-to-debug behaviour)
20# o Look for make include files relative to root of kernel src 20MAKEFLAGS += -rR
21MAKEFLAGS += -rR --include-dir=$(CURDIR)
22 21
23# Avoid funny character set dependencies 22# Avoid funny character set dependencies
24unexport LC_ALL 23unexport LC_ALL
@@ -136,6 +135,13 @@ KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) \
136$(if $(KBUILD_OUTPUT),, \ 135$(if $(KBUILD_OUTPUT),, \
137 $(error failed to create output directory "$(saved-output)")) 136 $(error failed to create output directory "$(saved-output)"))
138 137
138# Look for make include files relative to root of kernel src
139#
140# This does not become effective immediately because MAKEFLAGS is re-parsed
141# once after the Makefile is read. It is OK since we are going to invoke
142# 'sub-make' below.
143MAKEFLAGS += --include-dir=$(CURDIR)
144
139PHONY += $(MAKECMDGOALS) sub-make 145PHONY += $(MAKECMDGOALS) sub-make
140 146
141$(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make 147$(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make