Makefile 2.93 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)
benoit's avatar
benoit committed
3
REVIEWS := $(filter-out _reviews.tex,$(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
22
all: tweetverif.pdf reviews.pdf


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

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

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

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

benoit's avatar
benoit committed
40
# generate diff between verified code and reference code
41
42
43
44
45
46
47
48
49
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
50
51
52



Benoit Viguier's avatar
Benoit Viguier committed
53
clean:
Benoit Viguier's avatar
Benoit Viguier committed
54
	@echo $(BOLD)$(RED)"cleaning..."$(NO_COLOR)
Benoit Viguier's avatar
done    
Benoit Viguier committed
55
	@rm -fr latex.out 2> /dev/null || true
benoit's avatar
benoit committed
56
57
	@rm tweetverif.pdf 2> /dev/null || true
	@rm reviews.pdf 2> /dev/null || true
Benoit Viguier's avatar
Benoit Viguier committed
58
	@rm *.aux 2> /dev/null || true
Benoit Viguier's avatar
Benoit Viguier committed
59
60
61
62
63
64
65
	@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
66
	@rm *.out 2> /dev/null || true
Benoit Viguier's avatar
Benoit Viguier committed
67
	@rm *.bck 2> /dev/null || true
Benoit Viguier's avatar
Benoit Viguier committed
68
	@rm *.bak 2> /dev/null || true
Benoit Viguier's avatar
Benoit Viguier committed
69
	@rm */*.aux 2> /dev/null || true
Benoit Viguier's avatar
Benoit Viguier committed
70
	@rm tweetverif.tex 2> /dev/null || true
71
	@rm tweetnacl.diff 2> /dev/null || true
benoit's avatar
benoit committed
72
	@rm _reviews.tex 2> /dev/null || true
Benoit Viguier's avatar
Benoit Viguier committed
73

benoit's avatar
benoit committed
74
# CHECK SPELLING
Benoit Viguier's avatar
Benoit Viguier committed
75
spell:
Benoit Viguier's avatar
Benoit Viguier committed
76
	@for f in $(TEX) ; do \
Benoit Viguier's avatar
aspell    
Benoit Viguier committed
77
78
		aspell -t -c $$f; \
	done
benoit's avatar
benoit committed
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


# 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

reviews.pdf: FORCE _reviews.tex _tpl_reviews.tex $(REVIEWS)
	@echo $(BOLD)$(LIGHTPURPLE)"Building reviews.pdf"$(NO_COLOR)$(DARKGRAY)
	python3 latexrun.py _reviews.tex
	@mv _reviews.pdf reviews.pdf
	
_reviews.tex: FORCE _tpl_reviews.tex $(REVIEWS)
	@echo $(BOLD)$(YELLOW)"Generating _reviews.tex"$(NO_COLOR)$(DARKGRAY)
	python3 gen_reviews.py _reviews.tex


# 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