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