kbuild: add $(objtree)/ prefix to some in-kernel build artifacts

$(objtree) refers to the top of the output directory of kernel builds.

This commit adds the explicit $(objtree)/ prefix to build artifacts
needed for building external modules.

This change has no immediate impact, as the top-level Makefile
currently defines:

  objtree         := .

This commit prepares for supporting the building of external modules
in a different directory.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
This commit is contained in:
Masahiro Yamada
2024-11-10 10:34:30 +09:00
parent 0afd73c5f5
commit 214c0eea43
11 changed files with 30 additions and 30 deletions

View File

@@ -35,10 +35,10 @@
PHONY := __modpost
__modpost:
include include/config/auto.conf
include $(objtree)/include/config/auto.conf
include $(srctree)/scripts/Kbuild.include
MODPOST = scripts/mod/modpost
MODPOST = $(objtree)/scripts/mod/modpost
modpost-args = \
$(if $(CONFIG_MODULES),-M) \
@@ -119,11 +119,11 @@ include $(kbuild-file)
output-symdump := $(KBUILD_EXTMOD)/Module.symvers
ifeq ($(wildcard Module.symvers),)
missing-input := Module.symvers
ifeq ($(wildcard $(objtree)/Module.symvers),)
missing-input := $(objtree)/Module.symvers
else
modpost-args += -i Module.symvers
modpost-deps += Module.symvers
modpost-args += -i $(objtree)/Module.symvers
modpost-deps += $(objtree)/Module.symvers
endif
modpost-args += -e $(addprefix -i , $(KBUILD_EXTRA_SYMBOLS))