What is the difference between gmake and make?

BuildMakefileGnu Make

Build Problem Overview


I am trying to understand the difference between 'gmake' and 'make'?

On my linux box they are identical:

% 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.

I am guessing this isn't the same on all platforms? Is there a good reason to use one over the other?
Is there some historical significance to why there are the two names?

Build Solutions


Solution 1 - Build

'gmake' refers specifically to GNU make. 'make' refers to the system's default make implementation; on most Linux distros this is GNU make, but on other unixes, it could refer to some other implementation of make, such as BSD make, or the make implementations of various commercial unixes.

The language accepted by GNU make is a superset of the one supported by the traditional make utility.

By using 'gmake' specifically you can use GNU make extensions without worrying about them being misinterpreted by some other make implementation.

Solution 2 - Build

On my system no difference (gmake is soft link to make):

-> 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 stands for GNU make. There're different implementations of make. On Linux machine most probably make will by GNU and to make user's life isier make is soft linked to gmake.

Solution 3 - Build

The usual "opposite" of gmake is BSD make, which will tend to be make on BSD systems, unsurprisingly. If you want to see what BSD make is like, on Debian derivatives it's available as apt-get install pmake.

Solution 4 - Build

Apparently, GNU make is practically universal now, so there should almost never be a difference.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionNick HaddadView Question on Stackoverflow
Solution 1 - BuildbdonlanView Answer on Stackoverflow
Solution 2 - BuilddimbaView Answer on Stackoverflow
Solution 3 - BuildchaosView Answer on Stackoverflow
Solution 4 - BuildPaul BiggarView Answer on Stackoverflow