2007-11-19

GHC Rules for SCons

Get them from my Subversion repository.

I don't claim to be a SCons or GHC master, but these are working well enough for me, and might prove useful to somebody else.

To use them, you need to add the appropriate things to your tools and toolpath, eg.

    tools = [ 'default', 'ghc' ],
    toolpath = [ 'SConsHs' ],

You probably also want to replace the linker with GHC, eg.

    LINK = '$_GHCCOM'

You can add flags to be passed to GHC to HSFLAGS:

    HSFLAGS = [ '-O2' ],

There's also HSCFLAGS, HSAFLAGS and HSLFLAGS for passing options to the native compiler, assembler, and linker. HSPATH is the GHC equivalent of CPPPATH.

Once you've done all that, you can just add .hs files to your list of source files.

The tool tries to generate correct dependencies for auto-generated FFI files.

0 comments: