-doc: *.mli
- $(OCAMLDOC) -html -d doc/html \
- *.mli $(patsubst %, %.ml, $(PUBLIC_IMPL))
+doc: $(DOTDIR)/ocaml-http.ps $(TEXDIR)/ocaml-http.tex $(OCAMLDOC_STUFF)
+ $(OCAMLDOC) -html -d $(DOCDIR) $(OCAMLDOC_STUFF)
+$(TEXDIR)/ocaml-http.tex: $(OCAMLDOC_STUFF)
+ $(OCAMLDOC) -latex -o $@ $^
+$(DOTDIR)/ocaml-http.ps: $(DOTDIR)/ocaml-http.dot
+ $(DOT) -Tps $< > $@
+$(DOTDIR)/ocaml-http.dot: *.ml *.mli
+ $(OCAMLDOC) -dot -o $(DOTDIR)/ocaml-http.dot *.ml *.mli