-OCAMLC = $(OCAMLFIND) ocamlc $(COMMON_OPTS) -thread
-OCAMLOPT = $(OCAMLFIND) ocamlopt $(COMMON_OPTS) -thread
-OCAMLDEP = $(OCAMLFIND) ocamldep $(COMMON_OPTS)
-OCAMLDOC = ocamldoc
+OCAMLC = $(OCAMLFIND) ocamlc $(COMMON_FLAGS)
+OCAMLOPT = $(OCAMLFIND) ocamlopt $(COMMON_FLAGS)
+OCAMLDEP = $(OCAMLFIND) ocamldep $(COMMON_FLAGS)
+OCAMLDOC := \
+ ocamldoc -stars \
+ $(shell $(OCAMLFIND) query -i-format unix) \
+ $(shell $(OCAMLFIND) query -i-format pcre) \
+ $(shell $(OCAMLFIND) query -i-format netstring)
+DOT = dot