2

ビルドプロセス用に小さなnmakemakefileが必要です。ファイルタイプは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)

このnmakeMakefileで得られるのは次のとおりです。

NMAKE : fatal error U1073: don't know how to make 'A-123.pdf'
4

1 に答える 1

4

「.txt.pdf:」が暗黙のルールとして認識されるためには、両方の拡張子がサフィックスのリストに含まれている必要があると思います。追加してみてください

.SUFFIXES: .txt .pdf
于 2012-06-15T19:34:55.757 に答える