Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compiling C Source with Makefile in Windows

I'm trying to compile a downloaded program in Windows. The program is usually run in Linux, but is programmed to also run in Windows (the code has #if defined(_WIN32)'s in it, and claims to work with borland free tools). When I try to use make from the command line, it tells me "Incorrect command line argument: -C". In the makefile, there are many lines that say "make -C" followed by a directory name. Does this syntax not work in Windows? What is a correct way to do this? Is there any way to compile this for native use in Windows with this makefile?

like image 965
humoeba Avatar asked Jun 17 '10 06:06

humoeba


2 Answers

Windows itself doesn't come with a make utility. Microsoft does have a 'make' utility that comes with their development tools (such as Visual Studio, the Platform SDK, or the Windows Driver Kit) but it's called nmake.

You probably need GNU make to process those makefiles. you can get a copy for Windows here:

  • http://unxutils.sourceforge.net/

However, if the makefile isn't written to be able to be run on Windows, it'll probably not work well. You'll also need to make sure you have whatever other development tools the makefile calls upon (maybe the Borland compiler or GCC), and there may be other configuration that needs to be done specific to the project you want to build. It's probably not a matter of just having the correct make utility.

like image 188
Michael Burr Avatar answered Oct 27 '22 03:10

Michael Burr


-C is "change working directory" only for the gmake command (from the GNU package). You should take a look in the manual for your Make-Utility and see, wheather it supports something äquivalent.

Peter

like image 41
Peter Miehle Avatar answered Oct 27 '22 04:10

Peter Miehle