Archive・patch・configureとmake2 / 4
Configureとbuild
configureはlibraryやcompiler、featureと導入先を調べ、Makefileやconfig header等を生成する。./configure --helpで対応option、config.logで失敗した検査を読む。--prefixは導入先の基準を指定する。
makeはtargetとprerequisiteの関係から、通常はtimestamp等に基づいて必要な処理を選ぶ。GNU makeは明示指定がなければGNUmakefile、makefile、Makefileをこの順に探す。
| 指定 | 操作 |
|---|---|
| make -f build.mk | 使用するfileを明示する |
| make -n | 実行予定を表示する |
| -j4 | 並列jobの上限に関わるオプション |
report.txt: input.txt
cat input.txt > report.txt
clean:
rm -f report.txt
.PHONY: clean
recipeの行頭は通常tabである。input.txtを更新するとreport.txtを作り直す。clean等のtargetはそのMakefileの定義に従う。make cleanはbuild生成物の清掃、projectのdistclean等は構成結果まで戻す場合がある。