Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use GNU Make on Windows?

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.

like image 488
yak Avatar asked Oct 14 '12 11:10

yak


People also ask

Does GNU make work on Windows?

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.

How do I run a makefile in Windows?

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.

How do I install gnuwin32 on Windows 10?

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 .

How do you use make command?

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.


2 Answers

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!

like image 136
user1594322 Avatar answered Oct 05 '22 14:10

user1594322


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.

like image 24
Colin 't Hart Avatar answered Oct 05 '22 13:10

Colin 't Hart