我的构建过程需要一个小的nmake makefile。文件类型为TXT和PDF。因此我在我的makfile中添加了一个推理规则。但是nmake完全忽略了它。怎么了?
Number=123
Targets=A-$(Number).pdf B-$(Number).pdf
Sources=$(Targets:pdf=txt)
.txt.pdf:
copy $*.txt $*.pdf
all: test build
#this rule creates sample source files
setup:
echo hungry > A-$(Number).txt
echo thursty > B-$(Number).txt
#this rule checks the generated macros
test:
@echo Sources: $(Sources)
@echo Targets: $(Targets)
dir /b $(Sources)
build: $(Targets)
我得到的这个nmake Makefile就是:
NMAKE : fatal error U1073: don't know how to make 'A-123.pdf'
答案 0 :(得分:2)
我认为要将“.txt.pdf:”识别为隐式规则,两个扩展都必须位于后缀列表中。尝试添加
.SUFFIXES: .txt .pdf