[Mono-dev] Running mcs from MSys make?

Chris Seaton chris at chrisseaton.com
Thu Sep 15 23:47:45 EDT 2005

Is it possible to run mcs from the make that comes with MSys? I can't 
get it to work.

I have a Makefile that I've been using so far on Linux. I copied it into 
my Windows installation but it doesn't work.

The Makefile command is a simple call to mcs.

Make tries to run the mcs bash script file, but fails. I alpologise for 
having to mask my file names, but that shouldn't make any difference.

mcs -warn:4 -debug -optimize+ -target:library -out:foo.dll x.cs y.cs z.cs
/c/Program Files/Mono- /c/Documents and Settings/Chris 
Seaton/My Documents/ foo /C:/PROGRA~1/MONO-1~1.3/bin/mono: No such file 
or directory
/c/Program Files/Mono- exec: /c/Documents and 
Settings/Chris Seaton/My Documents/foo/C:/PROGRA~1/MONO-1~1.3/bin/mono: 
cannot execute: No such file or directory

So what's going on here? Why is my current directory being prepended to 
the command line?

I tried replacing my call to mcs with mcs.bat, forcing make to run the 
batch file which I presume is Windows specific, but make ran the batch 
file with bash! Obviously bash couldn't manage this.

mcs.bat -warn:4 -debug -optimize+ -target:library -out:foo.dll x.cs y.cs 
/c/Program Files/Mono- @ECHO: command not found
/c/Program Files/Mono- SETLOCAL: command not found
/c/Program Files/Mono- SET: command not found
/c/Program Files/Mono- fg: no job control
/c/Program Files/Mono- SET: command not found
/c/Program Files/Mono- SET: command not found
/c/Program Files/Mono- 
C:\PROGRA~1\MONO-1~1.3\lib\mono.exe: command not found
/c/Program Files/Mono- ENDLOCAL: command not found
make: *** [foo.dll] Error 127

I got desperate at this point and replaced my call to mcs.bat with a 
call to my own batch file that just contained

cmd /c "mcs %*"

That just reproduced the first errors. I can't believe that bash is 
going so far as to intercept my calls to cmd - surely something else is 
wrong here?

How do I persuade make to run my commands using the bog standard Windows 
command interpreter?

Thanks for reading this, I appreciate any help that anyone can give.

Chris Seaton

More information about the Mono-devel-list mailing list