如果在检查工具版本时找不到某个字符串,我正在寻找一种摆脱makefile的方法.
我想要匹配的grep表达式是:
dplus -VV | grep 'build date and time: Nov 1 2009 19:31:28'
Run Code Online (Sandbox Code Playgroud)
如果安装了正确版本的dplus,则返回匹配的行.
如何根据此表达式在我的makefile中使用条件?
Bet*_*eta 13
这是另一种在GNU Make中有效的方法:
DPLUSVERSION = $(shell dplus -VV | grep 'build date and time: Nov 1 2009 19:31:28')
target_of_interest: do_things do_things_that_uses_dplus
do_things:
...
do_things_that_uses_dplus:
ifeq ($(DPLUSVERSION),)
$(error proper version of dplus not installed)
endif
...
这个目标可以是真实的,或者只是真实的目标所依赖的PHONY目标.
| 归档时间: |
|
| 查看次数: |
11487 次 |
| 最近记录: |