Nhcmake - a tool for automated compilation of Haskell programs
Nhcmake is a tool similar to the standard Unix Make tool, but tailor
made for compiling Haskell programs. It has at least two advantages over
the standard Make tool:
* Nhcmake automatically extract dependencies from the source files.
This removes the need to construct and maintain Makefiles of the kind
used by the ordinary Make tool, and it makes it easy to compile large
programs distributed over several directories or to keep several
smaller programs, possibly sharing some modules, in the same
directory.
* Nhc differs from the compilers taken into account when the standard Make
tool was designed in that it generates two files for each module compiled:
an object file and and interface file. The object file is updated each time
the module is compiled. The interface file is updated only when the
interface information changes, in which case it will be necessary to
recompile other modules that import from this module. This behaviour is
tricky to express in the Makefiles used by Make, but is handled correctly by
Nhcmake.
Nhcmake is implemented as a Haskell program and a shell script (obey file
on RISC OS). The haskell program extracts the dependencies from the source
files and generates the appropriate list of compilation commands in the
appropriate order. The shell script (obey file) parses command line
arguments, invokes the Haskell program and finally executes the commands
generated by the Haskell program.
|