-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
112 lines (83 loc) · 2.6 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
## Coq commands: override this variable
#COQBIN=$(HOME)/CONSTR/V8/bin/
COQC=$(COQBIN)coqc $(COQFLAGS)
COQ=$(COQBIN)coqtop $(COQFLAGS) -batch
COQDEP=$(COQBIN)coqdep -c
COQDOC=$(COQBIN)coqdoc
COQMK=$(COQBIN)coq_makefile
OPT=-opt
COQFLAGS=-q $(OPT) $(COQINCLUDES)
COQINCLUDES=-I .
ALLV=$(shell ls *.v)
ALLVO=$(ALLV:.v=.vo)
#COCVO = ModelHF.vo ModelZF.vo ModelECC.vo ZFindtypes.vo EnsUniv.vo ZF1.vo
ALLHTML = $(ALLV:%.v=html/%.html)
ALLHTMLFULL = $(ALLV:%.v=html/full/%.html)
all:: coq
coq:: $(ALLVO)
DOCHTML=$(shell cat libs.txt graph/staticlibs.txt)
DOCV=$(DOCHTML:.html=.v)
#DOCV=$(shell sed -n -e "s|.*HREF=\"\([^\./\"]\+\)\.html\".*|\1.v|p" template/html/index.html)
DOCVO=$(DOCV:.v=.vo)
ALLV:=$(DOCV)
doc:: $(DOCV:.v=.vo)
.PHONY: html dist-v graph doc
dist-v::
rm -fr cic-model
mkdir cic-model
cp $(DOCV) template/Make cic-model/
mkdir cic-model/template
cp template/Library.v cic-model/template/
echo $(DOCV) >> cic-model/Make
(cd cic-model && $(COQMK) -f Make > Makefile)
tar zcvf cic-model.tgz cic-model
(cd cic-model && $(MAKE) && $(MAKE) clean)
dist-html:: $(DOCVO)
rm -fr html
mkdir html
$(MAKE) html
html::
mkdir -p html/full
$(COQDOC) -utf8 -html -d html -g --coqlib http://coq.inria.fr/stdlib template/coqdoc.v $(ALLV)
$(COQDOC) -utf8 -html -d html/full --coqlib http://coq.inria.fr/stdlib template/coqdoc.v $(ALLV)
mv html/index.html html/coqindex.html
/bin/cp template/html/*.* html/
/bin/cp template/html/full/*.* html/full/
/bin/cp html/coqdoc.css html/full/
perl -pi -e "s/(<div id=\"header\">)/\1<script src=\"headings.js\"><\/script>/" $(ALLHTML) $(ALLHTMLFULL)
graph:: graph/deps.png graph/deps.imap graph/graph.html
#graph/deps.g: .depend libs.txt graph/staticlibs.txt
# cat libs.txt graph/staticlibs.txt \
# | graph/graph.sh lib2graph > $@
#graph/deps.dot: graph/deps.g
# graph/graph.sh graph2dot graph/deps.g > $@
graph/deps-raw.dot: .depend libs.txt
cat libs.txt | graph/graph.sh lib2graph > $@
graph/deps.dot: graph/deps-raw.dot
tred $< > $@
.dot.png:
dot -Tpng $< > $@
.dot.imap:
dot -Tcmapx $< > $@
graph/graph.html: graph/g.html graph/deps.imap graph/deps.png
sed -e "/--IMAP--/ r graph/deps.imap" graph/g.html > $@
Ens0.v: Ens.v
cp Ens.v Ens0.v
EnsEm0.v: EnsEm.v
cp EnsEm.v EnsEm0.v
.SUFFIXES: .v .vo .ml .mli .cmo .cmi .html .dot .imap .png
.ml.cmo:
$(CAMLC) -pp "camlp5o pa_oop.cmo" $<
.mli.cmi:
$(CAMLC) $<
.v.vo:
$(COQC) $<
clean::
rm -f *~ *.vo *.glob *.cm* *.o Ens0.v
rm -fr html
depend:: Ens0.v
rm -f .depend .depend-html
$(COQDEP) -c $(COQINCLUDES) *.v *.ml > .depend
$(COQDEP) -suffix .html $(COQINCLUDES) *.v >> .depend-html
-include .depend
-include .depend-html