share
Unix & LinuxHow do you install Make from source?
[+2] [1] NewYorkSup
[2020-04-16 16:58:02]
[ software-installation make source ]
[ https://unix.stackexchange.com/questions/580508/how-do-you-install-make-from-source ]

I have tried Make version 4.2 and 4.3 on Ubuntu 18.x, RHEL 8.x, and SUSE 15.x servers. But I get the same problem. I cannot use binary packages (e.g, yum, apt, or zypper commands).

I try to run these commands (but I have replaced 4.3 and with 4.2 as well), and it fails:

curl http://ftp.gnu.org/gnu/make/make-4.3.tar.gz > /tmp/make-4.3.tar.gz
sudo cp /tmp/make-4.3.tar.gz /usr/bin/
sudo cd /usr/bin
sudo tar -zxvf make-4.3.tar.gz
cd make-4.3
sudo ./configure
sudo sh build.sh
sudo ./make install

I see this:

make[3]: Leaving directory '/usr/bin/make-4.3/lib' make[2]: Leaving directory '/usr/bin/make-4.3/lib' make[1]: Leaving directory '/usr/bin/make-4.3/lib' Making install in po make[1]: Entering directory '/usr/bin/make-4.3/po' make[1]: * No rule to make target 'install'. Stop. make[1]: Leaving directory '/usr/bin/make-4.3/po' make: * [Makefile:1442: install-recursive] Error 1

What am I doing wrong?

(1) Did the ./configure command complete successfully without errors? I ran the same commands that you posted on a RHEL 8 machine and it compiled and installed make without issues. - GracefulRestart
That version of gmake is not recommended. It fixes a 22 year old bug with handling include statements but it introduced a new worse bug because it starts parallel execution too early and has no concept to enforce a specific order for the actions in that phase. - schily
@schily, is that "22 year old bug" present in the Red Hat patched version of make? - vonbrand
@vonbrand Since this is a conceptional bug based on a wrong order of evaluation dunring processing of include statements, this cannot be patched. A make program needs to apply all already known rules to make include files just before the attempt is made to open the file. gmake-3.x only does this after reading all primary makefiles, which is too late and causes incorrect warnings. In 1998, I explained my correctly working concept for smake to the gmake maintainer to no avail. - schily
[+2] [2020-04-16 18:00:45] vonbrand

To build GNU packages from source the dance is:

./configure --prefix=/usr/local  # Or your preferred place
make
make install

The configure script queries your environment for all sorts of relevant details (compiler version, usability of various language characteristics, various libraries, functions that might carry different names, ...) and creates some header files from the result reflecting the required configuration. It also builds the Makefile. Running make by itself will fail, until you run configure there is no Makefile, and so no install target.

Why do you want that specific version of make? That one is a quite stable package, the announcement [1] doesn't show any revolutionary changes.

[1] https://lwn.net/Articles/810071/

When I run the "make" command I get "command not found" - NewYorkSup
The ./configure --prefix=/usr/local command resulted in this message "config.status: error: in `/usr/bin/make-4.3': config.status: error: Something went wrong bootstrapping makefile fragments for automatic dependency tracking. Try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). " - NewYorkSup
No version of make seems to work. I tried 4.3, and I have tried several other versions too. None work. Which version should I try? I am reproducing failure on Debian, Red Hat and SUSE servers. I am curious why other people are not having difficulty. - NewYorkSup
(1) @NewYorkSup So you are saying that he should run "make" to compile "make"? Doesn't make much sense, does it. Catch 22. How to install make without already having make? - Daniele Testa
1