0

I feel I've tried everything but I feel I'm missing something really simple.. I'm trying to run a makefile from a project (which works fine on a Mac) on a Windows machine with WSL running but get a weird error.

I noticed the version of make in WSL is 0.8.1 which seemed old, so I've tried to upgrade to 3.81 with these steps:

wget http://ftp.gnu.org/gnu/make/make-3.81.tar.gz
tarxvf make-3.81.tar.gz
cd make-3.81/
./configure
make

But, I get this output every time. I get the same output when I run a make command against the project as I do with the installation script.

davidn0rman@WSL-Ubuntu:/tmp/make-3.81$ make
make ℹ info Invoking all target
make ℹ info Invoking config.h target
make ℹ info Invoking stamp-h1 target
(node:13860) UnhandledPromiseRejectionWarning: undefined
(node:13860) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:13860) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not
handled will terminate the Node.js process with a non-zero exit code.
make ✖ ERR  not found: make-$(srcdir)/config.h.in

  $ make <target...> [options]

  Options:
    --help             Show this help output
    --version          Show package version
    --debug            Enable extended log output

  Targets:
    [targets in the Makefile list here]

If I try and make -v I get the following, but on the Mac I get the version and the copyright blurb.

davidn0rman@WSL-Ubuntu:/tmp$ make -v
make ✖ ERR  Missing Makefile / Bakefile
make ℹ info Run "make init" to generate a Makefile.

To say it's frustrating is putting it mildly, wondering if anyone has run across this before in WSL or Ubuntu? Node and npm are up to date.

  • "version of make in WSL is 0.8.1" that seems unlikely - it is 4.1 on mine. How did you determine this? Do you have multiple versions of make on your system? what is the output of type -a make? – steeldriver May 26 at 11:55
  • When I ran make -v during the above process it gave 0.8.1, although I now notice that was a folder with a Makefile present. Otherwise, I get the error at the end of my post. Output of type -a make is: make is /usr/local/bin/make and make is /usr/bin/make – davidn0rman May 26 at 12:30
  • I suspect that /usr/local/bin/make is npm make, and that's causing all your problems - you don't need to build make, you just need to make sure that your project finds /usr/bin/make first – steeldriver May 26 at 12:38
  • You're right! npm uninstall make -g has fixed it. Thanks @steeldriver ! – davidn0rman May 26 at 12:45
0

As @steeldriver mentioned in this comment, I seemingly had npm make along side make itself.

  • Run type -a make. Ideally you want /usr/bin/make to appear only, I also had /usr/local/bin/make which isn't needed.
  • npm uninstall make -g to remove the latter instance of make.

This rectified the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.