大于Makefile中的字符串比较 [英] Greater than string comparison in a Makefile
本文介绍了大于Makefile中的字符串比较的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在Makefile中表达以下逻辑?
How do I express the following logic in a Makefile?
if $(XORG_VERSION) > "7.7"
<do some thing>
fi
makefile的有条件部分仅提供ifeq或ifneq.
Conditional Parts of Makefiles only provides ifeq or ifneq.
推荐答案
您不限于使用make
条件语句-每个命令都是一个shell命令,它可能会根据您的需要而复杂(包括shell条件语句)声明):
You're not restricted to using the make
conditional statements - each command is a shell command which may be as complex as you need (including a shell conditional statement):
请考虑以下makefile
:
dummy:
if [ ${xyz} -gt 8 ] ; then \
echo urk!! ${xyz} ;\
fi
使用xyz=7 make --silent
时,没有输出.当您使用xyz=9 make --silent
时,它将按预期输出urk!! 9
.
When you use xyz=7 make --silent
, there is no output. When you use xyz=9 make --silent
, it outputs urk!! 9
as expected.
这篇关于大于Makefile中的字符串比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文