-OCAMLC = ocamlfind ocamlc $(COMMONOPTS)
-OCAMLOPT = ocamlfind ocamlopt $(COMMONOPTS)
-OCAMLDEP = ocamlfind ocamldep $(COMMONOPTS)
+OCAMLFIND = ocamlfind
+OCAMLC = $(OCAMLFIND) ocamlc -thread $(COMMONOPTS)
+OCAMLOPT = $(OCAMLFIND) ocamlopt -thread $(COMMONOPTS)
+OCAMLDEP = $(OCAMLFIND) ocamldep $(COMMONOPTS)
+OCAMLDOC = \
+ ocamldoc \
+ $(shell $(OCAMLFIND) query -i-format http) \
+ $(shell $(OCAMLFIND) query -i-format dbm) \
+ $(shell $(OCAMLFIND) query -i-format pcre) \
+ $(shell $(OCAMLFIND) query -i-format pxp) \
+ $(shell $(OCAMLFIND) query -i-format shell) \
+ $(shell $(OCAMLFIND) query -i-format threads) \
+ $(shell $(OCAMLFIND) query -i-format zip)