34

Can anyone help me to run Makefile in Windows using the make command? When I try to run from git bash I'm getting the following error:

$ make build
bash: make: command not found

$ make deploy
bash: make: command not found

Is there anyway to install this in gitbash or something or is there any other Windows tool I need to use?

1
  • Did you try to specify the path to make explicitly? Commented Mar 8, 2021 at 8:40

7 Answers 7

43

You can also use chocolatey to install it:

choco install make

Here's the package.

Sign up to request clarification or add additional context in comments.

2 Comments

bash: choco: command not found
you need to install chocolatey first
21

Sounds like Make isn't in your git-bash's path.

A quick search shows this guide, which suggests the following steps:

  • Go to ezwinports.
  • Download make-4.1-2-without-guile-w32-bin.zip (get the version without guile).
  • Extract zip.
  • Copy the contents to your Git\mingw64\ merging the folders, but do NOT overwrite/replace any existing files.

The guide is several years old. It may behoove you to read some of the comments before taking action.

3 Comments

it perfectly works, as of november 2022 its with make-4.4 thanks so much
The make-4.1-2-without-guile-w32-bin.zip is not being downloded. May be it expired. What to do?
You can try getting the most recent version from ezwinports' SourceForge. I don't know if this solution still works in 4.4.1.
1

Download https://github.com/mbuilov/gnumake-windows/blob/master/gnumake-4.4.1.exe.

In Git Bash shell:

cp "$HOME/Downloads/gnumake-4.4.1.exe" /usr/bin/make.exe

Alternatively, you can launch Command Line (as an Admin):

COPY /Y "%USERPROFILE%\Downloads\gnumake-4.4.1.exe" "%ProgramFiles%\Git\usr\bin\make.exe"

Comments

1

Expanding on Axel's response: placing non-Git managed binaries in %ProgramFiles%\Git\usr\bin is not recommended, since updates to Git for Windows may overwrite them.

Instead, download the 32-bit make.exe binary from:

https://github.com/mbuilov/gnumake-windows/blob/master/gnumake-4.4.1.exe

Git Bash will automatically try to resolve binaries in ~/bin:

mkdir -p ~/bin
cp ~/Downloads/gnumake-4.4.1.exe ~/bin/make.exe

This way, your make binary remains intact across Git Bash updates.

Comments

0

If it's installed then check your PATH environment variable and fix it to point to make's folder. If it's not installed you can install it using this built-in command in Windows

winget install --id=GnuWin32.Make  -e

See also How to install and use "make" in Windows?

Comments

0

After trying various other methods which did not work well (environment variables were missing so Go didn’t work because it tried to create a temporary directory in C:\Windows), I prefer to use Cygwin. It is easy to use, provides a package manager and works fine in Git Bash without hacks like winpty.

  • Download and run the setup
  • When the package list is shown, select Full in the View menu
  • Search for make, select the desired version and proceed with the setup
  • Add the bin\ subdirectory of the Cygwin installation path to the PATH variable in your Windows settings

To add or update packages, just run the setup again and select the desired package versions.

Comments

-1

Do the following steps

  1. Install MinGW (https://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download)

  2. Run the following command in git bash

    mingw-get install mingw32-make
    

1 Comment

Be happy with what you have! Purpose of my life :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.