私は約 1 時間頭を悩ませてきましたが、Google の使用は限定的であることが証明されています。グラフを含むレポートの Makefile があります。グラフは、graphs/ ディレクトリ内の .plot ファイルによって表され、gnuplot を使用して、それらから .tex および .eps ファイルを生成します。次に、ps2pdf を使用して .eps から pdf を生成し、最後に\include
report.tex 内のコマンドでグラフ .tex をドキュメントに含めます。ドキュメントには再びグラフ .pdf を含めて、グラフを最終的な report.pdf に入れます。
すべてを正しくビルドする Makefile がありますが、何らかの理由で、make を実行するたびに report.pdf を再作成する必要があります。出力を読むと、Make は「ターゲットmp-int-2.4-i をmake -d
リメイクする必要があります」と言うことがわかります。mp-int-2.4-ni'." and "Must remake target
ただし、これらは PHONY として宣言されているため、依存するものが変更されない限り、作り直すべきではありません。または、少なくともそう思いましたか?
これを引き起こしている可能性のあるものと、最終的なpdfを毎回作り直す必要を回避する方法について何か考えはありますか?
メイクファイル
GRAPHS := mp-int-2.4-ni mp-int-2.4-i
.PHONY : $(GRAPHS)
.PRECIOUS : graphs/%.pdf
report.pdf: report.tex $(GRAPHS)
# ...
$(GRAPHS): %: graphs/%.pdf graphs/%.tex
graphs/%.pdf: graphs/%.eps
# ...
graphs/%.tex graphs/%.eps: graphs/%.plot
# ...
make -d
make がすでに実行された後
$ make -d | grep -Ev "Trying|Reject|Avoid|intermediate"
Considering target file `report.pdf'.
Considering target file `report.tex'.
Looking for an implicit rule for `report.tex'.
No implicit rule found for `report.tex'.
Finished prerequisites of target file `report.tex'.
No need to remake target `report.tex'.
Considering target file `mp-int-2.4-i'.
File `mp-int-2.4-i' does not exist.
Considering target file `graphs/mp-int-2.4-i.pdf'.
Looking for an implicit rule for `graphs/mp-int-2.4-i.pdf'.
Found an implicit rule for `graphs/mp-int-2.4-i.pdf'.
Considering target file `graphs/mp-int-2.4-i.plot'.
Looking for an implicit rule for `graphs/mp-int-2.4-i.plot'.
No implicit rule found for `graphs/mp-int-2.4-i.plot'.
Finished prerequisites of target file `graphs/mp-int-2.4-i.plot'.
No need to remake target `graphs/mp-int-2.4-i.plot'.
Finished prerequisites of target file `graphs/mp-int-2.4-i.pdf'.
Prerequisite `graphs/mp-int-2.4-i.eps' of target `graphs/mp-int-2.4-i.pdf' does not exist.
No need to remake target `graphs/mp-int-2.4-i.pdf'.
Considering target file `graphs/mp-int-2.4-i.tex'.
Looking for an implicit rule for `graphs/mp-int-2.4-i.tex'.
Found an implicit rule for `graphs/mp-int-2.4-i.tex'.
Pruning file `graphs/mp-int-2.4-i.plot'.
Pruning file `graphs/mp-int-2.4-i.plot'.
Finished prerequisites of target file `graphs/mp-int-2.4-i.tex'.
Prerequisite `graphs/mp-int-2.4-i.plot' is older than target `graphs/mp-int-2.4-i.tex'.
No need to remake target `graphs/mp-int-2.4-i.tex'.
Finished prerequisites of target file `mp-int-2.4-i'.
Must remake target `mp-int-2.4-i'.
Successfully remade target file `mp-int-2.4-i'.
Considering target file `mp-int-2.4-ni'.
File `mp-int-2.4-ni' does not exist.
Considering target file `graphs/mp-int-2.4-ni.pdf'.
Looking for an implicit rule for `graphs/mp-int-2.4-ni.pdf'.
Found an implicit rule for `graphs/mp-int-2.4-ni.pdf'.
Considering target file `graphs/mp-int-2.4-ni.plot'.
Looking for an implicit rule for `graphs/mp-int-2.4-ni.plot'.
No implicit rule found for `graphs/mp-int-2.4-ni.plot'.
Finished prerequisites of target file `graphs/mp-int-2.4-ni.plot'.
No need to remake target `graphs/mp-int-2.4-ni.plot'.
Finished prerequisites of target file `graphs/mp-int-2.4-ni.pdf'.
Prerequisite `graphs/mp-int-2.4-ni.eps' of target `graphs/mp-int-2.4-ni.pdf' does not exist.
No need to remake target `graphs/mp-int-2.4-ni.pdf'.
Considering target file `graphs/mp-int-2.4-ni.tex'.
Looking for an implicit rule for `graphs/mp-int-2.4-ni.tex'.
Found an implicit rule for `graphs/mp-int-2.4-ni.tex'.
Pruning file `graphs/mp-int-2.4-ni.plot'.
Pruning file `graphs/mp-int-2.4-ni.plot'.
Finished prerequisites of target file `graphs/mp-int-2.4-ni.tex'.
Prerequisite `graphs/mp-int-2.4-ni.plot' is older than target `graphs/mp-int-2.4-ni.tex'.
No need to remake target `graphs/mp-int-2.4-ni.tex'.
Finished prerequisites of target file `mp-int-2.4-ni'.
Must remake target `mp-int-2.4-ni'.
Successfully remade target file `mp-int-2.4-ni'.
Finished prerequisites of target file `report.pdf'.
Prerequisite `report.tex' is older than target `report.pdf'.
Prerequisite `mp-int-2.4-i' of target `report.pdf' does not exist.
Prerequisite `mp-int-2.4-ni' of target `report.pdf' does not exist.
Must remake target `report.pdf'.
以下の Etan Reisner からの回答後の Makefile の作業:
GRAPHS := mp-int-2.4-i mp-int-2.4-ni
GRAPHS_WD := $(addprefix graphs/,$(GRAPHS))
REAL_GRAPHS := $(addsuffix .pdf,$(GRAPHS_WD)) $(addsuffix .tex,$(GRAPH_SWD))
.PHONY : clean
report.pdf: report.tex $(REAL_GRAPHS)
# ...
graphs/%.pdf: graphs/%.eps
# ..
graphs/%.tex graphs/%.eps: graphs/%.plot
# ..