views:

38

answers:

2

Is it possible to have a GNU makefile with a target/dependent containing a win32 path name? I'm currently using the win32 3.81 version of GNU make, and it seems to have difficulties with drive letters. For example:

C:\MyTarget.obj : c:\MySource.cpp
    cl /c C:\MySource.cpp

The above makefile snippet will generate errors. In particular, the folliwng:

*** multiple target patterns.  Stop.

Is there a solution to this problem?

Thanks!

+1  A: 

No. The "\" is interpreted as escaping the end of the line. Besides, you should NEVER use an absolute path name in your Makefile, as it makes it specific to your machine. Why not use a relative POSIX path?

Michael Aaron Safyan
+2  A: 

It's a little offtopic, but you should probably use CMake instead of gnumake directly to build projects on Windows.

stepancheg
Not off topic at all. +1 for suggesting CMake.
Michael Aaron Safyan