]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambda_delta/Makefile
- parallel reduction for local environments: we proved the equivalence
[helm.git] / matita / matita / contribs / lambda_delta / Makefile
1 H        = @
2 XOA_DIR  = ../../../components/binaries/xoa
3 XOA      = xoa.native
4 DEP_DIR  = ../../../components/binaries/matitadep
5 DEP      = matitadep.native
6
7 CONF     = ground_2/xoa.conf.xml
8 TARGETS  = ground_2/xoa_natation.ma ground_2/xoa.ma
9
10 ORIG     = . ./orig.sh 
11
12 ORIGS    = basic_2/basic_1.orig
13
14 PACKAGES = ground_2 basic_2 apps_2
15
16 all:
17
18 # xoa ########################################################################
19
20 xoa: $(TARGETS)
21
22 $(TARGETS): $(CONF)
23         @echo "  EXEC $(XOA) $(CONF)"
24         $(H)MATITA_RT_BASE_DIR=../.. $(XOA_DIR)/$(XOA) $(CONF)
25
26 # orig #######################################################################
27
28 orig: $(ORIGS)
29         @echo "  ORIG basic_2"
30         $(H)$(ORIG) basic_2 < $(ORIGS)
31
32 # dep ########################################################################
33
34 deps: MAS = $(shell find $* -name "*.ma")
35
36 deps: $(DEP_DIR)/$(DEP)
37         @echo "  MATITADEP"
38         $(H)grep "include \"" $(MAS) | $<
39
40 # stats ######################################################################
41
42 stats: $(PACKAGES:%=%.stats)
43
44 %.stats: MAS = $(shell find $* -name "*.ma")
45
46 %.stats: CHARS = $(shell cat $(MAS) | wc -c)
47
48 %.stats:
49         @printf '\x1B[1;40;37m'
50         @printf '%-15s %-43s' 'Statistics for:' $*      
51         @printf '\x1B[0m\n'     
52         @printf '\x1B[1;40;35m'
53         @printf '%-8s %6i' Chars $(CHARS)
54         @printf '   %-8s %5i' Lines `cat $(MAS) | wc -l`
55         @printf '   %-6s %3i' Pages `echo $$(($(CHARS) / 5120))`
56         @printf '   %-11s' ''
57         @printf '\x1B[0m\n'
58         @printf '\x1B[1;40;36m'
59         @printf '%-8s %6i' Sources `ls $(MAS) | wc -l`
60         @printf '   %-41s' ''
61 #       @printf '   %-8s %5i' Objs `ls *.vo | wc -l`
62 #       @printf '   %-6s %3i' Files `ls *.v | wc -l`
63         @printf '\x1B[0m\n'     
64         @printf '\x1B[1;40;32m'
65         @printf '%-8s %6i' Theorems `grep "theorem " $(MAS) | wc -l`
66         @printf '   %-8s %5i' Lemmas `grep "lemma " $(MAS) | wc -l`
67         @printf '   %-6s %3i' Facts `grep "fact " $(MAS) | wc -l`
68         @printf '   %-6s %4i' Proofs `grep qed $(MAS) | wc -l`
69         @printf '\x1B[0m\n'     
70         @printf '\x1B[1;40;33m'
71         @printf '%-8s %6i' Defs `grep "definition\|let rec\|inductive\|record" $(MAS) | wc -l` 
72         @printf '   %-41s' ''
73 #       @printf '   %-8s %5i' Local `grep "Local" *.v | wc -l`
74         @printf '\x1B[0m\n'
75         @printf '\x1B[1;40;31m'
76         @printf '%-8s %6i' Axioms `grep axiom $(MAS) | wc -l`
77         @printf '   %-8s %5i' Comments `grep "(\*[^*:]*$$" $(MAS) | wc -l`
78         @printf '   %-6s %3i' Marks `grep "(\*\*)" $(MAS) | wc -l`
79         @printf '   %-11s' ''
80         @printf '\x1B[0m\n'
81
82 # summary ####################################################################
83
84 define SUMMARY_TEMPLATE
85   TBL_$(1) := $(1)/$(1)_sum.tbl  
86   MAS_$(1) := $$(shell find $(1) -name "*.ma")
87   TBLS     += $$(TBL_$(1))
88
89   $$(TBL_$(1)): V1 := $$(shell ls $$(MAS_$(1)) | wc -l)
90   $$(TBL_$(1)): V2 := $$(shell cat $$(MAS_$(1)) | wc -c)
91   $$(TBL_$(1)): C1 := $$(shell grep "inductive \|record " $$(MAS_$(1)) | wc -l)
92   $$(TBL_$(1)): C2 := $$(shell grep "definition \|let rec " $$(MAS_$(1)) | wc -l)
93   $$(TBL_$(1)): C3 := $$(shell grep "inductive \|record \|definition \|let rec " $$(MAS_$(1)) | wc -l)
94   $$(TBL_$(1)): P1 := $$(shell grep "theorem " $$(MAS_$(1)) | wc -l)
95   $$(TBL_$(1)): P2 := $$(shell grep "lemma " $$(MAS_$(1)) | wc -l)
96   $$(TBL_$(1)): P3 := $$(shell grep "lemma \|theorem " $$(MAS_$(1)) | wc -l)
97
98   $$(TBL_$(1)): $$(MAS_$(1))
99         @printf '  SUMMARY $(1)\n'
100         @printf 'name "$$(basename $$(@F))"\n\n'       >  $$@
101         @printf 'table {\n'                            >> $$@
102         @printf '   class "grey" [ "category"\n'       >> $$@
103         @printf '      [ "objects" * ]\n'              >> $$@
104         @printf '   ]\n'                               >> $$@
105         @printf '   class "cyan" [ "sizes"\n'          >> $$@
106         @printf '      [ "files" "$$(V1)" ]\n'         >> $$@
107         @printf '      [ "bytes" "$$(V2)" ]\n'         >> $$@
108         @printf '      [ * ]\n'                        >> $$@
109         @printf '   ]\n'                               >> $$@   
110         @printf '   class "green" [ "propositions"\n'  >> $$@
111         @printf '      [ "theorems" "$$(P1)" ]\n'      >> $$@
112         @printf '      [ "lemmas"   "$$(P2)" ]\n'      >> $$@
113         @printf '      [ "total"    "$$(P3)" ]\n'      >> $$@
114         @printf '   ]\n'                               >> $$@
115         @printf '   class "yellow" [ "concepts"\n'     >> $$@
116         @printf '      [ "declared" "$$(C1)" ]\n'      >> $$@
117         @printf '      [ "defined"  "$$(C2)" ]\n'      >> $$@
118         @printf '      [ "total"    "$$(C3)" ]\n'      >> $$@
119         @printf '   ]\n'                               >> $$@
120         @printf '}\n\n'                                >> $$@
121         @printf 'class "component" { 0 }\n\n'          >> $$@
122         @printf 'class "plane" { 1 } { 3 } { 5 }\n\n'  >> $$@
123         @printf 'class "number" { 2 } { 4 } { 6 }\n\n' >> $$@
124 endef
125
126 $(foreach PKG, $(PACKAGES), $(eval $(call SUMMARY_TEMPLATE,$(PKG))))
127
128 tbls: $(TBLS)