我的构建过程需要一个小的 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'