【问题标题】:make .o files in separate folder in linux kernel compilation在linux内核编译的单独文件夹中制作.o文件
【发布时间】:2013-04-04 21:10:47
【问题描述】:

如果只是做make,请参见linux内核编译

make ARCH=xyz uImage

然后它将根据您的 .conf 文件编译文件,并在您的 .c 文件所在的同一文件夹中创建 .o 或 .ko。

那么有什么办法可以强制编译,以便所有 .o 和 .ko 都在我指定的不同文件夹中

【问题讨论】:

  • 您需要编辑生成文件。
  • linux内核基本makefile不提供这个功能吗?

标签: c linux compilation linux-kernel


【解决方案1】:

尝试使用make O=/path/to/mydir

这是来自内核 Makefile 的文档:

# kbuild supports saving output files in a separate directory.
# To locate output files in a separate directory two syntaxes are supported.
# In both cases the working directory must be the root of the kernel src.
# 1) O=
# Use "make O=dir/to/store/output/files/"
#
# 2) Set KBUILD_OUTPUT
# Set the environment variable KBUILD_OUTPUT to point to the directory
# where the output files shall be placed.
# export KBUILD_OUTPUT=dir/to/store/output/files/
# make
#
# The O= assignment takes precedence over the KBUILD_OUTPUT environment
# variable.

【讨论】:

  • 感谢工作..我需要进行 distclean 然后需要使用此选项创建 .conf 然后使用此选项创建 uImage
猜你喜欢
  • 2017-03-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-02-15
  • 1970-01-01
相关资源
最近更新 更多