diff options
Diffstat (limited to 'ghc/docs/users_guide/utils.lit')
-rw-r--r-- | ghc/docs/users_guide/utils.lit | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/ghc/docs/users_guide/utils.lit b/ghc/docs/users_guide/utils.lit index d007621521..6ec326e6f9 100644 --- a/ghc/docs/users_guide/utils.lit +++ b/ghc/docs/users_guide/utils.lit @@ -27,7 +27,9 @@ HCFLAGS = -fhaskell-1.3 -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. @@ -64,6 +74,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}} |