简体   繁体   English

GNU Make只执行10条规则

[英]GNU Make only executes 10 rules

I have a makefile that shall convert some files into PDFs. 我有一个makefile,可以将一些文件转换为PDF。 Right now the makefile looks like this: 现在makefile看起来像这样:

PDFS = file_A.pdf file_B.pdf <snip> file_K.pdf

all : convert

file_%.pdf:
    $(CONVERTER_COMMAND) $< -o $@

file_A.pdf : file1.ext
file_B.pdf : file2.ext
<snip>
file_K.pdf : file11.ext

convert : $(PDFS)
.PHONY : convert

The above is the general structure (unfortunately I can't show the actual file). 以上是一般结构(遗憾的是我无法显示实际文件)。

Running make convert works like a charm for the first 10 files, ie it generates file_A.pdf up until file_J.pdf . 运行make convert就像前10个文件的魅力一样,即它生成file_A.pdf直到file_J.pdf The last one however, file_K.pdf , is never generated. 但是,最后一个,即file_K.pdf ,永远不会生成。 If I move the rule for it to the top of the list it gets generated, but then the now last one in the list no longer gets generated. 如果我将其规则移动到列表的顶部,则会生成该规则,但是不再生成列表中现在的最后一个规则。

If I do make file_K.pdf make just state the file is up to date , even though it does not yet exist. 如果我确实make file_K.pdf使文件是up to date ,即使它还不存在。

Any ideas? 有任何想法吗? Or any alternative ideas on how to solve similar problems? 或者关于如何解决类似问题的任何其他想法?

Is there a stray TAB character on the line after the last prerequisite statement (after file_K.pdf : file11.ext in the list above)? 在最后一个先决条件语句之后(在上面的列表中的file_K.pdf : file11.ext之后),是否在该行上有一个迷路TAB字符?

You should try running make -d and see what it has to say about the targets that it doesn't build. 您应该尝试运行make -d并查看它没有构建的目标的说法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM