Thursday, August 18, 2011

How to fix Cygwin (make)

If you are using Eclipse on Windows, CDT and Cygwin you might see funny meaningful errors like:

make: *** target pattern contains no `%'.  Stop.    
make: *** multiple target patterns.  Stop.   

Some of them occur only after the second build, others pop up continuously.

This is most likely happening due to the fact that Cygwin make is broken with the current 3.81 release.

After wasting many hours I came to this announcement dating to 9 Jul 2006 related to make 3.81 from Christopher Faylor from Redhat on the Cygwin announce list:

Note that the --win32 command line option and "MAKE_MODE" environment
variable are no longer supported in Cygwin's make.  If you need to use a
Makefile which contains MS-DOS path names, then please use a MinGW
version of make.

Wikipedia describes Cygwin  as:

"Unix-like environment and command-line interface for Microsoft Windows."

In other this means that the make for Windows lacks Windows support.


This raises the following question:

Which user of  the Unix-like environment and command-line interface for Microsoft Windows. would ever miss the support  for MS-DOS aka Windows path names in the 2 most important development tool besides gcc?

I hope Chris is not thinking about shipping the next Redhat distro with a make that does not support Unix style path names. I mean this is fast way to increase your number of "fans" on Facebook but............

At least he is not only breaking it but also pointing in the right direction:
 
See: http://mingw.org/ for details on downloading a version of make
which understands MS-DOS path names.  Please! direct any questions about
the MinGW version of make to the appropriate MinGW mailing list.


Here you can download a version of mingw make.

I installs by default to C:\MinGW\bin\mingw32-make.exe

Then I just copied it to my cygwin\bin directory. After doing the only reasonable thing with the cygwin make, in other words deleting it, I just renamed mingw32-make.exe to make.exe and since then everything builds fine.

Update:

Robert Walker also pointed out that he offers some packages for download that contain all the necessary fixes.I tried 3.82-1 and its just works fine. Thanks!