diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-07-05 23:07:12 -0400 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-07-10 11:05:09 -0400 |
commit | 051f278e9d81bed253bf89c66c80b8b921aafa8a (patch) | |
tree | 188b90e6cd434ca30972e6166bfbc88e273d9474 /scripts | |
parent | 75dd47472b92c320304436c9e38638bc04ae7a4a (diff) |
kbuild: replace KBUILD_SRCTREE with boolean building_out_of_srctree
Commit 25b146c5b8ce ("kbuild: allow Kbuild to start from any directory")
deprecated KBUILD_SRCTREE.
It is only used in tools/testing/selftest/ to distinguish out-of-tree
build. Replace it with a new boolean flag, building_out_of_srctree.
I also replaced the conditional ($(srctree),.) because the next commit
will allow an absolute path to be used for $(srctree) even when building
in the source tree.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.build | 2 | ||||
-rw-r--r-- | scripts/Makefile.host | 2 | ||||
-rw-r--r-- | scripts/Makefile.lib | 2 | ||||
-rw-r--r-- | scripts/Makefile.modbuiltin | 2 | ||||
-rw-r--r-- | scripts/gdb/linux/Makefile | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 776842b7e6a3..be38198d98b2 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
@@ -513,7 +513,7 @@ existing-targets := $(wildcard $(sort $(targets))) | |||
513 | 513 | ||
514 | -include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd) | 514 | -include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd) |
515 | 515 | ||
516 | ifneq ($(srctree),.) | 516 | ifdef building_out_of_srctree |
517 | # Create directories for object files if they do not exist | 517 | # Create directories for object files if they do not exist |
518 | obj-dirs := $(sort $(obj) $(patsubst %/,%, $(dir $(targets)))) | 518 | obj-dirs := $(sort $(obj) $(patsubst %/,%, $(dir $(targets)))) |
519 | # If targets exist, their directories apparently exist. Skip mkdir. | 519 | # If targets exist, their directories apparently exist. Skip mkdir. |
diff --git a/scripts/Makefile.host b/scripts/Makefile.host index b6a54bdf0965..fcf0213e6ac8 100644 --- a/scripts/Makefile.host +++ b/scripts/Makefile.host | |||
@@ -69,7 +69,7 @@ _hostcxx_flags = $(KBUILD_HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) \ | |||
69 | 69 | ||
70 | # $(objtree)/$(obj) for including generated headers from checkin source files | 70 | # $(objtree)/$(obj) for including generated headers from checkin source files |
71 | ifeq ($(KBUILD_EXTMOD),) | 71 | ifeq ($(KBUILD_EXTMOD),) |
72 | ifneq ($(srctree),.) | 72 | ifdef building_out_of_srctree |
73 | _hostc_flags += -I $(objtree)/$(obj) | 73 | _hostc_flags += -I $(objtree)/$(obj) |
74 | _hostcxx_flags += -I $(objtree)/$(obj) | 74 | _hostcxx_flags += -I $(objtree)/$(obj) |
75 | endif | 75 | endif |
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 281864fcf0fe..8f2eb799a9b2 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
@@ -154,7 +154,7 @@ endif | |||
154 | # $(srctree)/$(src) for including checkin headers from generated source files | 154 | # $(srctree)/$(src) for including checkin headers from generated source files |
155 | # $(objtree)/$(obj) for including generated headers from checkin source files | 155 | # $(objtree)/$(obj) for including generated headers from checkin source files |
156 | ifeq ($(KBUILD_EXTMOD),) | 156 | ifeq ($(KBUILD_EXTMOD),) |
157 | ifneq ($(srctree),.) | 157 | ifdef building_out_of_srctree |
158 | _c_flags += -I $(srctree)/$(src) -I $(objtree)/$(obj) | 158 | _c_flags += -I $(srctree)/$(src) -I $(objtree)/$(obj) |
159 | _a_flags += -I $(srctree)/$(src) -I $(objtree)/$(obj) | 159 | _a_flags += -I $(srctree)/$(src) -I $(objtree)/$(obj) |
160 | _cpp_flags += -I $(srctree)/$(src) -I $(objtree)/$(obj) | 160 | _cpp_flags += -I $(srctree)/$(src) -I $(objtree)/$(obj) |
diff --git a/scripts/Makefile.modbuiltin b/scripts/Makefile.modbuiltin index ea90a90b41a0..50a9990760f3 100644 --- a/scripts/Makefile.modbuiltin +++ b/scripts/Makefile.modbuiltin | |||
@@ -15,7 +15,7 @@ include include/config/tristate.conf | |||
15 | 15 | ||
16 | include scripts/Kbuild.include | 16 | include scripts/Kbuild.include |
17 | 17 | ||
18 | ifneq ($(srctree),.) | 18 | ifdef building_out_of_srctree |
19 | # Create output directory if not already present | 19 | # Create output directory if not already present |
20 | _dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj)) | 20 | _dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj)) |
21 | endif | 21 | endif |
diff --git a/scripts/gdb/linux/Makefile b/scripts/gdb/linux/Makefile index 9fd3d8ed731a..124755087510 100644 --- a/scripts/gdb/linux/Makefile +++ b/scripts/gdb/linux/Makefile | |||
@@ -1,6 +1,6 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | 1 | # SPDX-License-Identifier: GPL-2.0 |
2 | 2 | ||
3 | ifneq ($(srctree),.) | 3 | ifdef building_out_of_srctree |
4 | 4 | ||
5 | symlinks := $(patsubst $(srctree)/$(src)/%,%,$(wildcard $(srctree)/$(src)/*.py)) | 5 | symlinks := $(patsubst $(srctree)/$(src)/%,%,$(wildcard $(srctree)/$(src)/*.py)) |
6 | 6 | ||