【发布时间】:2011-01-23 06:58:10
【问题描述】:
假设一个目标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?
【问题讨论】:
标签: makefile dependencies gnu-make file-generation