在Linux内核编译的单独文件夹中制作.o文件 [英] make .o files in separate folder in linux kernel compilation

查看:455
本文介绍了在Linux内核编译的单独文件夹中制作.o文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Linux内核编译中查看是否只做make

  make ARCH = xyz uImage 

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

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

解决方案

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



这是内核的Makefile中的文档:

 #kbuild支持将输出文件保存在单独的目录中。 
#要在单独的目录中找到输出文件,支持两种语法。
#在两种情况下,工作目录都必须是内核src的根目录。
#1)O =
#使用 make O = dir / to / store / output / files /

#2)设置KBUILD_OUTPUT
#设置环境变量KBUILD_OUTPUT指向目录
#放置输出文件的目录。
#导出KBUILD_OUTPUT = dir / to / store / output / files /
#make

#O =分配优先于KBUILD_OUTPUT环境
#变量。


see in linux kernel compilation if just do make

make ARCH=xyz uImage

then it will compile files as per your .conf file and create .o or .ko in same folder where your .c file is there.

So is there any way so i can force to compilation so that all .o and .ko will be any in different folder specified by me

解决方案

try using make O=/path/to/mydir

Here is the documentation from the kernel's 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.

这篇关于在Linux内核编译的单独文件夹中制作.o文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆