X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2FMakefile.common.in;h=1afee22b80cd044bf0b4ce3b204dab3186a06786;hb=9f60b3b0f4460aec52ec241037f6c475b421dd15;hp=47d02bb42867c70452ca921eb451bf96ff4d26f6;hpb=bac72fcaa876137ab7a5630e0c1badc2a627dce8;p=helm.git diff --git a/helm/ocaml/Makefile.common.in b/helm/ocaml/Makefile.common.in index 47d02bb42..1afee22b8 100644 --- a/helm/ocaml/Makefile.common.in +++ b/helm/ocaml/Makefile.common.in @@ -10,10 +10,14 @@ OCAMLFIND_DEST_DIR = @OCAMLFIND_DEST_DIR@ -OCAMLOPTIONS = -package "$(REQUIRES)" -predicates "$(PREDICATES)" -pp camlp4o -OCAMLC = ocamlfind ocamlc $(OCAMLOPTIONS) -OCAMLOPT = ocamlfind ocamlopt $(OCAMLOPTIONS) -OCAMLDEP = ocamldep -pp camlp4o +PREPROCOPTIONS = -pp camlp4o +PREREQ = +OCAMLOPTIONS = -package "$(REQUIRES)" -predicates "$(PREDICATES)" -thread +OCAMLDEBUGOPTIONS = -g +OCAMLFIND = ocamlfind +OCAMLC = $(OCAMLFIND) ocamlc $(OCAMLDEBUGOPTIONS) $(OCAMLOPTIONS) $(PREPROCOPTIONS) +OCAMLOPT = $(OCAMLFIND) opt $(OCAMLOPTIONS) $(PREPROCOPTIONS) +OCAMLDEP = $(OCAMLFIND) ocamldep $(PREPROCOPTIONS) OCAMLLEX = ocamllex OCAMLYACC = ocamlyacc @@ -29,13 +33,15 @@ OBJECTS_TO_INSTALL = $(ARCHIVE) $(ARCHIVE_OPT) $(ARCHIVE_OPT:%.cmxa=%.a) \ DEPEND_FILES = $(INTERFACE_FILES) $(IMPLEMENTATION_FILES) $(ARCHIVE): $(IMPLEMENTATION_FILES:%.ml=%.cmo) $(LIBRARIES) - $(OCAMLC) -a -o $@ $(IMPLEMENTATION_FILES:%.ml=%.cmo) + $(OCAMLC) -a -linkall -o $@ $(IMPLEMENTATION_FILES:%.ml=%.cmo) $(ARCHIVE_OPT): $(IMPLEMENTATION_FILES:%.ml=%.cmx) $(LIBRARIES_OPT) - $(OCAMLOPT) -a -o $@ $(IMPLEMENTATION_FILES:%.ml=%.cmx) + $(OCAMLOPT) -a -linkall -o $@ $(IMPLEMENTATION_FILES:%.ml=%.cmx) -all: $(IMPLEMENTATION_FILES:%.ml=%.cmo) $(ARCHIVE) -opt: $(IMPLEMENTATION_FILES:%.ml=%.cmx) $(ARCHIVE_OPT) +prereq: $(PREREQ) +all: prereq $(IMPLEMENTATION_FILES:%.ml=%.cmo) $(ARCHIVE) +opt: prereq $(IMPLEMENTATION_FILES:%.ml=%.cmx) $(ARCHIVE_OPT) +world: all opt depend: $(DEPEND_FILES) $(OCAMLDEP) $(INTERFACE_FILES) $(IMPLEMENTATION_FILES) > .depend @@ -46,18 +52,15 @@ $(PACKAGE).ps: .dep.dot .dep.dot: .depend ocamldot < .depend > $@ -.SUFFIXES: .ml .mli .cmo .cmi .cmx .mll .mly -.ml.cmo: +%.cmi: %.mli $(OCAMLC) -c $< -.mli.cmi: +%.cmo %.cmi: %.ml $(OCAMLC) -c $< -.ml.cmx: +%.cmx: %.ml $(OCAMLOPT) -c $< -.mly.ml: +%.ml %.mli: %.mly $(OCAMLYACC) $< -.mly.mli: - $(OCAMLYACC) $< -.mll.ml: +%.ml: %.mll $(OCAMLLEX) $< $(IMPLEMENTATION_FILES:%.ml=%.cmo): $(LIBRARIES) @@ -74,8 +77,23 @@ uninstall: cd $(OCAMLFIND_DEST_DIR)/$(PACKAGE) && rm -f $(OBJECTS_TO_INSTALL) rmdir $(OCAMLFIND_DEST_DIR)/$(PACKAGE) -.PHONY: all opt depend install uninstall clean +backup: + cd ..; tar cvzf $(PACKAGE)_$(shell date +%s).tar.gz $(PACKAGE) + +.PHONY: all opt world backup depend install uninstall clean ifneq ($(MAKECMDGOALS), depend) include .depend endif + +ifeq ($(MAKECMDGOALS), all) + $(IMPLEMENTATION_FILES:%.ml=%.cmi): $(LIBRARIES) +endif + +ifeq ($(MAKECMDGOALS), opt) + $(IMPLEMENTATION_FILES:%.ml=%.cmi): $(LIBRARIES_OPT) +endif + +ifeq ($(MAKECMDGOALS),) + $(IMPLEMENTATION_FILES:%.ml=%.cmi): $(LIBRARIES) +endif