SYNOPSIShmake [ options ] target ...
DESCRIPTIONhmake is a make(1) like command for compiling Haskell programs. Dependencies are automatically extracted from the source files; there is no need to construct or maintain a Makefile.
The target arguments determine what to compile. If target is the name of an executable (i.e. it has no extension), then one of target.hs or target.gc or target.lhs is assumed to contain the main module of a program. All modules it depends on are compiled (if necessary) and linked to an executable. If target is the name of a source module (i.e it ends in .hs or .gc or .lhs) then the object file for that module is generated.
hmake allows several programs to reside in the same directory. Modules can be shared between several programs. Modules can also reside in different directories. Directories to search for modules can be specified with the -I or -i flag, in the same way as for Haskell compilers.
hmake correctly handles the fact that Haskell compilers generate two files, an object file and an interface file, for each module compiled. It also handles GreenCard sourcefiles (.gc) transparently, and sourcefiles which contain C preprocessor directives. It calls any of the widely available Haskell compilers - nhc98, hbc, or ghc. (Note: hbc does not yet implement GreenCard.)
- No execution mode. Print commands but do not execute them.
- Quiet mode. Do not print commands before executing them.
- Output the module dependency graph on the standard output.
- Output module dependencies on stdout in the standard Makefile format.
- Like -M, but treats the -d option specially.
- This option sets the search path for object files - it also arranges for objects and the final executable to be placed in this directory by the compiler. Only one -d is allowed.
- -idir This option adds directory dir to the search path for source modules. Modules needed from that directory are compiled (and linked). If more than one -I or -i is specified, the directories are searched in order.
- This option adds directory dir to the search path for prelude/stdlib modules. Only interface files in that directory are checked - it is assumed that the modules are already compiled. If more than one -P is specified, the directories are searched in order. Modules found in these directories are not added to any linking step.
- Calculate dependencies also for Prelude modules that are explicitly imported.
- Ignore dependencies with respect to the named module.
- Use the York/Chalmers nhc98 Haskell compiler.
- Use the Chalmers hbc Haskell compiler.
- Use the Glasgow ghc Haskell compiler.
Most other flags are assumed to be compiler options and are passed to the compiler when compiling and linking. Some of these compiler flags are `noticed' by hmake as well as being passed through. One to note in particular is:
Define the preprocessor symbol. Preprocessor directives are often used to
modify module dependencies in source files.
COMPILER OPTIONSThe command line used to compile a module is
$(HC) $(HFLAGS) -c file.hs
and to link an executable
$(HC) $(HFLAGS) -o executable file.o ...
where HC is your chosen Haskell compiler (default is the compiler you built hmake with). The commands are then augmented with any compiler/linker options given when invoking hmake.
- if set, it is used as the name of the Haskell compiler. The default is the compiler you used to build hmake with.
- if set, is used as extra arguments to the Haskell compiler. The default is empty.
- if set, it is used as the location of the main program, instead of the default /usr/local/lib/hmake/$MACHINE/MkProg.
- if set, it is used as the location of the help program `Older', instead of the default /usr/local/lib/hmake/$MACHINE/Older.
- if set, it is used as the location of the directory containing interface files for the Prelude and standard libraries (for nhc98 only). The default is /usr/local/include/nhc98/.
- if set, is used as the base location of the hbc compiler.
- if set, is interpreted as a colon-separated list of directories to search for interface files for the Prelude and standard libraries (for hbc only). The default is $LMLDIR/hlib1.3/:$LMLDIR/hbc_library1.3/.
- if set, is used as the base location for ghc include files. The default is /usr/local/lib/ghc-4.02/lib/imports.
- if set, is interpreted as a colon-separated list of directories to search for interface files for the Prelude and standard libraries (for ghc only). The default is $GHCINCDIR/std:$GHCINCDIR/exts.
FILES/usr/local/lib/hmake/$(MACHINE)/MkProg the main program
/usr/local/lib/hmake/$(MACHINE)/Older help program to determine if a target is out of date.