Building Programs Again

Simon Marlow simonmar@microsoft.com
Mon, 28 May 2001 14:46:56 +0100


> I am going to install hmake and upgrade to ghc 5 but in the=20
> meantime I decided to use make.
>=20
> I am puzzled however. Presumably building a module that=20
> imports a module needs the .hi file and therefore the=20
> makefile should be something like this:
>=20
> Tagsv1.o : Tagsv1.hs
> 	ghc -c Tagsv1.hs -package lang
>=20
> Basev1.o : Tagsv1.hi Basev1.hs
> 	ghc -c Basev1.hs -package lang
>=20
> But if I do this then make complains if I want to see what it=20
> will generate
>=20
> [dom@lhrtba8fd85 maketest]$ make -n
> ghc -c Tagsv1.hs -package lang
> make: *** No rule to make target `Tagsv1.hi', needed by=20
> `Basev1.o'.  Stop.    =20
>=20
> Running make works as by the time the rule gets executed the=20
> .hi file exists.
>=20
> Can anyone suggest something better?

GHC's documentation has some useful tips on using make with Haskell:

=09
http://www.haskell.org/ghc/docs/latest/set/separate-compilation.html#USI
NG-MAKE

Chees,
	Simon