cabalizing "legacy' source

Hello, I have cabalizing some "legacy" Haskell source. By "legacy", I totally don't mean in a pejorative sense ... code has been designed and written well. I am making good progress ... I have succeeded in building an archive file(library) on a POSIX platform, i.e. Linux. The original author intended to build several executables from this .a file. In addition there are many pairings of .hs/.lhs along with "main" test files. Currently I have only one .cabal file. This is inadequate for the author's intent: 1) I need to build "n" test executables. 2) I need to build 1/2 CLI executables. I need advice on the cabal front. E.g. should I first run the library .cabal and then run several subsidary .cabal files, e.g. "n"test .cabals and also 1/2 CLI executable .cabals??? I am looking for advice so that I don't have a clumsy cabal build process/tree! Thanks, Vasili

BTW there is no "Test" directory and also no "CLI" directory .... I am
pretty familiar with cabal but not as much with "Unix" Makefile. Probably I
need to restructure source directory tree ... to have "library" source in
one subtree, tests in another CLI executables in a third BUT can I set up
cabal files to do recursive directory "visits" like Makefiles?
Vasili
On Wed, Jun 3, 2009 at 11:58 PM, Vasili I. Galchin
Hello,
I have cabalizing some "legacy" Haskell source. By "legacy", I totally don't mean in a pejorative sense ... code has been designed and written well. I am making good progress ... I have succeeded in building an archive file(library) on a POSIX platform, i.e. Linux. The original author intended to build several executables from this .a file. In addition there are many pairings of .hs/.lhs along with "main" test files. Currently I have only one .cabal file. This is inadequate for the author's intent:
1) I need to build "n" test executables.
2) I need to build 1/2 CLI executables.
I need advice on the cabal front. E.g. should I first run the library .cabal and then run several subsidary .cabal files, e.g. "n"test .cabals and also 1/2 CLI executable .cabals??? I am looking for advice so that I don't have a clumsy cabal build process/tree!
Thanks, Vasili

Vasili I. Galchin wrote:
Hello,
I have cabalizing some "legacy" Haskell source. By "legacy", I totally don't mean in a pejorative sense ... code has been designed and written well. I am making good progress ... I have succeeded in building an archive file(library) on a POSIX platform, i.e. Linux. The original author intended to build several executables from this .a file. In addition there are many pairings of .hs/.lhs along with "main" test files. Currently I have only one .cabal file. This is inadequate for the author's intent:
1) I need to build "n" test executables.
2) I need to build 1/2 CLI executables.
I need advice on the cabal front. E.g. should I first run the library .cabal and then run several subsidary .cabal files, e.g. "n"test .cabals and also 1/2 CLI executable .cabals??? I am looking for advice so that I don't have a clumsy cabal build process/tree!
You can build several executables from one cabal file. I propose to enable compilation of test programs only by user request. See for example: http://code.haskell.org/~thielema/tagchup/tagchup.cabal
participants (2)
-
Henning Thielemann
-
Vasili I. Galchin