Search code examples
haskelldependenciescabalhaskell-platform

Making one executable depend on another in Haskell cabal


How do I make one executable in a cabal file depend on another in the same project?

I have a cabal file that builds two executables. One of the executables is a code generator that produces a Haskell source code file that the second executable depends on. How do I tell cabal to compile and run the first one before the second?


Solution

  • They need to be separate projects - two .cabal files.

    See e.g the gtk2hs preprocessor - http://hackage.haskell.org/package/gtk2hs-buildtools