2013-04-12 60 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 –