makefile - 判断Makefile是否用gmake执行

标签 makefile gnu-make freebsd

假设在 FreeBSD 上,应用程序需要使用 GNU make (gmake) 编译,而不是标准系统 make。如果 Makefile 不是用 gmake 编译的,是否有任何指令我可以放在 Makefile 中以停止执行它并打印错误?

最佳答案

Call your makefile GNUmakefile . GNU Make 会找到它,但不会找到其他 make。

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.

关于makefile - 判断Makefile是否用gmake执行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11775109/

相关文章:

c - 使用 makefile 编译时出现链接器错误

linux - 转换针对Linux和Bash的Makefile

sed - FreeBSD 中的多行删除

linux - 如何编辑 FreeBSD .gz 引导文件?

java - 如何用空格分割 $(MAKECMDGOALS)

c - fbounds 检查不起作用,有替代品吗?

linux - C++ 生成文件安装 : start program at boot and reboot

linux - 使用 Linux 加载程序时 ldconfig 错误 :"is not a symbolic link"

c - 在 makefile 中批量构建源代码

php - Freebsd 中用于循环 postfx 生成的邮件日志的默认工具是什么?