F#, Linux and makefiles

Posted by rwallace on Stack Overflow See other posts from Stack Overflow or by rwallace
Published on 2010-05-30T16:21:07Z Indexed on 2010/05/30 18:22 UTC
Read the original article Hit count: 332

Filed under:
|
|
|

I intend to distribute an F# program as both binary and source so the user has the option of recompiling it if desired. On Windows, I understand how to do this: provide .fsproj and .sln files, which both Visual Studio and MSBuild can understand.

On Linux, the traditional solution for C programs is a makefile. This depends on gcc being directly available, which it always is.

The F# compiler can be installed on Linux and works under Mono, so that's fine so far. However, as far as I can tell, it doesn't create a scenario where fsc runs the compiler, instead the command is mono ...path.../fsc.exe. This is also fine, except I don't know what the path is going to be. So the full command to run the compiler in my case could be mono ~/FSharp-2.0.0.0/bin/fsc.exe types.fs tptp.fs main.fs -r FSharp.PowerPack.dll except that I'm not sure where fsc.exe will actually be located on the user's machine.

Is there a way to find that out within a makefile, or would it be better to fall back on just explaining the above in the documentation and relying on the user to modify the command according to his setup?

© Stack Overflow or respective owner

Related posts about linux

Related posts about F#