假设一个foo.tar依赖于文件列表的目标foo.files,例如
FOO_FILES := $(shell cat foo.files)
foo.tar: foo.files $(FOO_FILES)
tar -cf foo $(FOO_FILES)
现在假设需要生成 foo.files,例如:
foo.files: foo.files.template
sed -e "s/@{VERSION}/$(VERSION)/" < $< > $@
很明显,foo.files取决于foo.files.template,但是如何确保在生成 foo.files之后评估FOO_FILES 呢?