]> matita.cs.unibo.it Git - helm.git/blob - helm/ocaml/Makefile.in
clean now also performs clean_metas (since make also creates the metas)
[helm.git] / helm / ocaml / Makefile.in
1 # Warning: the modules must be in compilation order
2 MODULES =                       \
3         xml                     \
4         pxp                     \
5         registry                \
6         utf8_macros             \
7         thread                  \
8         xmldiff                 \
9         urimanager              \
10         logger                  \
11         getter                  \
12         cic                     \
13         cic_annotations         \
14         cic_proof_checking      \
15         cic_unification         \
16         cic_omdoc               \
17         metadata                \
18         tactics                 \
19         cic_notation            \
20         cic_transformations     \
21         cic_textual_parser2     \
22         mathql                  \
23         mathql_interpreter      \
24         mathql_generator        \
25         hbugs                   
26
27 OCAMLFIND_DEST_DIR = @OCAMLFIND_DEST_DIR@
28 OCAMLFIND_META_DIR = @OCAMLFIND_META_DIR@
29
30 METAS = $(MODULES:%=METAS/META.helm-%)
31 CWD=`pwd`
32
33 all: metas $(MODULES:%=%.all)
34 opt: metas $(MODULES:%=%.opt)
35 world: all opt
36 metas: $(METAS)
37 depend: $(MODULES:%=%.depend)
38 install: $(MODULES:%=%.install)
39 uninstall: $(MODULES:%=%.uninstall)
40 clean: clean_metas $(MODULES:%=%.clean)
41 clean_metas:
42         rm -f $(METAS)
43 distclean: clean clean_metas
44         rm -f Makefile Makefile.common configure config.log config.cache config.status
45
46 .PHONY: all opt world metas depend install uninstall clean clean_metas distclean
47
48 $(MODULES:%=%.all):
49         export OCAMLPATH=$(CWD):$$OCAMLPATH ; cd $(@:%.all=%) && make all
50 $(MODULES:%=%.opt):
51         export OCAMLPATH=$(CWD):$$OCAMLPATH ; cd $(@:%.opt=%) && make opt
52 $(MODULES:%=%.depend):
53         export OCAMLPATH=$(CWD):$$OCAMLPATH ; cd $(@:%.depend=%) && make depend
54 $(MODULES:%=%.install):
55         cd $(@:%.install=%) && make install
56         export TARGET=$(OCAMLFIND_META_DIR)/$(@:%.install=META.helm-%) ; \
57         cp METAS/$(@:%.install=meta.helm-%.src) $$TARGET && \
58         echo "directory=\"$(OCAMLFIND_DEST_DIR)/$(@:%.install=%)\"" >> $$TARGET
59 $(MODULES:%=%.uninstall):
60         cd $(@:%.uninstall=%) && make uninstall
61         rm -f $(OCAMLFIND_META_DIR)/$(@:%.uninstall=META.helm-%)
62 $(MODULES:%=%.clean):
63         cd $(@:%.clean=%) && make clean
64 METAS/META.helm-%: METAS/meta.helm-%.src
65         cp $< $@ && echo "directory=\"$(CWD)/$*\"" >> $@
66
67 .PHONY: .dep.dot
68 .dep.dot:
69         echo "digraph G {" > $@
70         echo "   rankdir = TB ;" >> $@
71         for i in $(MODULES); do $(OCAMLFIND) query helm-$$i -recursive -p-format | grep helm | sed "s/^helm-/ \"$$i\" -> \"/g" | sed "s/$$/\";/g" >> $@ ; done
72         mv $@ $@.old ; ./simplify_deps/simplify_deps.opt < $@.old > $@ ; rm $@.old
73         echo "}" >> $@
74
75 .PHONY: .alldep.dot
76 .alldep.dot:
77         echo "digraph G {" > $@
78         echo "   rankdir = TB ;" >> $@
79         for i in $(MODULES); do $(OCAMLFIND) query helm-$$i -recursive -p-format | grep -v "pxp-" | sed "s/^pxp/pxp[-*]/g" | sed "s/^/ \"helm-$$i\" -> \"/g" | sed "s/$$/\";/g" >> $@ ; done
80         mv $@ $@.old ; ./simplify_deps/simplify_deps.opt < $@.old > $@ ; rm $@.old
81         for i in $(MODULES); do echo "\"helm-$$i\" [shape=box,style=filled,fillcolor=yellow];" >> $@ ; done
82         echo "}" >> $@
83
84 libraries.ps: .dep.dot
85         dot -Tps -o $@ $<
86
87 libraries-complete.ps: .alldep.dot
88         dot -Tps -o $@ $<
89
90 tags: TAGS
91 .PHONY: TAGS
92 TAGS:
93         otags -vi -r .
94