X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fdocs%2Fusers_guide%2Futils.lit;fp=ghc%2Fdocs%2Fusers_guide%2Futils.lit;h=6ec326e6f9ff5f9af7307653d57911bcfc25cf50;hb=a7e6cdbfc4f27c2e0ab9c12ebe6431c246c74c6d;hp=d007621521d41b4ff303816058af0c11c1d46189;hpb=26741ec416bae2c502ef00a2ba0e79050a32cb67;p=ghc-hetmet.git diff --git a/ghc/docs/users_guide/utils.lit b/ghc/docs/users_guide/utils.lit index d007621..6ec326e 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}}