[Haskell-cafe] Still having problems building a very simple
bertram.felgenhauer at googlemail.com
Sat Jun 6 21:43:10 EDT 2009
Vasili I. Galchin wrote:
> I picked an exceedingly case to build an "Executable":
> Executable QNameTest
> Hs-source-dirs: Swish/
> Main-Is: HaskellUtils/QNameTest.hs
> Other-Modules: HaskellUtils.QName
I'm not sure what you did; the original Swish code doesn't have any
hierarchical modules. Starting with that, I could build QNameTest like
hs-source-dirs: HaskellUtils HaskellRDF HaskellRDF/HUnit
other-modules: HUnitLang HUnitBase HUnitText QName QNameTest
build-depends: base, haskell98
ghc-options: -main-is QNameTest
The trick here is to list all used subdirectories in hs-source-dirs;
the module HUnit for example will be found in HaskellRDF/HUnit/ under
the name HUnit.lhs.
If you have a module A.B.C then the source file should be in
foo/A/B/C.hs (or lhs or some other recognized extension)
and foo should be listed in hs-source-dirs.
Also note the ghc-options line: it tells ghc to use QNameTest instead of
Main for the main module.
I also managed to produce a Swish executable after a bit of tweaking;
you can find my changes in
The cabal file is at the end of the diff.
P.S. I took Swish code from here:
More information about the Haskell-Cafe