linux 中 make 和 gmake的关系
001、
'gmake'特指GNU make。 'make'是指系统默认的make实现;在大多数Linux发行版中,这是GNU make,但是在其他unix中,它可以指代make的某些其他实现,例如BSD make或各种商业unix的make实现。
GNU make接受的语言是传统make实用程序支持的语言的超集。
通过特别使用'gmake',您可以使用GNU make扩展,而不用担心它们被某些其他make实现所误解。
gmake是GNU Make的缩写。 Linux系统环境下的make就是GNU Make,之所以有gmake,是因为在别的平台上,make一般被占用,GNU make只好叫gmake了。 比如在安装二进制文件进行编译时要使用make命令,但如果在Solaris或其他非GNU系统中运行,必须使用GNU make,而不是使用系统自带的make版本,这时要用gmake代替make进行编译。
002、在centos7中测试
a、系统
[root@pc1 home]# cat /etc/redhat-release CentOS Linux release 7.6.1810 (Core)
b、比较make和gmake
[root@pc1 home]# make --version ## make版本 GNU Make 3.82 Built for x86_64-redhat-linux-gnu Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. [root@pc1 home]# make --version | md5sum ##生成MD5 10f8de4abad85725f858eaf7aa46e707 - [root@pc1 home]# gmake --version ## gmake版本 GNU Make 3.82 Built for x86_64-redhat-linux-gnu Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. [root@pc1 home]# gmake --version | md5sum ## 生成MD5 10f8de4abad85725f858eaf7aa46e707 -
结论:
01、在绝大多数情况下,gmake = make
02、gmake是make的超集, 在make不好用的情况下,可以尝试gmake解决。