mirror of
https://github.com/torvalds/linux.git
synced 2026-01-24 23:16:46 +00:00
kbuild: support building external modules in a separate build directory
There has been a long-standing request to support building external modules in a separate build directory. This commit introduces a new environment variable, KBUILD_EXTMOD_OUTPUT, and its shorthand Make variable, MO. A simple usage: $ make -C <kernel-dir> M=<module-src-dir> MO=<module-build-dir> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
This commit is contained in:
@@ -213,13 +213,11 @@ endif
|
||||
|
||||
# $(src) for including checkin headers from generated source files
|
||||
# $(obj) for including generated headers from checkin source files
|
||||
ifeq ($(KBUILD_EXTMOD),)
|
||||
ifdef building_out_of_srctree
|
||||
_c_flags += $(addprefix -I, $(src) $(obj))
|
||||
_a_flags += $(addprefix -I, $(src) $(obj))
|
||||
_cpp_flags += $(addprefix -I, $(src) $(obj))
|
||||
endif
|
||||
endif
|
||||
|
||||
# If $(is-kernel-object) is 'y', this object will be linked to vmlinux or modules
|
||||
is-kernel-object = $(or $(part-of-builtin),$(part-of-module))
|
||||
|
||||
Reference in New Issue
Block a user