147

我想了解“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

4 回答 4

186

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

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

通过专门使用“gmake”,您可以使用 GNU make 扩展,而不必担心它们会被其他 make 实现误解。

于 2009-07-28T15:39:03.577 回答
12

在我的系统上没有区别(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 很可能会做出让用户生活更美好的事情,make 与 gmake 软链接。

于 2009-07-28T15:40:05.943 回答
2

通常的“对立面”gmake是 BSD make,不出所料,它将倾向于make在 BSD 系统上。如果你想看看 BSD 是怎样的,在 Debian 衍生产品上它可以作为apt-get install pmake.

于 2009-07-28T15:40:05.367 回答
-2

显然,GNU make现在几乎是通用的,所以几乎不会有什么不同。

于 2009-08-02T15:11:29.543 回答