我现在已经摸不着头脑了一个小时,谷歌证明其用途有限.我有一个包含图形的报告的Makefile.图形由目录图形/中的.plot文件表示,gnuplot用于从它们生成.tex和.eps文件.然后使用ps2pdf从.eps生成pdf,最后\includereport.tex中的命令将图形.tex包含到文档中,该文档再次包含图形.pdf以将图形放在最终的report.pdf中.
我有一个正确构建所有内容的Makefile,但出于某种原因,每次运行make时都坚持重新生成report.pdf.通过输出读取make -d显示,Make说:"必须重新制作目标mp-int-2.4-ni'." and "Must remake targetmp-int-2.4-i'." 每次运行,但这些都被宣布为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
# ...
Run Code Online (Sandbox Code Playgroud)
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'.
Run Code Online (Sandbox Code Playgroud)
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
# ..
Run Code Online (Sandbox Code Playgroud)