Makefile 2.7 KB
Newer Older
1
TEX := $(filter-out tweetverif.tex,$(wildcard *.tex))
Benoit Viguier's avatar
aspell    
Benoit Viguier committed
2
FILES := $(TEX) $(wildcard tikz/*.tex) $(wildcard *.sty)
3
REVIEWS := _reviews.tex $(wildcard _reviews/*.tex) $(wildcard *.sty)
Benoit Viguier's avatar
aspell    
Benoit Viguier committed
4

Benoit Viguier's avatar
Benoit Viguier committed
5
NO_COLOR="\033[0m"
Benoit Viguier's avatar
Benoit Viguier committed
6
7
8
9
10
11
12
13
14
RED = "\033[38;5;009m"
GREEN = "\033[38;5;010m"
YELLOW = "\033[38;5;011m"
ORANGE = "\033[38;5;214m"
LIGHTPURPLE = "\033[38;5;177m"
PURPLE = "\033[38;5;135m"
CYAN = "\033[38;5;014m"
LIGHTGRAY = "\033[38;5;252m"
DARKGRAY = "\033[38;5;242m"
Benoit Viguier's avatar
Benoit Viguier committed
15
16
17
18
BRIGHTRED = "\033[91m"
BOLD = "\033[1m"


benoit's avatar
benoit committed
19
20
21
all: tweetverif.pdf reviews.pdf

# main pdf
22
tweetverif.pdf: FORCE tweetverif.tex tweetnacl.diff
23
	@echo $(BOLD)$(LIGHTPURPLE)"Building tweetverif.pdf"$(NO_COLOR)$(DARKGRAY)
24
25
	python3 latexrun.py tweetverif.tex

benoit's avatar
benoit committed
26
# main tex
27
tweetverif.tex: FORCE $(FILES) collection.bib
Benoit Viguier's avatar
Benoit Viguier committed
28
	@echo $(BOLD)$(YELLOW)"Generating tweetverif.tex"$(NO_COLOR)$(DARKGRAY)
29
	python3 gen.py tweetverif.tex
Benoit Viguier's avatar
Benoit Viguier committed
30

benoit's avatar
benoit committed
31
# list dependencies
Benoit Viguier's avatar
Benoit Viguier committed
32
depend:
Benoit Viguier's avatar
Benoit Viguier committed
33
34
35
	@for f in $(FILES) ; do \
		echo $$f; \
	done
Benoit Viguier's avatar
Benoit Viguier committed
36

37
.PHONY: clean FORCE
Benoit Viguier's avatar
Benoit Viguier committed
38

benoit's avatar
benoit committed
39
# generate diff between verified code and reference code
40
41
42
43
44
45
46
47
48
tweetnacl.diff:
	@echo $(BOLD)$(YELLOW)"Generating tweetnacl.diff"$(NO_COLOR)$(DARKGRAY)
	diff -u ../proofs/vst/c/tweetnacl.c ../proofs/vst/c/tweetnaclVerifiableC.c > tweetnacl.diff.tmp; [ $$? -eq 1 ]
	sed -i -e 1,2d tweetnacl.diff.tmp
	echo '--- tweetnacl.c' >> tweetnacl.diff
	echo '+++ tweetnaclVerifiableC.c' >> tweetnacl.diff
	cat tweetnacl.diff.tmp >> tweetnacl.diff
	rm tweetnacl.diff.tmp

benoit's avatar
benoit committed
49
50
51



Benoit Viguier's avatar
Benoit Viguier committed
52
clean:
Benoit Viguier's avatar
Benoit Viguier committed
53
	@echo $(BOLD)$(RED)"cleaning..."$(NO_COLOR)
Benoit Viguier's avatar
done    
Benoit Viguier committed
54
	@rm -fr latex.out 2> /dev/null || true
benoit's avatar
benoit committed
55
56
	@rm tweetverif.pdf 2> /dev/null || true
	@rm reviews.pdf 2> /dev/null || true
Benoit Viguier's avatar
Benoit Viguier committed
57
	@rm *.aux 2> /dev/null || true
Benoit Viguier's avatar
Benoit Viguier committed
58
59
60
61
62
63
64
	@rm *.bbl 2> /dev/null || true
	@rm *.blg 2> /dev/null || true
	@rm *.brf 2> /dev/null || true
	@rm *.dvi 2> /dev/null || true
	@rm *.fdb_latexmk 2> /dev/null || true
	@rm *.fls 2> /dev/null || true
	@rm *.log 2> /dev/null || true
Benoit Viguier's avatar
Benoit Viguier committed
65
	@rm *.out 2> /dev/null || true
Benoit Viguier's avatar
Benoit Viguier committed
66
	@rm *.bck 2> /dev/null || true
Benoit Viguier's avatar
Benoit Viguier committed
67
	@rm *.bak 2> /dev/null || true
Benoit Viguier's avatar
Benoit Viguier committed
68
	@rm */*.aux 2> /dev/null || true
Benoit Viguier's avatar
Benoit Viguier committed
69
	@rm tweetverif.tex 2> /dev/null || true
70
	@rm tweetnacl.diff 2> /dev/null || true
Benoit Viguier's avatar
Benoit Viguier committed
71

benoit's avatar
benoit committed
72
# CHECK SPELLING
Benoit Viguier's avatar
Benoit Viguier committed
73
spell:
Benoit Viguier's avatar
Benoit Viguier committed
74
	@for f in $(TEX) ; do \
Benoit Viguier's avatar
aspell    
Benoit Viguier committed
75
76
		aspell -t -c $$f; \
	done
benoit's avatar
benoit committed
77
78
79
80
81
82
83
84


# Bunch of other pdfs
feedback.pdf:
	@echo $(BOLD)$(LIGHTPURPLE)"Building feedback.pdf"$(NO_COLOR)$(DARKGRAY)
	python3 latexrun.py _includes/_feedback.tex
	@mv _feedback.pdf feedback.pdf

85
reviews.pdf: FORCE _reviews.tex $(REVIEWS)
benoit's avatar
benoit committed
86
87
88
89
90
91
92
93
94
95
96
97
	@echo $(BOLD)$(LIGHTPURPLE)"Building reviews.pdf"$(NO_COLOR)$(DARKGRAY)
	python3 latexrun.py _reviews.tex
	@mv _reviews.pdf reviews.pdf
	
# SPEC MAPS
specs_map.pdf: FORCE _files.tex
	@echo $(BOLD)$(LIGHTPURPLE)"Building specs_map.pdf"$(NO_COLOR)$(DARKGRAY)
	python3 latexrun.py _files.tex
	@echo $(BOLD)$(ORANGE)"Moving specs_map.pdf to ../"$(NO_COLOR)$(DARKGRAY)
	@mv _files.pdf ../specs_map.pdf