加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

在Linux内核编译中将.o文件放在单独的文件夹中

发布时间:2020-12-14 01:15:13 所属栏目:Linux 来源:网络整理
导读:如果只是make,请参阅 linux内核编译 make ARCH=xyz uImage 然后它将根据你的.conf文件编译文件,并在你的.c文件所在的同一文件夹中创建.o或.ko. 所以有什么方法可以强制编译,以便所有.o和.ko都可以在我指定的不同文件夹中 解决方法 尝试使用make O = / path /
如果只是make,请参阅 linux内核编译

make ARCH=xyz uImage

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

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

解决方法

尝试使用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.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读