确定是否使用gmake执行Makefile [英] Determine if Makefile is executed with gmake

查看:77
本文介绍了确定是否使用gmake执行Makefile的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在FreeBSD上,需要使用GNU make(gmake)而不是标准系统make来编译应用程序.如果Makefile不是使用gmake编译的,是否可以对Makefile发出指令以停止执行它并显示错误?

Say on FreeBSD an application needs to be compiled with GNU make (gmake), not the standard system make. Is there any directive I could put to the Makefile to stop executing it and print an error if the Makefile is not compiled with gmake?

推荐答案

调用您的Makefile GNUmakefile . GNU Make会找到它,但其他品牌找不到.

Call your makefile GNUmakefile. GNU Make will find it, but not other makes.

对于大多数makefile文件,建议不要使用选中的名字GNUmakefile.如果您有一个特定于GNU make的makefile,而其他版本的make不会理解该文件,则应使用此名称.其他make程序查找makefile和Makefile,而不查找GNUmakefile.
The first name checked, GNUmakefile, is not recommended for most makefiles. You should use this name if you have a makefile that is specific to GNU make, and will not be understood by other versions of make. Other make programs look for makefile and Makefile, but not GNUmakefile.

这篇关于确定是否使用gmake执行Makefile的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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