Instructions on how to install the gmake
command on macOS from source.
macOS Command Line Tools need to be installed on your local computer.
To install the Command Line Tools run the following command:
xcode-select --install
To obtain the GNU Make tool source code run the following commands:
mkdir -p ~/.src/gnumake
curl --silent --location --retry 3 "https://ftp.gnu.org/gnu/make/make-4.4.tar.gz" | tar xz --no-same-owner --strip-components=1 -C ~/.src/gnumake
cd ~/.src/gnumake
To configure the source to be compiled for macOS run the following commands:
./configure --quiet --prefix=/usr/local --program-prefix=g --disable-dependency-tracking
To build the source code run the following command:
make --silent --no-print-directory
To install the tool run the following commands:
sudo make --silent --no-print-directory install
Run the following command on a terminal window:
gmake --version
After installing the tool you can remove the downloaded source code using the following commands:
cd ~
rm -rf ~/.src
To replace the default make
command on macOS with the gmake
command just installed run the following commands:
sudo ln -s gmake /usr/local/bin/make
sudo ln -s gmake.1 /usr/local/share/man/man1/make.1