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