Project options for GHC

Claus Reinke claus.reinke at
Mon Dec 12 15:18:23 EST 2005

fwiw: I have not yet used .ghci files - even though I try to use
"ghc --make" instead of full-blown makefiles, I tend to write
mini-makefiles that set up paths, options, etc, before calling
"ghc --make" to do the real work (well sometimes, there's some
non-Haskell work to be done first). And if you now recall that
ghci is "ghci --interactive", you'll guess where this is headed.

If I want to use ghci on such projects, the relevant part of the
makefile looks somewhat like this:

    MODE ?= --make
    .. : ..
    <TAB>ghc ${MODE} ... 

which allows me to use the same makefile either for ghc or 
ghci. In particular, I can use --make first to make a large project, 
then switch to using --interactive, benefitting from the 
combination of both.


----- Original Message ----- 
From: "Iavor Diatchki" <iavor.diatchki at>
To: "GHC Users ML" <glasgow-haskell-users at>
Sent: Monday, December 12, 2005 7:39 PM
Subject: Project options for GHC

I have been using the .ghci file with GHCi to set global options for
my project and I find it very useful.  The kind of options I put there
are: where to put .hi/.o files, what warnings to produce, where to
look for code. etc.  It works great.  I was thinking that it would be
very convenient to have the same ability when using 'ghc --make',
because at the moment I have a number of the same options duplicated
in my Makefile.  Also, often I find myslef wanting to compile just one
file (and all of its dependents), because GHCi tends to be a bit slow
at compiling things, but is quite fast at loading object code.  I can
do this using 'ghc --make', but I also need to specify all the
additional project options.  I realize that I can achieve what I want
with a little shell script, but a ghc-supported configuration file
would be more portable and simpler to use.
Glasgow-haskell-users mailing list
Glasgow-haskell-users at

More information about the Glasgow-haskell-users mailing list