可能性の重複:
GNU Makefile rule generating a few targets from a single source fileGNUは作る:複数のターゲットを単一のルールに
私はこのようなMakefileのルールがある場合:
a b c:
echo "Creating a b c"
touch a b c
output: a b c
cat a b c > output
を、私はを実行しますmake -j9出力
makeは3つの依存関係(a、b、c)を見て、それらの生成方法を探します(上記の "a b c"ルール)。 "a b c"ルールは、3つのターゲットすべてを作成するために一度だけ実行する必要があることに気付かないといけませんか?
これは、実際に作るものではありません:
[[email protected] test]$ make -j9 output -n
echo "Creating a b c"
touch a b c
echo "Creating a b c"
touch a b c
echo "Creating a b c"
touch a b c
cat a b c > output
[[email protected] test]$
同じレシピは、かつて「出力」を支配する各依存関係のため、3回を実行しています!
誰でもこのように動作する理由を知っていますか?
関連:http:// stackoverflow。com/questions/3016258/generate-multiple-target-using-single-action-ruleおよびhttp://stackoverflow.com/questions/2973445/gnu-makefile-rule-generating-a-few-targets-from-a-シングルソースファイル – krlmlr