-LIBRARIES = $(shell ocamlfind query -recursive -predicates "byte $(PREDICATES)" -format "%d/%a" $(REQUIRES))
-LIBRARIES_OPT = $(shell ocamlfind query -recursive -predicates "native $(PREDICATES)" -format "%d/%a" $(REQUIRES))
+LIBRARIES = $(shell $(OCAMLFIND) query -recursive -predicates "byte $(PREDICATES)" -format "%d/%a" $(REQUIRES))
+LIBRARIES_OPT = $(shell $(OCAMLFIND) query -recursive -predicates "native $(PREDICATES)" -format "%d/%a" $(REQUIRES))
+LIBRARIES_DEPS = \
+ $(foreach X,$(filter-out /usr/lib/ocaml%,$(LIBRARIES)),\
+ $(wildcard \
+ $(shell dirname $(X))/*.mli \
+ $(shell dirname $(X))/*.ml \
+ $(shell dirname $(X))/paramodulation/*.ml \
+ $(shell dirname $(X))/paramodultation/*.mli))