Hello Jurian,
To do this, you'll want (at least) a recent patchset I wrote for Cabal which is
still under review:
https://github.com/haskell/cabal/pull/1080
In particular, you'll want the Main-is patch, which lets you tell Cabal
that a particular c file contains a main() function.
Cheers,
Edward