]> matita.cs.unibo.it Git - helm.git/blob - helm/hbugs/tutors/Makefile
added ocamlfind trick to trigger rebuild when some library's .cma has
[helm.git] / helm / hbugs / tutors / Makefile
1 METADIR = ../meta
2 REQUIRES = threads hbugs-common helm-cic_proof_checking helm-tactics helm-getter
3 COMMONOPTS = -package "$(REQUIRES)" -predicates "$(PREDICATES)"
4 OCAMLFIND = ocamlfind
5 OCAMLC = $(OCAMLFIND) ocamlc $(COMMONOPTS)
6 OCAMLOPT = $(OCAMLFIND) opt $(COMMONOPTS)
7 LINK_OPTIONS = -thread -package threads -linkpkg
8 TUTORS_TEMPLATE = hbugs_tutor.TPL.ml
9 TUTORS_INDEX = INDEX.xml
10 GENERATED_TUTORS = \
11         ring_tutor fourier_tutor reflexivity_tutor symmetry_tutor \
12         assumption_tutor contradiction_tutor exists_tutor split_tutor \
13         left_tutor right_tutor
14 TUTORS = $(GENERATED_TUTORS) search_pattern_apply_tutor
15 BUILD_TUTORS = ./build_tutors.ml
16 CTL = ./sabba.sh
17 TUTORS_OPT = $(patsubst %,%.opt,$(TUTORS))
18 GENERATED_TUTORS_SRC = $(patsubst %,%.ml,$(GENERATED_TUTORS))
19 COMMON = hbugs_deity.cmo hbugs_tutors_common.cmo
20 COMMON_OPT = $(patsubst %.cmo,%.cmx,$(COMMON))
21
22 DEPS = $(shell $(OCAMLFIND) query -recursive -predicates byte -format "%d/%a" $(REQUIRES))
23 DEPSOPT = $(shell $(OCAMLFIND) query -recursive -predicates native -format "%d/%a" $(REQUIRES))
24
25 all: byte
26 world: byte opt
27 byte: $(TUTORS)
28 opt: $(TUTORS_OPT)
29 start:
30         $(CTL) start
31 stop:
32         $(CTL) stop
33
34 $(GENERATED_TUTORS_SRC): $(TUTORS_TEMPLATE) $(TUTORS_INDEX)
35         $(BUILD_TUTORS)
36 %_tutor: $(DEPS) $(COMMON) %_tutor.ml
37         $(OCAMLC) $(LINK_OPTIONS) -o $@ $(COMMON) $*_tutor.ml
38 %_tutor.opt: $(DEPSOPT) $(COMMON_OPT) %_tutor.ml
39         $(OCAMLOPT) $(LINK_OPTIONS) -o $@ $(COMMON_OPT) $*_tutor.ml
40
41 %.cmi: %.mli
42         $(OCAMLC) -c $<
43 %.cmo: %.ml %.cmi
44         $(OCAMLC) -c $<
45 %.cmx: %.ml %.cmi
46         $(OCAMLOPT) -c $<
47
48 clean:
49         rm -f *.cm[aixo] *.cmxa *.[oa] $(TUTORS) $(TUTORS_OPT) $(GENERATED_TUTORS_SRC)
50 distclean: clean
51         rm -f run/*
52 .PHONY: all world byte opt clean start stop
53