I installed MinGW and MSYS, added C:\MinGW\bin to PATH but I still can't run Makefile on Windows' cmd. I would like to run cmd.exe and there type, for example, make all but my cmd says that there is no such command.
What should I do? I don't want to use MSYS shell, that's not the point. Any ideas how to use GNU Make in Windows cmd as I can do it in Ubuntu? I'm not interested in Cygwin.
Here's how I got it to work:
copy c:\MinGW\bin\mingw32-make.exe c:\MinGW\bin\make.exe
Then I am able to open a command prompt and type make:
C:\Users\Dell>make
make: *** No targets specified and no makefile found. Stop.
Which means it's working now!
I'm using GNU Make from the GnuWin32 project, see http://gnuwin32.sourceforge.net/ but there haven't been any updates for a while now, so I'm not sure on this project's status.
Although this question is old, it is still asked by many who use MSYS2.
I started to use it this year to replace CygWin, and I'm getting pretty satisfied.
To install make, open the MSYS2 shell and type the following commands:
# Update the package database and core system packages
pacman -Syu
# Close shell and open again if needed
# Update again
pacman -Su
# Install make
pacman -S make
# Test it (show version)
make -v
You can add the application folder to your path from a command prompt using:
setx PATH "%PATH%;c:\MinGW\bin"
Note that you will probably need to open a new command window for the modified path setting to go into effect.
As an alternative, if you just want to install make, you can use the chocolatey package manager to install gnu make by using
choco install make -y
This deals with any path issues that you might have.
user1594322 gave a correct answer but when I tried it I ran into admin/permission problems. I was able to copy 'mingw32-make.exe' and paste it, over-ruling/by-passing admin issues and then editing the copy to 'make.exe'. On VirtualBox in a Win7 guest.
来源:https://stackoverflow.com/questions/12881854/how-to-use-gnu-make-on-windows