summaryrefslogtreecommitdiff
path: root/Documentation/kbuild/modules.rst
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2024-11-10 10:34:35 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2024-11-28 08:11:55 +0900
commit11b3d5175e6bc3779159228e6077be202d2b0069 (patch)
tree8b85efcc9a4538c3e23c0beb7145f6a55f90f96d /Documentation/kbuild/modules.rst
parentbad6beb2c0bb982b830f592a7b3e3eee76cbb85a (diff)
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>
Diffstat (limited to 'Documentation/kbuild/modules.rst')
-rw-r--r--Documentation/kbuild/modules.rst8
1 files changed, 7 insertions, 1 deletions
diff --git a/Documentation/kbuild/modules.rst b/Documentation/kbuild/modules.rst
index cd5a54d91e6d..a01f3754c7fc 100644
--- a/Documentation/kbuild/modules.rst
+++ b/Documentation/kbuild/modules.rst
@@ -66,7 +66,10 @@ Options
of the kernel output directory if the kernel was built in a separate
build directory.)
- make -C $KDIR M=$PWD
+ You can optionally pass MO= option if you want to build the modules in
+ a separate directory.
+
+ make -C $KDIR M=$PWD [MO=$BUILD_DIR]
-C $KDIR
The directory that contains the kernel and relevant build
@@ -80,6 +83,9 @@ Options
directory where the external module (kbuild file) is
located.
+ MO=$BUILD_DIR
+ Specifies a separate output directory for the external module.
+
Targets
-------