-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
55 lines (43 loc) · 1.17 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
# Simple makefile
#
# tex_makefile is ugly and will hopefully soon be replaced by Dune.
ivm.vo: coq-record-update ivm.v
coqc -Q coq-record-update/src RecordUpdate -Q . VmSpec -no-glob ivm.v
.PHONY: compile
compile: ivm.vo
.PHONY: coq-record-update
coq-record-update:
$(MAKE) -C coq-record-update
# Detect OS (fails on Windows...)
UNAME_S=$(shell uname -s)
# gsed refers to GNU sed (which has more features that MacOS sed).
ivm_expanded.v: ivm.v
ifeq ($(UNAME_S),Linux)
sed 's/^\[\[$$/\n*)/g' ivm.v | \
sed 's/^\]\]$$/(**/g' > ivm_expanded.v
else # Mac
gsed 's/^\[\[$$/\n*)/g' ivm.v | \
gsed 's/^\]\]$$/(**/g' > ivm_expanded.v
endif
ivm.tex: ivm_expanded.v
coqdoc -q \
--utf8 --latex --short --body-only \
--interpolate --no-externals \
--light \
--output ivm.tex \
ivm_expanded.v
doc.pdf: doc.tex ivm.tex
latexmk -quiet -pdf doc.tex
.PHONY: doc
doc: doc.pdf
.PHONY: all
all: ivm.vo doc.pdf
.PHONY: clean
clean:
$(MAKE) -C coq-record-update clean
rm -f .ivm.aux ivm_expanded.v ivm.tex coqdoc.sty
latexmk -quiet -pdf -c
.PHONY: distclean
distclean: clean
rm -f .lia.cache .nia.cache ivm.glob ivm.vo ivm.vok ivm.vos
latexmk -quiet -pdf -C