11

Under Linux, sources of projects commonly come with Makefile's. Makefiles contain directives to build these projects using the command make. I am currently forced to use Windows, and so as to be able to use this OS I configured and enhanced the "PowerShell" (by installing some additional programs, such as vim or svn, a module called PSReadLine, writing a PowerShell profile, etc.).

However I could not find whether it is possible to install make in PowerShell. I am aware that I will also have to install programs that make will call, such as, say, g++ or pdflatex, but that'll be for later. For now I would like to get make itself working in the first place.

A bit of research revealed two possibilities:

  1. The accepted answer to this very similar question: How to use makefiles on Windows, suggests to use Cygwin. That's a possibility, Cygwin is great, but since I decided to give PowerShell a chance I would like to know whether this is also possible with PowerShell, not Cygwin. Hence this question is not a duplicate, since that other question was about some possibility to use make in Windows, whereas I am asking for PowerShell in particular.

  2. There exists a make clone for PowerShell clone called poshmake, but the syntax of the Poshmake files is different from usual Makefiles, which is a no-go. I want a true make, as maintaining two versions of Makefiles for all the projects I have lying around is not an option.

So: is it possible to install GNU make, which will understand the syntax of typical Makefiles, such that I can call make from within PowerShell?

6

Take a look at "Make for Windows". After installing you simply call "make" from CMD or PowerShell.

  • 1
    Ah yes, I did find that, but discarded that possibility because the last update to that project was about 8 years ago. But you're right -- I'll guess I'll give it a try when I'm back at work, and report back :) – Malte Skoruppa Sep 8 '14 at 18:27
  • In fact, I just noticed that make under my modern Ubuntu 14.04 installation is also version 3.81 from 2006. I guess then, it's just really stable and has all the features it needs, and so there simply was no need for further updates ;) – Malte Skoruppa Sep 8 '14 at 18:30
  • 2
    It works, though PowerShell did not find the make command automatically. I had to set up a make alias pointing to the actual make.exe executable in my PowerShell profile. Thanks! – Malte Skoruppa Sep 9 '14 at 10:03
  • 3
    notepad $profile (or edit your PowerShell profile however you like) and add new-item alias:make -value 'C:\Program Files (x86)\GnuWin32\bin\make.exe' - make sure that's the right path to your make.exe – alexanderbird Aug 23 '16 at 17:32
  • 4
    You can simply add C:\Program Files (x86)\GnuWin32\bin to your Path. – forzagreen Oct 24 '17 at 15:51

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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