How to install and use "make" on Windows?

I follow the instructions of someone whose repository I cloned into my machine. I just want to: be able to use the make as part of setting up the code environment. But I use Windows, and I searched on the Internet just to find the make.exe file to download, the make-4.1.tar.gz to download (I don’t know what to do with it next), and also about that loading MinGW (for GNU, but after installation I did not find mention of "make").

I do not want the GNU compiler or related things; I just want to use make on Windows. Please tell me what I have to do to do this.

Thanks in advance!

+56
windows-8 windows-10 makefile gnu-make
source share
7 answers

make is a GNU command, so the only way to get it on Windows is to install a version of Windows similar to the one provided by GNUWin32 . Or you can install MinGW and then run:

 copy c:\MinGW\bin\mingw32-make.exe c:\MinGW\bin\make.exe 

or create a link to the actual executable in your PATH variable. In this case, if you update MinGW, the link will not be deleted:

 mklink c:\bin\make.exe C:\MinGW\bin\mingw32-make.exe 

Another option is to use Chocolate . First you need to install this package manager. After installation, you need to install make :

 choco install make. 

The last option is to install the Windows Subsystem for Linux (WSL) , so you will have a built-in Linux distribution on Windows 10 where you can install make , gcc and all the tools necessary to create C programs.

+69
source share

GNU make is available on a chocolate basis.

  • Set chocolate from here .

  • Then choco install make .

Now you can use Make on Windows.
I tried to use it on MinGW, but it should work on CMD as well.

+103
source share

The accepted answer as a whole is a bad idea because manually created make.exe will be make.exe and could potentially cause unexpected problems. This actually breaks RubyInstaller: https://github.com/oneclick/rubyinstaller2/issues/105

An alternative is to install make through Chocolatey (as indicated by @Vasantha Ganesh K)

Another alternative is to install MSYS2 from Chocolatey and use make from C:\tools\msys64\usr\bin . If make not installed automatically with MSYS2, you need to install it manually using pacman -S make (as pointed out by @Thad Guidry and @Luke).

+14
source share
  1. Install Msys2 http://www.msys2.org
  2. Follow the installation instructions
  3. Install make with $ pacman -S make gettext base-devel
  4. Add C:\msys64\usr\bin\ to your path
+7
source share

If you use Windows 10, it is built into the function of the Linux subsystem. Just run the Bash prompt (press the Windows key, then type bash and select "Bash on Ubuntu on Windows"), cd into the directory you want to create, and type make .

FWIW, Windows drives are located in /mnt , for example, C:\ drive is /mnt/c in Bash.

If Bash is not available in the Start menu, the following are instructions on how to enable this Windows feature (64-bit version of Windows only):

https://docs.microsoft.com/en-us/windows/wsl/install-win10

+4
source share

Download make.exe from their official GnuWin32 website

  • In the download session, click Complete package except for sources .

  • Follow the installation instructions.

  • When done, add <installation directory>/bin/ to the PATH variable.

Now you can use make in cmd.

+2
source share

Another option is if you have already installed minGW and added the bin folder to the Path environment variable, you can use "mingw32-make" instead of "make".

You can also create a symlink from "make" to "mingw32-make" or copy and change the file name. I would not recommend options earlier, they will work until you make changes to minGW.

+1
source share

All Articles