The hmake compilation management toolHmake is an intelligent compilation management tool for Haskell programs. It automatically extracts dependencies between source modules, and issues the appropriate compiler commands to rebuild only those that have changed, given just the name of the program or module that you want to build. Yes, you need never write a Makefile again! A particular benefit is that hmake knows about interface (.hi) files. Even though a source module has changed, if its interface file has not changed, then other modules which import it do not need to be recompiled. Hmake is compiler-independent. The installation process automatically detects which Haskell compilers you have, and sets up hmake to use any of them. You can separately add or remove compilers to the configuration at any time after installation, and change which compiler is used as the default. You can easily switch between different versions of a compiler (e.g. ghc 4.08 + 5.02). See hmake-config. Hmake is aware of pre-processors. Not only is the C preprocessor commonly used for selective imports, but tools such as happy, hsc2hs, c2hs, greencard, are also often used to generate Haskell modules. If hmake finds a module with the appropriate filename extension (.y, .ly, .hsc, .chs, .gc), it automatically runs the preprocessor before the compiler. UsageThe basic option summary is: Usage: hmake [-f cfgfile] [compiler] [hmake-opts] [compiler-opts] target ...You can have more than one target: all of them are built. A target can be a module (with .lhs, .hs, .hi, or pre-processor extension), in which case the module and everything it depends on is compiled, but not linked. Alternatively, a target can be a program name (no .hs extension), in which case the appropriate modules are linked as well as compiled. An object or archive filename (.o, .a extension) cannot be a target, but if you add it to the commandline, it will be added into the final link. Most options are passed straight through to the appropriate compiler. However, hmake understands and strips the following options.
Hmake also makes use of some compiler options if you specify them. (That is, the options are used by hmake as well as being passed on to the compiler.)
Some options are passed to the compiler's runtime system (using whatever underlying mechanism is appropriate for the particular compiler).
You can force an option which would otherwise be interpreted by another part of the system to be passed to the compiler by enclosing it within +CTS ... -CTS delimiters. For example, with nhc98, to set the final executable's default heapsize rather than the compiler's heapsize, use +CTS -H4mb -CTS. Miscellaneous FeaturesSome improvements over previous compilation management tools are:
I'd welcome any bug reports, or ideas for other options or behaviours you would find useful. The latest updates to this software are available on the WWW from http://www.cs.york.ac.uk/fp/hmake/
Information last updated: 2002-01-23 |