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
.
Using Chocolatey Since Make is not directly available in Windows, we need to install the package manager first. Then, we will use this package manager to install the make tool.
First step: download mingw32-make.exe from mingw installer, or please check mingw/bin folder first whether mingw32-make.exe exists or not, else than install it, rename it to make.exe . After renaming it to make.exe , just go and run this command in the directory where makefile is located.
There are two ways to install: by a setup program and by zip files. From the package list, you can download a package by means of a setup program. Just follow the instructions. You may install more than one package in the same directory, e.g. E:\Program Files\GnuWin .
To prepare to use make, you must write a file called the makefile that describes the relationships among files in your program, and the states the commands for updating each file. In a program, typically the executable file is updated from object files, which are in turn made by compiling source files.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With