4 XOA_DIR = ../../../components/binaries/xoa
6 DEP_DIR = ../../../components/binaries/matitadep
8 MAC_DIR = ../../../components/binaries/mac
10 PRB_DIR = ../../../components/binaries/probe
12 PRB_OPTS = ../../matita.conf.xml -g cic:/matita/lambdadelta/
14 XOA_CONF = ground_2/xoa.conf.xml
15 XOA_TARGETS = ground_2/xoa_notation.ma ground_2/xoa.ma
19 ORIGS = basic_2/basic_1.orig
21 PACKAGES = ground_2 basic_2 apps_2
26 # MAS ########################################################################
29 MAS_$(1) := $$(shell find $(1) -name "*.ma")
33 $(foreach PKG, $(PACKAGES), $(eval $(call MAS_TEMPLATE,$(PKG))))
35 # xoa ########################################################################
39 $(XOA_TARGETS): $(XOA_CONF)
40 @echo " EXEC $(XOA) $(XOA_CONF)"
41 $(H)MATITA_RT_BASE_DIR=../.. $(XOA_DIR)/$(XOA) $(XOA_CONF)
43 # orig #######################################################################
47 $(H)$(ORIG) basic_2 < $(ORIGS)
49 # dep ########################################################################
51 deps: $(DEP_DIR)/$(DEP)
53 $(H)grep "include \"" $(MAS) | $<
55 # stats ######################################################################
58 STT_$(1) := $(1).stats
61 $$(STT_$(1)): S1 = $$(shell $$(MAC_DIR)/$$(MAC) $$(MAS_$(1)))
62 $$(STT_$(1)): S2 := $$(shell echo $$$$(($$(S1) / 5120)))
63 $$(STT_$(1)): S4 := $$(shell ls $$(MAS_$(1)) | wc -l)
64 $$(STT_$(1)): S5 := $$(shell $$(PRB_DIR)/$$(PRB) $$(PRB_OPTS)$(1)/ -sn -on)
65 $$(STT_$(1)): P1 := $$(shell grep "theorem " $$(MAS_$(1)) | wc -l)
66 $$(STT_$(1)): P2 := $$(shell grep "lemma " $$(MAS_$(1)) | wc -l)
67 $$(STT_$(1)): P3 := $$(shell grep "fact " $$(MAS_$(1)) | wc -l)
68 $$(STT_$(1)): P4 := $$(shell grep qed $$(MAS_$(1)) | wc -l)
69 $$(STT_$(1)): C1 := $$(shell grep "inductive \|record " $$(MAS_$(1)) | wc -l)
70 $$(STT_$(1)): C2 := $$(shell grep "definition \|let rec " $$(MAS_$(1)) | wc -l)
71 $$(STT_$(1)): M1 := $$(shell grep "axiom " $$(MAS_$(1)) | wc -l)
72 $$(STT_$(1)): M2 := $$(shell grep "$$(OPEN)\*[^*:]*$$$$" $$(MAS_$(1)) | wc -l)
73 $$(STT_$(1)): M3 := $$(shell grep "(\*\*)" $$(MAS_$(1)) | wc -l)
76 @printf '\x1B[1;40;37m'
77 @printf '%-15s %-43s' 'Statistics for:' $(1)
79 @printf '\x1B[1;40;35m'
80 @printf '%-8s %6i' Chars $$(S1)
81 @printf ' %-8s %3i' Pages $$(S2)
84 @printf '\x1B[1;40;36m'
85 @printf '%-8s %6i' Files $$(S4)
86 @printf ' %-8s %3i' Sources $$(word 1, $$(S5))
87 @printf ' %-7s %4i' Objects $$(word 2, $$(S5))
90 @printf '\x1B[1;40;32m'
91 @printf '%-8s %6i' Theorems $$(P1)
92 @printf ' %-8s %3i' Lemmas $$(P2)
93 @printf ' %-7s %4i' Facts $$(P3)
94 @printf ' %-6s %4i' Proofs $$(P4)
96 @printf '\x1B[1;40;33m'
97 @printf '%-8s %6i' Declared $$(C1)
98 @printf ' %-8s %3i' Defined $$(C2)
101 @printf '\x1B[1;40;31m'
102 @printf '%-8s %6i' Axioms $$(M1)
103 @printf ' %-8s %3i' Comments $$(M2)
104 @printf ' %-7s %4i' Marks $$(M3)
109 $(foreach PKG, $(PACKAGES), $(eval $(call STATS_TEMPLATE,$(PKG))))
113 # summary ####################################################################
115 define SUMMARY_TEMPLATE
116 TBL_$(1) := $(1)/$(1)_sum.tbl
119 $$(TBL_$(1)): S1 := $$(shell ls $$(MAS_$(1)) | wc -l)
120 $$(TBL_$(1)): S2 := $$(shell $$(MAC_DIR)/$$(MAC) $$(MAS_$(1)))
121 $$(TBL_$(1)): S3 := $$(shell $$(PRB_DIR)/$$(PRB) $$(PRB_OPTS)$(1)/ -i)
122 $$(TBL_$(1)): C1 := $$(shell grep "inductive \|record " $$(MAS_$(1)) | wc -l)
123 $$(TBL_$(1)): C2 := $$(shell grep "definition \|let rec " $$(MAS_$(1)) | wc -l)
124 $$(TBL_$(1)): C3 := $$(shell grep "inductive \|record \|definition \|let rec " $$(MAS_$(1)) | wc -l)
125 $$(TBL_$(1)): P1 := $$(shell grep "theorem " $$(MAS_$(1)) | wc -l)
126 $$(TBL_$(1)): P2 := $$(shell grep "lemma " $$(MAS_$(1)) | wc -l)
127 $$(TBL_$(1)): P3 := $$(shell grep "lemma \|theorem " $$(MAS_$(1)) | wc -l)
129 $$(TBL_$(1)): $$(MAS_$(1))
130 @printf ' SUMMARY $(1)\n'
131 @printf 'name "$$(basename $$(@F))"\n\n' > $$@
132 @printf 'table {\n' >> $$@
133 @printf ' class "grey" [ "category"\n' >> $$@
134 @printf ' [ "objects" * ]\n' >> $$@
135 @printf ' ]\n' >> $$@
136 @printf ' class "cyan" [ "sizes"\n' >> $$@
137 @printf ' [ "files" "$$(S1)" ]\n' >> $$@
138 @printf ' [ "characters" "$$(S2)" ]\n' >> $$@
139 @printf ' [ "nodes" "$$(S3)" ]\n' >> $$@
140 @printf ' ]\n' >> $$@
141 @printf ' class "green" [ "propositions"\n' >> $$@
142 @printf ' [ "theorems" "$$(P1)" ]\n' >> $$@
143 @printf ' [ "lemmas" "$$(P2)" ]\n' >> $$@
144 @printf ' [ "total" "$$(P3)" ]\n' >> $$@
145 @printf ' ]\n' >> $$@
146 @printf ' class "yellow" [ "concepts"\n' >> $$@
147 @printf ' [ "declared" "$$(C1)" ]\n' >> $$@
148 @printf ' [ "defined" "$$(C2)" ]\n' >> $$@
149 @printf ' [ "total" "$$(C3)" ]\n' >> $$@
150 @printf ' ]\n' >> $$@
151 @printf '}\n\n' >> $$@
152 @printf 'class "component" { 0 }\n\n' >> $$@
153 @printf 'class "plane" { 1 } { 3 } { 5 }\n\n' >> $$@
154 @printf 'class "number" { 2 } { 4 } { 6 }\n\n' >> $$@
157 $(foreach PKG, $(PACKAGES), $(eval $(call SUMMARY_TEMPLATE,$(PKG))))