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