]> matita.cs.unibo.it Git - helm.git/blob - helm/software/components/Makefile
basic topologies are trivially o-basic topologies
[helm.git] / helm / software / components / Makefile
1 H=@
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         syntax_extensions \
15         thread                  \
16         xmldiff                 \
17         urimanager              \
18         logger                  \
19         getter                  \
20         cic                     \
21         cic_proof_checking      \
22         cic_acic                \
23         cic_exportation         \
24         metadata                \
25         library                 \
26         acic_content            \
27         grafite                 \
28         content_pres            \
29         cic_unification         \
30         whelp                   \
31         tactics                 \
32         acic_procedural         \
33         disambiguation  \
34         cic_disambiguation      \
35         lexicon                 \
36         ng_kernel               \
37         ng_refiner              \
38         ng_disambiguation       \
39         grafite_engine          \
40         grafite_parser          \
41         tptp_grafite            \
42         $(NULL)
43
44 METAS = $(MODULES:%=METAS/META.helm-%)
45
46 ifeq ($(DISTRIBUTED),no)
47         MODULES+=binaries
48 endif
49
50 all: metas $(MODULES:%=rec@all@%) 
51 opt: metas syntax-extensions $(MODULES:%=rec@opt@%)
52
53 ifeq ($(HAVE_OCAMLOPT),yes)
54 world: opt
55 else
56 world: all
57 endif
58 syntax-extensions:
59         $(H)$(MAKE) -C syntax_extensions depend
60         $(H)$(MAKE) -C syntax_extensions
61 depend: syntax-extensions $(MODULES:%=rec@depend@%)
62 depend.opt: syntax-extensions $(MODULES:%=rec@depend.opt@%)
63 install-arch: $(MODULES:%=rec@install@%)
64 install-indep:
65 uninstall: $(MODULES:%=rec@uninstall@%)
66 clean: $(MODULES:%=rec@clean@%) clean_metas
67
68 .stats: $(MODULES:%=rec@.stats@%)
69         $(H)(for m in $(MODULES); do echo -n "$$m:"; cat $$m/.stats; done) \
70          | sort -t : -k 2 -n -r > .stats
71
72 rec@%:
73         $(H)$(MAKE) -C $(word 2, $(subst @, ,$*)) $(word 1, $(subst @, ,$*))
74
75 EXTRA_DIST_CLEAN = \
76         libraries-clusters.ps   \
77         libraries-clusters.pdf  \
78         libraries-ext.ps        \
79         libraries.ps            \
80         .dep.dot                \
81         .extdep.dot             \
82         .clustersdep.dot        \
83         $(NULL)
84
85 distclean: clean clean_metas
86         $(H)rm -f $(METAS)
87         $(H)rm -f configure config.log config.cache config.status
88         $(H)rm -f $(EXTRA_DIST_CLEAN)
89
90 .PHONY: all opt world metas depend install uninstall clean clean_metas distclean
91
92 METAS/META.helm-%: METAS/meta.helm-%.src
93         $(H)cp $< $@ && echo "directory=\"$(shell pwd)/$*\"" >> $@
94
95 SIMPLIFYDEPS = ../daemons/graphs/tools/simplify_deps/simplify_deps
96 $(SIMPLIFYDEPS):
97         $(H)$(MAKE) -C $(dir $(SIMPLIFYDEPS))
98
99 .PHONY: .dep.dot
100 .dep.dot: $(SIMPLIFYDEPS)
101         $(H)echo "digraph G {" > $@
102         $(H)echo "   rankdir = TB ;" >> $@
103         $(H)for i in $(MODULES); do \
104                 $(OCAMLFIND) query helm-$$i -recursive -p-format | \
105                 grep helm | \
106                 sed "s/^helm-/ \"$$i\" -> \"/g" | \
107                 sed "s/$$/\";/g" >> $@ ; \
108         done
109         $(H)mv $@ $@.old ; $(SIMPLIFYDEPS) < $@.old > $@ ; rm $@.old
110         $(H)echo "}" >> $@
111
112 .PHONY: .alldep.dot
113 .alldep.dot:
114         $(H)echo "digraph G {" > $@
115         $(H)echo "   rankdir = TB ;" >> $@
116         $(H)for i in $(MODULES); do \
117                 $(OCAMLFIND) query helm-$$i -recursive -p-format | \
118                         grep -v "pxp-" | \
119                         sed "s/^pxp/pxp[-*]/g" | \
120                         sed "s/^/ \"helm-$$i\" -> \"/g" | \
121                         sed "s/$$/\";/g" >> $@ ; \
122         done
123         $(H)mv $@ $@.old ; \
124                 ./simplify_deps/simplify_deps.opt < $@.old > $@ ; \
125                 rm $@.old
126         $(H)for i in $(MODULES); do \
127                 echo "\"helm-$$i\" [shape=box,style=filled,fillcolor=yellow];"\
128                         >> $@ ; \
129         done
130         $(H)echo "}" >> $@
131
132 .extdep.dot: .dep.dot
133         $(H)STATS/patch_deps.sh $< $@
134 .clustersdep.dot: .dep.dot
135         $(H)USE_CLUSTERS=yes STATS/patch_deps.sh $< $@
136
137 libraries.ps: .dep.dot
138         $(H)dot -Tps -o $@ $<
139 libraries-ext.ps: .extdep.dot
140         $(H)dot -Tps -o $@ $<
141 libraries-clusters.ps: .clustersdep.dot
142         $(H)dot -Tps -o $@ $<
143 libraries-complete.ps: .alldep.dot
144         $(H)dot -Tps -o $@ $<
145
146 ps: libraries.ps libraries-ext.ps libraries-clusters.ps
147
148 tags: TAGS
149 .PHONY: TAGS
150 TAGS:
151         $(H)otags -vi -r .
152
153 metas: $(filter-out METAS/META.helm-binaries, $(METAS))