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