26

ビルドシステムには長くて複雑な Makefile があります。特定の make 呼び出しに対してどのターゲットが実行されるかを正確に追跡する良い方法はありますか?

4

3 に答える 3

31
于 2012-06-07T16:30:33.417 に答える
3

ElectricMakeは、この状況で役立つ多くの情報を含む XML マークアップ バージョンのビルド ログを生成できます。

  • @ビルド中に呼び出されたすべてのコマンドの完全なコマンドライン (修飾子で「サイレント」コマンドとしてマークされたものも含む)。
  • 呼び出されたコマンドの起点 (makefile と行番号)。
  • コマンドのランタイム。
  • ビルド内のターゲット間の依存関係。
  • ビルド内のターゲットと再帰的な make の間の構造的な関係。
  • ビルドで呼び出されたコマンドによって読み書きされるファイル。

その出力のサンプルを次に示します。

<job id="J0824ab08" thread="5e72bb0" node="linbuild1-2" type="rule" name="../../i686_Linux/testmain/testmain.d" file="../config/rules.mak" line="109">
<command line="110">
<argv>echo Rebuilding '../../i686_Linux/testmain/testmain.d'</argv>
<output src="prog">Rebuilding ../../i686_Linux/testmain/testmain.d
</output>
</command>
<command line="111-114">
<argv>set -e; g++ -MM -w  -DUSE_PROFILING -DUSE_LOGGING -DHAVE_UNIX -DHAVE_LINUX -I.. testmain.cpp \
        | sed 's!\(testmain\)\.o[ :]*!../../i686_Linux/testmain/\1.o '../../i686_Linux/testmain/testmain.d' : !g' \
        &gt; '../../i686_Linux/testmain/testmain.d'; \
        [ -s '../../i686_Linux/testmain/testmain.d' ] || touch '../../i686_Linux/testmain/testmain.d'</argv>
</command>
<opList>
<op type="read" file="/home/ericm/src/testmain/testmain.cpp"/>
<op type="read" file="/home/ericm/src/minidumper/ExceptionReport.h"/>
<op type="read" file="/home/ericm/src/util/ECAssert.h"/>
<op type="create" file="/home/ericm/i686_Linux/ecloud/testmain/testmain.d" found="0"/>
</opList>
<timing invoked="1.919926" completed="3.600491" node="linbuild1-2"/>
<waitingJobs idList="J0824ae38"/>
</job>

なじみのない Makefile をすばやくナビゲートする方法は、注釈付きのビルド ログを使用して Makefile の回避方法を見つける例を示しています。

Data Mining ElectricAccelerator Annotationは、注釈付きビルド ログを使用してビルドの部品表を生成する方法を示しています。

ElectricMake は GNU Make と互換性があるため、GNU Make で動作する Makefile を処理できます。

免責事項: 私は ElectricAccelerator のアーキテクト兼主任開発者です。

于 2012-06-07T17:12:26.753 に答える