[makefile] How to install and use "make" in Windows?

I'm following the instructions of someone whose repository I cloned to my machine. What I want is simple: to be able to use the make command as part of setting up the code environment. But I'm using Windows, and I searched online only to find a make.exe file to download, a make-4.1.tar.gz file to download (I don't know what to do with it next), and things about downloading MinGW (for GNU; but after installing it I didn't find any mention of "make").

I don't want a GNU compiler or related stuff; I only want to use "make" in Windows. Please tell me what I should do to accomplish that.

Thanks in advance!

This question is related to makefile windows-8 windows-10 gnu-make

The answer is


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.


Download make.exe from their official site GnuWin32

  • In the Download session, click Complete package, except sources.

  • Follow the installation instructions.

  • Once finished, add the <installation directory>/bin/ to the PATH variable.

Now you will be able to use make in cmd.


I could suggest a step by step approach.

  1. Visit GNUwin
  2. Download the Setup Program
  3. Follow the instructions and install GNUWin. You should pay attention to the directory where your application is being installed. (You will need it later1)
  4. Follow these instructions and add make to your environment variables. As I told you before, now it is time to know where your application was installed. FYI: The default directory is C:\Program Files (x86)\GnuWin32\.
  5. Now, update the PATH to include the bin directory of the newly installed program. A typical example of what one might add to the path is: ...;C:\Program Files (x86)\GnuWin32\bin

One solution that may helpful if you want to use the command line emulator cmder. You can install the package installer chocately. First we install chocately in windows command prompt using the following line:

@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
refreshenv

After chocolatey is installed the choco command can be used to install make. Once installed, you will need add an alias to /cmder/config/user_aliases.cmd. The following line should be added:

make="path_to_chocolatey\chocolatey\bin\make.exe" $*

Make will then operate in the cmder environment.


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

You can also create a symlink from "make" to "mingw32-make", or copying and changing the name of the file. I would not recommend the options before, they will work until you do changes on the minGW.


  1. Install npm
  2. install Node
  3. Install Make node install make up node install make if above commands displays any error then install Chocolatey(choco) Open cmd and copy and paste the below command (command copied from chocolatey URL) @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command " [System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

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).


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

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


Examples related to makefile

MINGW64 "make build" error: "bash: make: command not found" "No rule to make target 'install'"... But Makefile exists How to overcome "'aclocal-1.15' is missing on your system" warning? How to install and use "make" in Windows? How to get a shell environment variable in a makefile? Using local makefile for CLion instead of CMake Difference between using Makefile and CMake to compile the code How to set child process' environment variable in Makefile Windows 7 - 'make' is not recognized as an internal or external command, operable program or batch file Debugging the error "gcc: error: x86_64-linux-gnu-gcc: No such file or directory"

Examples related to windows-8

How to install and use "make" in Windows? How do I create a shortcut via command-line in Windows? Signtool error: No certificates were found that met all given criteria with a Windows Store App? How to open/run .jar file (double-click not working)? Forbidden: You don't have permission to access / on this server, WAMP Error How can I set / change DNS using the command-prompt at windows 8 "Unable to launch the IIS Express Web server" error Can't ping a local VM from the host Viewing localhost website from mobile device How to download/upload files from/to SharePoint 2013 using CSOM?

Examples related to windows-10

Starting ssh-agent on Windows 10 fails: "unable to start ssh-agent service, error :1058" How to install OpenSSL in windows 10? Anaconda Installed but Cannot Launch Navigator Conda command is not recognized on Windows 10 Copy Files from Windows to the Ubuntu Subsystem Hyper-V: Create shared folder between host and guest with internal network Why Local Users and Groups is missing in Computer Management on Windows 10 Home? VMware Workstation and Device/Credential Guard are not compatible pip not working in Python Installation in Windows 10 Copy Paste in Bash on Ubuntu on Windows

Examples related to gnu-make

How to install and use "make" in Windows? How to get current relative directory of your Makefile? How to print out a variable in makefile Makefile - missing separator How to use GNU Make on Windows? ldconfig error: is not a symbolic link How to place object files in separate subdirectory How do you get the list of targets in a makefile? Using CMake with GNU Make: How can I see the exact commands? How to call Makefile from another Makefile?