This repository has been archived by the owner on Sep 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
85 lines (60 loc) · 1.74 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
# File: Makefile
#
# Author: FireEye, Inc. - Formal Methods Team <[email protected]>
COQINCLUDES=-I .
COQC=coqtop -q $(COQINCLUDES) -batch -compile
COQDOC=coqdoc
COQDEP=coqdep $(COQINCLUDES)
COQFILES=\
MSetWithDups.v \
MSetFoldWithAbort.v \
MSetIntervals.v \
MSetListWithDups.v
#######################################
########## GLOBAL RULES ###############
.DEFAULT_GOAL: all
.PHONY: all coqhtml coqtex clean doc
proof: $(COQFILES:.v=.vo)
doc: coqhtml coqtex doc/main.tex
all: proof doc
#######################################
########## COQ RULES ##################
%.vo %.glob: %.v
$(COQC) $*
%.v.d: %.v
$(COQDEP) "$<" > "$@" || ( RV=$$?; rm -f "$@"; exit $${RV} )
CLEAN_TARGETS := clean clean_doc clean_coq
ifeq (,$(filter $(CLEAN_TARGETS),$(MAKECMDGOALS)))
-include $(addsuffix .d,$(COQFILES))
.SECONDARY: $(addsuffix .d,$(COQFILES))
endif
#######################################
########## DOCUMENTATION #############
coqhtml:
mkdir -p coqdoc
$(COQDOC) -toc --html -g -d coqdoc $(COQFILES)
coqtex:
mkdir -p coqdoc
$(COQDOC) -toc --latex -g -o coqdoc/mset_doc.tex $(COQFILES)
cd coqdoc; pdflatex mset_doc.tex
cd coqdoc; pdflatex mset_doc.tex
%.html: %.md
pandoc -N $< -o $@
%.pdf: %.md
pandoc -N $< -o $@
doc/mset.pdf: doc/mset.tex doc/mset.bib
cd doc; pdflatex mset.tex
cd doc; bibtex mset
cd doc; pdflatex mset.tex
cd doc; pdflatex mset.tex
#######################################
########## CLEANING RULES #############
clean_coq:
rm -f $(COQFILES:.v=.v.d) $(COQFILES:.v=.vo) $(COQFILES:.v=.glob)
clean_doc:
rm -rf coqdoc
rm -f readme.html readme.pdf
clean_tex:
cd doc; rm -f *.ps *~ *.dvi *.aux *.log *.idx *.toc *.nav *.out *.snm *.flc *.vrb *.bbl *.blg
clean: clean_coq clean_doc clean_tex
rm -f *~