]> matita.cs.unibo.it Git - helm.git/blob - components/Makefile
- ensure simplify_deps exists when invoked
[helm.git] / components / Makefile
1
2 export SHELL=/bin/bash
3
4 include ../Makefile.defs
5
6 # Warning: the modules must be in compilation order
7 NULL =
8 MODULES =                       \
9         extlib                  \
10         xml                     \
11         hgdome                  \
12         registry                \
13         hmysql                  \
14         utf8_macros             \
15         thread                  \
16         xmldiff                 \
17         urimanager              \
18         logger                  \
19         getter                  \
20         cic                     \
21         cic_proof_checking      \
22         cic_acic                \
23         metadata                \
24         library                 \
25         acic_content            \
26         content_pres            \
27         grafite                 \
28         cic_unification         \
29         whelp                   \
30         tactics                 \
31         cic_disambiguation      \
32         lexicon                 \
33         grafite_engine          \
34         grafite_parser          \
35         tactics/paramodulation  \
36         $(NULL)
37
38 METAS = $(filter-out %/paramodulation,$(MODULES:%=METAS/META.helm-%))
39
40 all: metas $(MODULES:%=rec@all@%) 
41 opt: metas $(MODULES:%=rec@opt@%)
42 ifeq ($(HAVE_OCAMLOPT),yes)
43 world: all opt
44 else
45 world: all
46 endif
47 depend: $(MODULES:%=rec@depend@%)
48 install: $(MODULES:%=rec@install@%)
49 uninstall: $(MODULES:%=rec@uninstall@%)
50 clean: $(MODULES:%=rec@clean@%) clean_metas
51
52 .stats: $(MODULES:%=rec@.stats@%)
53         (for m in $(MODULES); do echo -n "$$m:"; cat $$m/.stats; done) \
54          | sort -t : -k 2 -n -r > .stats
55
56 rec@%@tactics/paramodulation:
57         $(MAKE) -C tactics/paramodulation $*
58 rec@%:
59         $(MAKE) -C $(word 2, $(subst @, ,$*)) $(word 1, $(subst @, ,$*))
60
61 EXTRA_DIST_CLEAN = \
62         libraries-clusters.ps   \
63         libraries-clusters.pdf  \
64         libraries-ext.ps        \
65         libraries.ps            \
66         .dep.dot                \
67         .extdep.dot             \
68         .clustersdep.dot        \
69         $(NULL)
70
71 distclean: clean clean_metas
72         rm -f $(METAS)
73         rm -f configure config.log config.cache config.status
74         rm -f $(EXTRA_DIST_CLEAN)
75
76 .PHONY: all opt world metas depend install uninstall clean clean_metas distclean
77
78 METAS/META.helm-%: METAS/meta.helm-%.src
79         cp $< $@ && echo "directory=\"$(shell pwd)/$*\"" >> $@
80
81 SIMPLIFYDEPS = ../daemons/graphs/tools/simplify_deps/simplify_deps
82 $(SIMPLIFYDEPS):
83         $(MAKE) -C $(dir $(SIMPLIFYDEPS))
84
85 .PHONY: .dep.dot
86 .dep.dot: $(SIMPLIFYDEPS)
87         echo "digraph G {" > $@
88         echo "   rankdir = TB ;" >> $@
89         for i in $(MODULES); do $(OCAMLFIND) query helm-$$i -recursive -p-format | grep helm | sed "s/^helm-/ \"$$i\" -> \"/g" | sed "s/$$/\";/g" >> $@ ; done
90         mv $@ $@.old ; $(SIMPLIFYDEPS) < $@.old > $@ ; rm $@.old
91         echo "}" >> $@
92
93 .PHONY: .alldep.dot
94 .alldep.dot:
95         echo "digraph G {" > $@
96         echo "   rankdir = TB ;" >> $@
97         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
98         mv $@ $@.old ; ./simplify_deps/simplify_deps.opt < $@.old > $@ ; rm $@.old
99         for i in $(MODULES); do echo "\"helm-$$i\" [shape=box,style=filled,fillcolor=yellow];" >> $@ ; done
100         echo "}" >> $@
101
102 .extdep.dot: .dep.dot
103         STATS/patch_deps.sh $< $@
104 .clustersdep.dot: .dep.dot
105         USE_CLUSTERS=yes STATS/patch_deps.sh $< $@
106
107 libraries.ps: .dep.dot
108         dot -Tps -o $@ $<
109 libraries-ext.ps: .extdep.dot
110         dot -Tps -o $@ $<
111 libraries-clusters.ps: .clustersdep.dot
112         dot -Tps -o $@ $<
113 libraries-complete.ps: .alldep.dot
114         dot -Tps -o $@ $<
115
116 ps: libraries.ps libraries-ext.ps libraries-clusters.ps
117
118 tags: TAGS
119 .PHONY: TAGS
120 TAGS:
121         otags -vi -r .
122