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