diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-09-14 02:33:23 -0400 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-10-04 09:56:01 -0400 |
commit | 80463f1b7bf9f822fd3495139bcf3ef254fdca10 (patch) | |
tree | 8cdacffa9330a8026f9f9a6013096cd9f01107a4 /Makefile | |
parent | 00d78ab2ba756af7b9a4dacd437b7a882bd18a4b (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-- | Makefile | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -15,10 +15,9 @@ NAME = Merciless Moray | |||
15 | PHONY := _all | 15 | PHONY := _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 | 20 | MAKEFLAGS += -rR |
21 | MAKEFLAGS += -rR --include-dir=$(CURDIR) | ||
22 | 21 | ||
23 | # Avoid funny character set dependencies | 22 | # Avoid funny character set dependencies |
24 | unexport LC_ALL | 23 | unexport 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. | ||
143 | MAKEFLAGS += --include-dir=$(CURDIR) | ||
144 | |||
139 | PHONY += $(MAKECMDGOALS) sub-make | 145 | PHONY += $(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 |