如何解决GNU制定规则顺序/首选项
我有两个通配符规则,如下所示:
%important_results/output.pdf: input2.o
SETTING=$* myimportantcommand > $@
%results/output.pdf: input1.o
SETTING=$* mycommand > $@
具有简单的先决条件:
input1.o: input1.c
touch input1.o
input2.o: input2.c
touch input2.o
但是,运行make important_results
时,我的行为有所不同:
- 如果input2.o存在,则使用
%important_results
规则 - 如果input2.o不存在,但是input1.o存在,则它使用
%results
规则而不是构建input2.o。但是,这会运行错误的命令。
我如何赋予规则首选项,这样即使必须建立先决条件,它也始终与%important_results
规则一起使用?
搜索“ gnu make rule order”或首选项没有任何结果。 我想最简单的解决方案是使用不重叠的通配符。
编辑:https://www.gnu.org/software/make/manual/html_node/Pattern-Match.html建议您不能以这种方式将词干应用于目录。
解决方法
GNU制作手册:
目标被视为匹配文件名的模式; “%” 可以匹配任何 nonempty 子字符串,而其他字符仅匹配 自己。
尝试以下方法,也许:
============================================================
conv_block
z_np.shape (1,512,32)
avr_time 0.072
Number of parameters: 9,216
entry {
name: "TensorFlowBenchmark.example"
iters: 100
wall_time: 0.049364686012268066
}
演示:
%mportant_results/output.pdf: input2.o
SETTING=$(patsubst %i,%,$*) myimportantcommand > $@
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。