2
我需要一個用於構建過程的nmake makefile。文件類型是TXT和PDF。因此我將推理規則添加到我的mak文件中。但是nmake完全忽略它。怎麼了?爲什麼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'
...並記住.SUFFIXES區分大小寫。 – harper