2013-04-12 7 views
5

がちょうどは、Linuxカーネルのコンパイル中に別のフォルダ内のファイル

make ARCH=xyz uImage 

を作るのですかならば、それはあなたの.confファイルごとにファイルをコンパイルし、同じでの.oかの.koを作成するLinuxカーネルのコンパイルで見るの.o作りますあなたの.cファイルがあるフォルダ。

だから、すべての.oとの.koここmake O=/path/to/mydir

を使用して、任意の別のフォルダに私が指定

+0

makefileを編集する必要があります。 – devnull

+0

Linuxカーネルの基本的なmakefile doenstはこの機能を提供していますか? –

答えて

6

試みは、カーネルのから文書であるとなるように、私はコンパイルに強制することができますどのような方法がありますメイクファイル:

# 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

ありがとうございました。私はdistclecleanを実行する必要があります。このオプションを使用して.confを作成し、このオプションでuImageを作成する必要があります。 –

関連する問題