From: Claudio Sacerdoti Coen Date: Mon, 3 Dec 2001 16:25:10 +0000 (+0000) Subject: Makefile improved: dependencies from libraries are now considered. X-Git-Tag: mlminidom_0_2_2~32 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=d74100223c35a23b29d0bb5e547d8954c41ec541;p=helm.git Makefile improved: dependencies from libraries are now considered. --- diff --git a/helm/ocaml/Makefile.common.in b/helm/ocaml/Makefile.common.in index a04d1a65e..c871b5e12 100644 --- a/helm/ocaml/Makefile.common.in +++ b/helm/ocaml/Makefile.common.in @@ -14,30 +14,34 @@ OCAMLC = ocamlfind ocamlc $(OCAMLOPTIONS) OCAMLOPT = ocamlfind ocamlopt $(OCAMLOPTIONS) OCAMLDEP = ocamldep +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)) + + ARCHIVE = $(PACKAGE).cma ARCHIVE_OPT = $(PACKAGE).cmxa OBJECTS_TO_INSTALL = $(ARCHIVE) $(ARCHIVE_OPT) $(ARCHIVE_OPT:%.cmxa=%.a) \ $(INTERFACE_FILES) $(INTERFACE_FILES:%.mli=%.cmi) \ $(EXTRA_OBJECTS_TO_INSTALL) -$(ARCHIVE): $(IMPLEMENTATION_FILES:%.ml=%.cmo) - $(OCAMLC) -a -o $@ $^ +$(ARCHIVE): $(IMPLEMENTATION_FILES:%.ml=%.cmo) $(LIBRARIES) + $(OCAMLC) -a -o $@ $(IMPLEMENTATION_FILES:%.ml=%.cmo) -$(ARCHIVE_OPT): $(IMPLEMENTATION_FILES:%.ml=%.cmx) - $(OCAMLOPT) -a -o $@ $^ +$(ARCHIVE_OPT): $(IMPLEMENTATION_FILES:%.ml=%.cmx) $(LIBRARIES_OPT) + $(OCAMLOPT) -a -o $@ $(IMPLEMENTATION_FILES:%.ml=%.cmx) -all: $(ARCHIVE) -opt: $(ARCHIVE_OPT) +all: $(IMPLEMENTATION_FILES:%.ml=%.cmo) $(ARCHIVE) +opt: $(IMPLEMENTATION_FILES:%.ml=%.cmx) $(ARCHIVE_OPT) depend: $(OCAMLDEP) $(INTERFACE_FILES) $(IMPLEMENTATION_FILES) > .depend .SUFFIXES: .ml .mli .cmo .cmi .cmx -.ml.cmo: +.ml.cmo: $(LIBRARIES) $(OCAMLC) -c $< -.mli.cmi: +.mli.cmi: $(LIBRARIES) $(OCAMLC) -c $< -.ml.cmx: +.ml.cmx: $(LIBRARIES_OPT) $(OCAMLOPT) -c $< clean: