2 XOA_DIR = ../../../components/binaries/xoa
4 DEP_DIR = ../../../components/binaries/matitadep
6 MAC_DIR = ../../../components/binaries/mac
9 XOA_CONF = ground_2/xoa.conf.xml
10 XOA_TARGETS = ground_2/xoa_notation.ma ground_2/xoa.ma
14 ORIGS = basic_2/basic_1.orig
16 PACKAGES = ground_2 basic_2 apps_2
20 # xoa ########################################################################
24 $(XOA_TARGETS): $(XOA_CONF)
25 @echo " EXEC $(XOA) $(XOA_CONF)"
26 $(H)MATITA_RT_BASE_DIR=../.. $(XOA_DIR)/$(XOA) $(XOA_CONF)
28 # orig #######################################################################
32 $(H)$(ORIG) basic_2 < $(ORIGS)
34 # dep ########################################################################
36 deps: MAS = $(shell find $* -name "*.ma")
38 deps: $(DEP_DIR)/$(DEP)
40 $(H)grep "include \"" $(MAS) | $<
42 # stats ######################################################################
44 stats: $(PACKAGES:%=%.stats)
46 %.stats: MAS = $(shell find $* -name "*.ma")
48 %.stats: CHARS = $(shell $(MAC_DIR)/$(MAC) $(MAS))
51 @printf '\x1B[1;40;37m'
52 @printf '%-15s %-40s' 'Statistics for:' $*
54 @printf '\x1B[1;40;35m'
55 @printf '%-8s %6i' Chars $(CHARS)
56 @printf ' %-8s %3i' Pages `echo $$(($(CHARS) / 5120))`
59 @printf '\x1B[1;40;36m'
60 @printf '%-8s %6i' Sources `ls $(MAS) | wc -l`
62 # @printf ' %-8s %5i' Objs `ls *.vo | wc -l`
63 # @printf ' %-6s %3i' Files `ls *.v | wc -l`
65 @printf '\x1B[1;40;32m'
66 @printf '%-8s %6i' Theorems `grep "theorem " $(MAS) | wc -l`
67 @printf ' %-8s %3i' Lemmas `grep "lemma " $(MAS) | wc -l`
68 @printf ' %-5s %3i' Facts `grep "fact " $(MAS) | wc -l`
69 @printf ' %-6s %4i' Proofs `grep qed $(MAS) | wc -l`
71 @printf '\x1B[1;40;33m'
72 @printf '%-8s %6i' Declared `grep "inductive \|record " $(MAS) | wc -l`
73 @printf ' %-8s %3i' Defined `grep "definition \|let rec " $(MAS) | wc -l`
75 # @printf ' %-8s %5i' Local `grep "Local" *.v | wc -l`
77 @printf '\x1B[1;40;31m'
78 @printf '%-8s %6i' Axioms `grep axiom $(MAS) | wc -l`
79 @printf ' %-8s %3i' Comments `grep "(\*[^*:]*$$" $(MAS) | wc -l`
80 @printf ' %-5s %3i' Marks `grep "(\*\*)" $(MAS) | wc -l`
84 # summary ####################################################################
86 define SUMMARY_TEMPLATE
87 TBL_$(1) := $(1)/$(1)_sum.tbl
88 MAS_$(1) := $$(shell find $(1) -name "*.ma")
91 $$(TBL_$(1)): V1 := $$(shell ls $$(MAS_$(1)) | wc -l)
92 $$(TBL_$(1)): V2 := $$(shell $$(MAC_DIR)/$$(MAC) $$(MAS_$(1)))
93 $$(TBL_$(1)): C1 := $$(shell grep "inductive \|record " $$(MAS_$(1)) | wc -l)
94 $$(TBL_$(1)): C2 := $$(shell grep "definition \|let rec " $$(MAS_$(1)) | wc -l)
95 $$(TBL_$(1)): C3 := $$(shell grep "inductive \|record \|definition \|let rec " $$(MAS_$(1)) | wc -l)
96 $$(TBL_$(1)): P1 := $$(shell grep "theorem " $$(MAS_$(1)) | wc -l)
97 $$(TBL_$(1)): P2 := $$(shell grep "lemma " $$(MAS_$(1)) | wc -l)
98 $$(TBL_$(1)): P3 := $$(shell grep "lemma \|theorem " $$(MAS_$(1)) | wc -l)
100 $$(TBL_$(1)): $$(MAS_$(1))
101 @printf ' SUMMARY $(1)\n'
102 @printf 'name "$$(basename $$(@F))"\n\n' > $$@
103 @printf 'table {\n' >> $$@
104 @printf ' class "grey" [ "category"\n' >> $$@
105 @printf ' [ "objects" * ]\n' >> $$@
106 @printf ' ]\n' >> $$@
107 @printf ' class "cyan" [ "sizes"\n' >> $$@
108 @printf ' [ "files" "$$(V1)" ]\n' >> $$@
109 @printf ' [ "characters" "$$(V2)" ]\n' >> $$@
110 @printf ' [ * ]\n' >> $$@
111 @printf ' ]\n' >> $$@
112 @printf ' class "green" [ "propositions"\n' >> $$@
113 @printf ' [ "theorems" "$$(P1)" ]\n' >> $$@
114 @printf ' [ "lemmas" "$$(P2)" ]\n' >> $$@
115 @printf ' [ "total" "$$(P3)" ]\n' >> $$@
116 @printf ' ]\n' >> $$@
117 @printf ' class "yellow" [ "concepts"\n' >> $$@
118 @printf ' [ "declared" "$$(C1)" ]\n' >> $$@
119 @printf ' [ "defined" "$$(C2)" ]\n' >> $$@
120 @printf ' [ "total" "$$(C3)" ]\n' >> $$@
121 @printf ' ]\n' >> $$@
122 @printf '}\n\n' >> $$@
123 @printf 'class "component" { 0 }\n\n' >> $$@
124 @printf 'class "plane" { 1 } { 3 } { 5 }\n\n' >> $$@
125 @printf 'class "number" { 2 } { 4 } { 6 }\n\n' >> $$@
128 $(foreach PKG, $(PACKAGES), $(eval $(call SUMMARY_TEMPLATE,$(PKG))))