mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 21:21:41 +00:00
2eb5d7f242
Building external modules is typically done using this command: $ make -C <KERNEL_DIR> M=<EXTMOD_DIR> Here, <KERNEL_DIR> refers to the output directory where the kernel was built, not the kernel source directory. When the kernel is built in the source tree, there is no ambiguity, as the output directory and the source directory are the same. If the kernel was built in a separate build directory, <KERNEL_DIR> should be the kernel output directory. Otherwise, Kbuild cannot locate necessary build artifacts. This has been the method for building external modules against a pre-built kernel in a separate directory for over 20 years. [1] If you pass the kernel source directory to the -C option, you must also specify the kernel build directory using the O= option. This approach works as well, though it results in a slightly longer command: $ make -C <KERNEL_SOURCE_DIR> O=<KERNEL_BUILD_DIR> M=<EXTMOD_DIR> Some people mistakenly believe that O= should specify a build directory for external modules when used together with M=. This commit adds more clarification to Documentation/kbuild/kbuild.rst. [1]: https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/commit/?id=e321b2ec2eb2993b3d0116e5163c78ad923e3c54 Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nicolas Schier <n.schier@avm.de> |
||
---|---|---|
.. | ||
gcc-plugins.rst | ||
headers_install.rst | ||
index.rst | ||
issues.rst | ||
kbuild.rst | ||
kconfig-language.rst | ||
kconfig-macro-language.rst | ||
Kconfig.recursion-issue-01 | ||
Kconfig.recursion-issue-02 | ||
kconfig.rst | ||
Kconfig.select-break | ||
llvm.rst | ||
makefiles.rst | ||
modules.rst | ||
reproducible-builds.rst |