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