]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/Makefile
- nUri : added Sets of uris for use in "probe"
[helm.git] / matita / matita / contribs / lambdadelta / Makefile
1 OPEN = (
2
3 H        = @
4 XOA_DIR  = ../../../components/binaries/xoa
5 XOA      = xoa.native
6 DEP_DIR  = ../../../components/binaries/matitadep
7 DEP      = matitadep.native
8 MAC_DIR  = ../../../components/binaries/mac
9 MAC      = mac.native
10 PRB_DIR  = ../../../components/binaries/probe
11 PRB      = probe.native
12 PRB_OPTS = ../../matita.conf.xml -g
13
14 XOA_CONF    = ground_2/xoa.conf.xml
15 XOA_TARGETS = ground_2/xoa_notation.ma ground_2/xoa.ma
16
17 ORIG     = . ./orig.sh 
18
19 ORIGS    = basic_2/basic_1.orig
20
21 PACKAGES = ground_2 basic_2 apps_2
22
23 all:
24         ../../matitac.opt
25
26 # MAS ########################################################################
27
28 define MAS_TEMPLATE
29   MAS_$(1) := $$(shell find $(1) -name "*.ma")
30   MAS      += $$(MAS_$(1))
31 endef
32
33 $(foreach PKG, $(PACKAGES), $(eval $(call MAS_TEMPLATE,$(PKG))))
34
35 # xoa ########################################################################
36
37 xoa: $(XOA_TARGETS)
38
39 $(XOA_TARGETS): $(XOA_CONF)
40         @echo "  EXEC $(XOA) $(XOA_CONF)"
41         $(H)MATITA_RT_BASE_DIR=../.. $(XOA_DIR)/$(XOA) $(XOA_CONF)
42
43 # orig #######################################################################
44
45 orig: $(ORIGS)
46         @echo "  ORIG basic_2"
47         $(H)$(ORIG) basic_2 < $(ORIGS)
48
49 # dep ########################################################################
50
51 deps: $(DEP_DIR)/$(DEP)
52         @echo "  MATITADEP"
53         $(H)grep "include \"" $(MAS) | $<
54
55 # stats ######################################################################
56
57 define STATS_TEMPLATE
58   STT_$(1) := $(1).stats
59   STTS     += $$(STT_$(1))
60
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)
74
75 $$(STT_$(1)):
76         @printf '\x1B[1;40;37m'
77         @printf '%-15s %-44s' 'Statistics for:' $(1)
78         @printf '\x1B[0m\n'
79         @printf '\x1B[1;40;35m'
80         @printf '%-8s %6i' Chars $$(S1)
81         @printf '   %-8s %4i' Pages $$(S2)
82         @printf '   %-26s' ''
83         @printf '\x1B[0m\n'
84         @printf '\x1B[1;40;36m'
85         @printf '%-8s %6i' Files $$(S4)
86         @printf '   %-8s %4i' Sources $$(word 1, $$(S5))        
87         @printf '   %-7s %4i' Objects $$(word 2, $$(S5))
88         @printf '   %-11s' ''
89         @printf '\x1B[0m\n'     
90         @printf '\x1B[1;40;32m'
91         @printf '%-8s %6i' Theorems $$(P1)
92         @printf '   %-8s %4i' Lemmas $$(P2)
93         @printf '   %-7s %4i' Facts $$(P3)
94         @printf '   %-6s %4i' Proofs $$(P4)
95         @printf '\x1B[0m\n'     
96         @printf '\x1B[1;40;33m'
97         @printf '%-8s %6i' Declared $$(C1)
98         @printf '   %-8s %4i' Defined $$(C2)    
99         @printf '   %-26s' ''
100         @printf '\x1B[0m\n'
101         @printf '\x1B[1;40;31m'
102         @printf '%-8s %6i' Axioms $$(M1)
103         @printf '   %-8s %4i' Comments $$(M2)
104         @printf '   %-7s %4i' Marks $$(M3)
105         @printf '   %-11s' ''
106         @printf '\x1B[0m\n'
107 endef
108
109 ifeq ($(MAKECMDGOALS), stats)
110    $(foreach PKG, $(PACKAGES), $(eval $(call STATS_TEMPLATE,$(PKG))))
111 endif
112
113 stats: $(STTS)
114
115 # summary ####################################################################
116
117 define SUMMARY_TEMPLATE
118   TBL_$(1) := $(1)/$(1)_sum.tbl  
119   TBLS     += $$(TBL_$(1))
120
121   $$(TBL_$(1)): S1 := $$(shell ls $$(MAS_$(1)) | wc -l)
122   $$(TBL_$(1)): S2 := $$(shell $$(MAC_DIR)/$$(MAC) $$(MAS_$(1)))
123   $$(TBL_$(1)): S3 := $$(shell $$(PRB_DIR)/$$(PRB) $$(PRB_OPTS) $(1) -i)
124   $$(TBL_$(1)): C1 := $$(shell grep "inductive \|record " $$(MAS_$(1)) | wc -l)
125   $$(TBL_$(1)): C2 := $$(shell grep "definition \|let rec " $$(MAS_$(1)) | wc -l)
126   $$(TBL_$(1)): C3 := $$(shell grep "inductive \|record \|definition \|let rec " $$(MAS_$(1)) | wc -l)
127   $$(TBL_$(1)): P1 := $$(shell grep "theorem " $$(MAS_$(1)) | wc -l)
128   $$(TBL_$(1)): P2 := $$(shell grep "lemma " $$(MAS_$(1)) | wc -l)
129   $$(TBL_$(1)): P3 := $$(shell grep "lemma \|theorem " $$(MAS_$(1)) | wc -l)
130
131   $$(TBL_$(1)): $$(MAS_$(1))
132         @printf '  SUMMARY $(1)\n'
133         @printf 'name "$$(basename $$(@F))"\n\n'       >  $$@
134         @printf 'table {\n'                            >> $$@
135         @printf '   class "grey" [ "category"\n'       >> $$@
136         @printf '      [ "objects" * ]\n'              >> $$@
137         @printf '   ]\n'                               >> $$@
138         @printf '   class "cyan" [ "sizes"\n'          >> $$@
139         @printf '      [ "files" "$$(S1)" ]\n'         >> $$@
140         @printf '      [ "characters" "$$(S2)" ]\n'    >> $$@
141         @printf '      [ "nodes" "$$(S3)" ]\n'         >> $$@
142         @printf '   ]\n'                               >> $$@   
143         @printf '   class "green" [ "propositions"\n'  >> $$@
144         @printf '      [ "theorems" "$$(P1)" ]\n'      >> $$@
145         @printf '      [ "lemmas"   "$$(P2)" ]\n'      >> $$@
146         @printf '      [ "total"    "$$(P3)" ]\n'      >> $$@
147         @printf '   ]\n'                               >> $$@
148         @printf '   class "yellow" [ "concepts"\n'     >> $$@
149         @printf '      [ "declared" "$$(C1)" ]\n'      >> $$@
150         @printf '      [ "defined"  "$$(C2)" ]\n'      >> $$@
151         @printf '      [ "total"    "$$(C3)" ]\n'      >> $$@
152         @printf '   ]\n'                               >> $$@
153         @printf '}\n\n'                                >> $$@
154         @printf 'class "component" { 0 }\n\n'          >> $$@
155         @printf 'class "plane" { 1 } { 3 } { 5 }\n\n'  >> $$@
156         @printf 'class "number" { 2 } { 4 } { 6 }\n\n' >> $$@
157 endef
158
159 ifeq ($(MAKECMDGOALS), tbls)
160    $(foreach PKG, $(PACKAGES), $(eval $(call SUMMARY_TEMPLATE,$(PKG))))
161 endif
162
163 tbls: $(TBLS)