OCAMLOPTIONS = -package "$(REQUIRES)" -predicates "$(PREDICATES)" -pp camlp4o
OCAMLC = ocamlfind ocamlc $(OCAMLOPTIONS)
OCAMLOPT = ocamlfind ocamlopt $(OCAMLOPTIONS)
-OCAMLDEP = ocamldep
+OCAMLDEP = ocamldep -pp camlp4o
OCAMLLEX = ocamllex
OCAMLYACC = ocamlyacc
depend: $(DEPEND_FILES)
$(OCAMLDEP) $(INTERFACE_FILES) $(IMPLEMENTATION_FILES) > .depend
+$(PACKAGE).ps: .dep.dot
+ dot -Tps -o $@ $<
+
+.dep.dot: .depend
+ ocamldot < .depend > $@
+
.SUFFIXES: .ml .mli .cmo .cmi .cmx .mll .mly
-.ml.cmo: $(LIBRARIES)
+.ml.cmo:
$(OCAMLC) -c $<
-.mli.cmi: $(LIBRARIES)
+.mli.cmi:
$(OCAMLC) -c $<
-.ml.cmx: $(LIBRARIES_OPT)
+.ml.cmx:
$(OCAMLOPT) -c $<
.mly.ml:
$(OCAMLYACC) $<
.mll.ml:
$(OCAMLLEX) $<
+$(IMPLEMENTATION_FILES:%.ml=%.cmo): $(LIBRARIES)
+$(IMPLEMENTATION_FILES:%.ml=%.cmx): $(LIBRARIES_OPT)
+
clean:
rm -f *.cm[ioax] *.cmxa *.o *.a $(EXTRA_OBJECTS_TO_CLEAN)
.PHONY: all opt depend install uninstall clean
-include .depend
+ifneq ($(MAKECMDGOALS), depend)
+ include .depend
+endif