How to install and use "make" in Windows?
Solution 1:
make
is a GNU command so the only way you can get it on Windows is installing a Windows version like the one provided by GNUWin32. Anyway, there are several options for getting that:
-
The most simple choice is using Chocolatey. First you need to install this package manager. Once installed you simlpy need to install
make
(you may need to run it in an elevated/admin command prompt) :choco install make
-
Other recommended option is installing a Windows Subsystem for Linux (WSL/WSL2), so you'll have a Linux distribution of your choice embedded in Windows 10 where you'll be able to install
make
,gcc
and all the tools you need to build C programs. -
For older Windows versions (MS Windows 2000 / XP / 2003 / Vista / 2008 / 7 with msvcrt.dll) you can use GnuWin32.
An outdated alternative was MinGw, but the project seems to be abandoned so it's better to go for one of the previous choices.
Solution 2:
GNU make is available on chocolatey.
Install chocolatey from here.
Then,
choco install make
.
Now you will be able to use Make on windows.
I've tried using it on MinGW, but it should work on CMD as well.
Solution 3:
The accepted answer is a bad idea in general because the manually created make.exe
will stick around and can potentially cause unexpected problems. It actually breaks RubyInstaller: https://github.com/oneclick/rubyinstaller2/issues/105
An alternative is installing make via Chocolatey (as pointed out by @Vasantha Ganesh K)
Another alternative is installing MSYS2 from Chocolatey and using make
from C:\tools\msys64\usr\bin
. If make
isn't installed automatically with MSYS2 you need to install it manually via pacman -S make
(as pointed out by @Thad Guidry and @Luke).
Solution 4:
If you're using Windows 10, it is built into the Linux subsystem feature. Just launch a Bash prompt (press the Windows key, then type bash
and choose "Bash on Ubuntu on Windows"), cd
to the directory you want to make and type make
.
FWIW, the Windows drives are found in /mnt
, e.g. C:\
drive is /mnt/c
in Bash.
If Bash isn't available from your start menu, here are instructions for turning on that Windows feature (64-bit Windows only):
https://docs.microsoft.com/en-us/windows/wsl/install-win10