2 XOA_DIR = ../../../components/binaries/xoa
5 CONF = ground_2/xoa.conf.xml
6 TARGETS = ground_2/xoa_natation.ma ground_2/xoa.ma
10 ORIGS = basic_2/basic_1.orig
12 PACKAGES = ground_2 basic_2 apps_2
16 # xoa ########################################################################
21 @echo " EXEC $(XOA) $(CONF)"
22 $(H)MATITA_RT_BASE_DIR=../.. $(XOA_DIR)/$(XOA) $(CONF)
24 # orig #######################################################################
28 $(H)$(ORIG) basic_2 < $(ORIGS)
30 # stats ######################################################################
32 stats: $(PACKAGES:%=%.stats)
34 %.stats: MAS = $(shell find $* -name "*.ma")
36 %.stats: CHARS = $(shell cat $(MAS) | wc -c)
39 @printf '\x1B[1;40;37m'
40 @printf '%-15s %-42s' 'Statistics for:' $*
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))`
48 @printf '\x1B[1;40;36m'
49 @printf '%-8s %6i' Sources `ls $(MAS) | wc -l`
51 # @printf ' %-8s %5i' Objs `ls *.vo | wc -l`
52 # @printf ' %-6s %3i' Files `ls *.v | wc -l`
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`
60 @printf '\x1B[1;40;33m'
61 @printf '%-8s %6i' Defs `grep "definition\|let rec\|inductive\|record" $(MAS) | wc -l`
63 # @printf ' %-8s %5i' Local `grep "Local" *.v | wc -l`
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`
72 # summary ####################################################################
74 define SUMMARY_TEMPLATE
75 TBL_$(1) := $(1)/$(1)_sum.tbl
76 MAS_$(1) := $$(shell find $(1) -name "*.ma")
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)
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' >> $$@
95 @printf ' class "cyan" [ "sizes"\n' >> $$@
96 @printf ' [ "files" "$$(V1)" ]\n' >> $$@
97 @printf ' [ "bytes" "$$(V2)" ]\n' >> $$@
98 @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' >> $$@
116 $(foreach PKG, $(PACKAGES), $(eval $(call SUMMARY_TEMPLATE,$(PKG))))