]> matita.cs.unibo.it Git - helm.git/commitdiff
Makefile improved: dependencies from libraries are now considered.
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Mon, 3 Dec 2001 16:25:10 +0000 (16:25 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Mon, 3 Dec 2001 16:25:10 +0000 (16:25 +0000)
helm/ocaml/Makefile.common.in

index a04d1a65eb6cb30248fc81860736f199f6878781..c871b5e120ad943a59bb6e213ad83ec4a8acdcf7 100644 (file)
@@ -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: