diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-03-30 08:04:17 -0400 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-04-02 10:28:04 -0400 |
commit | a9a49c2ad9b9b8ee20668c15ca2b806dbed8ea40 (patch) | |
tree | bb1ff85715935f583ef536b2a13a5a5ce9433b44 /Makefile | |
parent | 48b5ffd1268788afb01525e71e864e901e9aa070 (diff) |
kbuild: use $(srctree) instead of KBUILD_SRC to check out-of-tree build
KBUILD_SRC was conventionally used for some different purposes:
[1] To remember the source tree path
[2] As a flag to check if sub-make is already done
[3] As a flag to check if Kbuild runs out of tree
For [1], we do not need to remember it because the top Makefile
can compute it by $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
[2] has been replaced with self-commenting 'sub_make_done'.
For [3], we can distinguish in-tree/out-of-tree by comparing
$(srctree) and '.'
This commit converts [3] to prepare for the KBUILD_SRC removal.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -448,7 +448,7 @@ USERINCLUDE := \ | |||
448 | LINUXINCLUDE := \ | 448 | LINUXINCLUDE := \ |
449 | -I$(srctree)/arch/$(SRCARCH)/include \ | 449 | -I$(srctree)/arch/$(SRCARCH)/include \ |
450 | -I$(objtree)/arch/$(SRCARCH)/include/generated \ | 450 | -I$(objtree)/arch/$(SRCARCH)/include/generated \ |
451 | $(if $(KBUILD_SRC), -I$(srctree)/include) \ | 451 | $(if $(filter .,$(srctree)),,-I$(srctree)/include) \ |
452 | -I$(objtree)/include \ | 452 | -I$(objtree)/include \ |
453 | $(USERINCLUDE) | 453 | $(USERINCLUDE) |
454 | 454 | ||
@@ -509,7 +509,7 @@ PHONY += outputmakefile | |||
509 | # At the same time when output Makefile generated, generate .gitignore to | 509 | # At the same time when output Makefile generated, generate .gitignore to |
510 | # ignore whole output directory | 510 | # ignore whole output directory |
511 | outputmakefile: | 511 | outputmakefile: |
512 | ifneq ($(KBUILD_SRC),) | 512 | ifneq ($(srctree),.) |
513 | $(Q)ln -fsn $(srctree) source | 513 | $(Q)ln -fsn $(srctree) source |
514 | $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile $(srctree) | 514 | $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile $(srctree) |
515 | $(Q)test -e .gitignore || \ | 515 | $(Q)test -e .gitignore || \ |
@@ -1089,7 +1089,7 @@ PHONY += prepare archprepare prepare1 prepare3 | |||
1089 | # and if so do: | 1089 | # and if so do: |
1090 | # 1) Check that make has not been executed in the kernel src $(srctree) | 1090 | # 1) Check that make has not been executed in the kernel src $(srctree) |
1091 | prepare3: include/config/kernel.release | 1091 | prepare3: include/config/kernel.release |
1092 | ifneq ($(KBUILD_SRC),) | 1092 | ifneq ($(srctree),.) |
1093 | @$(kecho) ' Using $(srctree) as source for kernel' | 1093 | @$(kecho) ' Using $(srctree) as source for kernel' |
1094 | $(Q)if [ -f $(srctree)/.config -o -d $(srctree)/include/config ]; then \ | 1094 | $(Q)if [ -f $(srctree)/.config -o -d $(srctree)/include/config ]; then \ |
1095 | echo >&2 " $(srctree) is not clean, please run 'make mrproper'"; \ | 1095 | echo >&2 " $(srctree) is not clean, please run 'make mrproper'"; \ |