« Previous | Next » 

Revision d16e3ce4

IDd16e3ce40db7e046023373d25f1444614f74b721
Parent dfcebee3
Child 3ff2cf55

Added by Jose A. Lopes over 10 years ago

Optimize Haskell compilation

The idea is to compile (on demand, that is, when necessary) each
source file to a normal object file, a coverage object file, a
profiling object file, and a test object file. Also, a given Haskell
binary is linked with the proper object files. This is achieved with
the following Makefile variables:

Compilation modes (profiles):
1. HPROFILE enables/disables profiling
2. HCOVERAGE enables/disables coverage
3. HTEST enables/disables 'TEST' preprocessor definition

A few words on testing: testing means the problem described in issue
535: https://code.google.com/p/ganeti/issues/detail?id=535. With
HTEST enable, ghc will be instructed to define the preprocessor
definition TEST, for modules that use '#ifdef TEST'.

Haskell binary targets fetch the proper dependencies. They are also
'.PHONY' targets so that 'make' does not check for the file timestamp
and instead it will always call 'ghc --make ...'. This is not a
problem because 'ghc' with the '--make' flag only compiles the
necessary object files.

Signed-off-by: Jose A. Lopes <>
Reviewed-by: Michele Tartara <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences