gmake和make有什么区别?

时间:2009-07-28 15:35:10

标签: build makefile gnu-make

我想了解'gmake'和'make'之间的区别?

在我的linux机器上,它们完全相同:

% gmake --version
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

% make --version
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

我猜这在所有平台上都不一样? 是否有充分的理由使用其中一个? 为什么有这两个名字有一些历史意义吗?

4 个答案:

答案 0 :(得分:150)

'gmake'特指GNU make。 'make'是指系统的默认make实现;在大多数Linux发行版中,这是GNU make,但在其他unix上,它可以引用make的其他一些实现,比如BSD make,或各种商业unix的make实现。

GNU make接受的语言是传统make实用程序支持的语言的超集。

通过特别使用'gmake',您可以使用GNU make扩展,而不必担心它们会被其他一些make实现误解。

答案 1 :(得分:10)

在我的系统上没有区别(gmake是软链接):

-> ls -l $(which gmake make)
lrwxrwxrwx 1 root root      4 Jun  5  2007 /usr/bin/gmake -> make
-rwxr-xr-x 1 root root 168976 Jul 13  2006 /usr/bin/make

gmake代表GNU make。 make的实现有所不同。在Linux机器上最有可能由GNU制作并使用户的生命更加柔和地链接到gmake。

答案 2 :(得分:2)

gmake的通常“相反”是BSD make,在BSD系统上往往是make,不出所料。如果你想看看BSD是什么样的,在Debian衍生品上它可以apt-get install pmake获得。

答案 3 :(得分:-3)

显然,GNU make是practically universal now,所以应该几乎没有差别。

相关问题