2013-04-12 179 views
5

在linux内核编译看看是否只是让使.o文件在Linux内核编译

make ARCH=xyz uImage 

然后它会编译文件,按您的.conf文件,并创建的.o或同样.ko您的.c文件所在的文件夹。

那么,有没有办法,所以我可以强制编译,使所有的.o和.ko会有任何由我

+0

您需要编辑makefile。 – devnull

+0

linux内核基本makefile doenst提供这个功能吗? –

回答

6

指定不同的文件夹中尝试使用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. 
+1

谢谢working..i需要做distclean然后需要使用这个选项创建.conf,然后用这个选项创建uImage –