]> matita.cs.unibo.it Git - helm.git/blob - helm/ocaml/Makefile.in
Makefiles patched
[helm.git] / helm / ocaml / Makefile.in
1 # Warning: the modules must be in compilation order
2 MODULES = xml urimanager getter pxp cic cic_annotations cic_annotations_cache \
3           cic_cache cic_proof_checking cic_textual_parser \
4           tex_cic_textual_parser cic_unification mathql mathql_generator \
5           mathql_interpreter cic_omdoc tactics cic_transformations
6
7 OCAMLFIND_DEST_DIR = @OCAMLFIND_DEST_DIR@
8 OCAMLFIND_META_DIR = @OCAMLFIND_META_DIR@
9
10 METAS = $(MODULES:%=METAS/META.helm-%)
11 CWD=`pwd`
12
13 all: metas $(MODULES:%=%.all)
14 opt: metas $(MODULES:%=%.opt)
15 metas: $(METAS)
16 depend: $(MODULES:%=%.depend)
17 install: $(MODULES:%=%.install)
18 uninstall: $(MODULES:%=%.uninstall)
19 clean: $(MODULES:%=%.clean) clean_metas
20 clean_metas:
21         rm -f $(METAS)
22
23 dist-clean: clean
24         rm -f Makefile Makefile.common configure config.log config.cache config.status
25
26 $(MODULES:%=%.all):
27         export OCAMLPATH=$(CWD):$$OCAMLPATH ; cd $(@:%.all=%) && make all
28 $(MODULES:%=%.opt):
29         export OCAMLPATH=$(CWD):$$OCAMLPATH ; cd $(@:%.opt=%) && make opt
30 $(MODULES:%=%.depend):
31         export OCAMLPATH=$(CWD):$$OCAMLPATH ; cd $(@:%.depend=%) && make depend
32 $(MODULES:%=%.install):
33         cd $(@:%.install=%) && make install
34         export TARGET=$(OCAMLFIND_META_DIR)/$(@:%.install=META.helm-%) ; \
35         cp $(@:%.install=META.helm-%.src) $$TARGET && \
36         echo "directory=\"$(OCAMLFIND_DEST_DIR)/$(@:%.install=%)\"" >> $$TARGET
37 $(MODULES:%=%.uninstall):
38         cd $(@:%.uninstall=%) && make uninstall
39         rm -f $(OCAMLFIND_META_DIR)/$(@:%.uninstall=META.helm-%)
40 $(MODULES:%=%.clean):
41         cd $(@:%.clean=%) && make clean
42 METAS/META.helm-%: METAS/meta.helm-%.src
43         cp $< $@ && echo "directory=\"$(CWD)/$*\"" >> $@
44
45 .PHONY: .dep.dot
46 .dep.dot:
47         echo "digraph G {" > $@
48         echo "   rankdir = TB ;" >> $@
49         for i in $(MODULES); do ocamlfind query helm-$$i -recursive -p-format | grep helm | sed "s/^helm-/ \"$$i\" -> \"/g" | sed "s/$$/\";/g" >> $@ ; done
50         mv $@ $@.old ; ./simplify_deps/simplify_deps.opt < $@.old > $@ ; rm $@.old
51         echo "}" >> $@
52
53 libraries.ps: .dep.dot
54         dot -Tps -o $@ $<