[project @ 1996-07-25 20:43:49 by partain]
[ghc-hetmet.git] / ghc / docs / users_guide / utils.lit
index d007621..94516bf 100644 (file)
@@ -22,12 +22,14 @@ GHC, assuming you name your source files the same as your modules.
 Thus:
 \begin{verbatim}
 HC      = ghc
-HCFLAGS = -fhaskell-1.3 -cpp -hi-diffs $(EXTRA_HC_OPTS)
+HCFLAGS = -recomp -cpp -hi-diffs $(EXTRA_HC_OPTS)
 
 SRCS = Main.lhs Foo.lhs Bar.lhs
 OBJS = Main.o   Foo.o   Bar.o
 
-.SUFFIXES : .o .lhs
+.SUFFIXES : .o .hi .lhs
+.o.hi:
+       @:
 .lhs.o:
         $(RM) $@
         $(HC) -c $< $(HCFLAGS)
@@ -37,6 +39,14 @@ cool_pgm : $(OBJS)
         $(HC) -o $@ $(HCFLAGS) $(OBJS)
 \end{verbatim}
 
+Note the cheesy \tr{.o.hi} rule: It records the dependency of the
+interface (\tr{.hi}) file on the source.  The rule says a \tr{.hi}
+file can be made from a \tr{.o} file by doing... nothing.  Which is
+true.
+
+(Sophisticated \tr{make} variants may achieve some of the above more
+elegantly.  What we've shown should work with any \tr{make}.)
+
 The only thing lacking in the above \tr{Makefile} is interface-file
 dependencies.  If \tr{Foo.lhs} imports module \tr{Bar} and the
 \tr{Bar} interface changes, then \tr{Foo.lhs} needs to be recompiled.
@@ -55,6 +65,11 @@ Now, before you start compiling, and any time you change the
 \tr{make cool_pgm}.  \tr{mkdependHS} will append the needed
 dependencies to your \tr{Makefile}.
 
+Please note the use of the recompilation checker (the \tr{-recomp}
+\index{-recomp option} flag).  Without it, your dependencies will be
+{\em inadequate} to cope with the Haskell~1.3 module system!  See
+\sectionref{recomp} for more details about the recompilation checker!
+
 A few caveats about this simple scheme: (a)~You may need to compile
 some modules explicitly to create their interfaces in the first place
 (e.g., \tr{make Bar.o} to create \tr{Bar.hi}).  (b)~You may have to
@@ -64,6 +79,9 @@ effect.  However, a \tr{make} run that does nothing {\em does} mean
 mutually-recursive modules but, again, it may take multiple
 iterations to ``settle.''
 
+To see \tr{mkdependHS}'s command-line flags, give it a duff flag,
+e.g., \tr{mkdependHS -help}.
+
 %************************************************************************
 %*                                                                      *
 \subsection[hstags]{Emacs `TAGS' for Haskell: \tr{hstags}}
@@ -72,6 +90,8 @@ iterations to ``settle.''
 %*                                                                      *
 %************************************************************************
 
+NB: \tr{hstags} is temporarily dead at version~2.01.  Sigh.
+
 `Tags' is a facility for indexing the definitions of
 programming-language things in a multi-file program, and then using
 that index to jump around among these definitions.
@@ -120,7 +140,7 @@ Andy Gill and Simon Marlow have written a parser-generator for
 Haskell, called \tr{happy}.\index{happy parser generator} \tr{Happy}
 is to Haskell what \tr{Yacc} is to C.
 
-You can get \tr{happy} by FTP from \tr{ftp.dcs.glasgow.ac.uk} in
+You can get \tr{happy} by FTP from \tr{ftp.dcs.gla.ac.uk} in
 \tr{pub/haskell/happy}, the file \tr{happy-0.8.tar.gz}.
 
 \tr{Happy} is at its shining best when compiled by GHC.