-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
67 lines (56 loc) · 1.68 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
OTT=../tools/ott/bin/ott
OTTCOQ=../tools/ott/coq
COQC=coqc -I $(OTTCOQ)
COQDEP=coqdep
IsaOttTargets=Handlers.thy HandlersEx.thy Types.thy
CoqOttTargets=Handlers.v HandlersEx.v Types.v
CoqSources=HandlersResults.v TypesResults.v $(CoqOttTargets)
CoqVoTargets=$(patsubst %.v,%.vo,$(CoqSources))
CoqGlobs=$(patsubst %.v,%.glob,$(CoqSources))
.PHONY: all all-isa clean
all: all-isa-ott all-coq Handlers.pdf Types.pdf
all-isa-ott: $(IsaOttTargets)
all-coq-ott: $(CoqOttTargets)
all-coq: all-coq-ott $(CoqVoTargets)
clean:
rm -f \
$(IsaOttTargets) \
$(CoqOttTargets) $(CoqVoTargets) $(CoqGlobs) coq.deps
# Fixes some old Isabelle syntax, plus an issue with the substitution function
# generation I don't quite understand
Handlers.thy: Handlers.ott
$(OTT) $^ -o $@
sed \
-e 's/types /type_synonym /' \
-e 's/: set \[\([^]]*\)] @ \[\([^]]*\)]/: set ([\1] @ [\2])/' \
< $@ > $@.out
mv $@.out $@
Types.thy: Handlers.ott Types.ott
$(OTT) $^ -o $@
sed \
-e 's/types /type_synonym /' \
-e 's/: set \[\([^]]*\)] @ \[\([^]]*\)]/: set ([\1] @ [\2])/' \
< $@ > $@.out
mv $@.out $@
Handlers.v: Handlers.ott
$(OTT) $^ -o $@
Types.v: Handlers.ott Types.ott
$(OTT) $^ -o $@
Handlers.tex: Handlers.ott
$(OTT) $^ -o $@
Types.tex: Handlers.ott Types.ott
$(OTT) $^ -o $@
%.pdf: %.tex
pdflatex $<
%.thy: %.thy.in
$(OTT) $(filter %.ott,$^) -isa_filter $< $@
%.v: %.v.in
$(OTT) $(filter %.ott,$^) -coq_filter $< $@
%.vo: %.v
$(COQC) $<
# Manually say which files should be filtered with which ott rules
HandlersEx.thy: Handlers.ott
HandlersEx.v: Handlers.ott
coq.deps: $(CoqSources) Makefile
$(COQDEP) -I . $^ > coq.deps
-include coq.deps