如何在gnumake文件中强制错误 [英] How to force an error in a gnumake file

查看:52
本文介绍了如何在gnumake文件中强制错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的Makefile中检测到工具版本错误的情况,并通过错误消息(指示该项目不是正确的版本)来强制Make失败.

I want to detect a condition in my makefile where a tool is the wrong version and force the make to fail with an error message indicating the item is not the right version.

有人可以举一个例子吗?

Can anyone give an example of doing this?

我尝试了以下操作,但语法不正确:

I tried the following but it is not the right syntax:

ifeq "$(shell svnversion --version | sed s/[^0-9\.]*://)" "1.4"
$error("Bad svnversion v1.4, please install v1.6")
endif

谢谢.

推荐答案

来自手册:

$(error Bad svn version v1.4, please install v1.6)

这将导致make出现致命错误:

This will result make to a fatal error:

$ make
Makefile:2: *** Bad svn version v1.4, please install v1.6.  Stop.

这篇关于如何在gnumake文件中强制错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆