Makefile 2.18 KB
Newer Older
Benoit Viguier's avatar
Benoit Viguier committed
1
DIST=coq-verif-tweetnacl
Benoit Viguier's avatar
Benoit Viguier committed
2
3
4
5
6
7
8
9
10
11
12
13
NO_COLOR="\033[0m"
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"
BRIGHTRED = "\033[91m"
BOLD = "\033[1m"
Benoit Viguier's avatar
Benoit Viguier committed
14
15
16

all: coq-tweetnacl-spec coq-tweetnacl-vst

Benoit Viguier's avatar
Benoit Viguier committed
17

Benoit Viguier's avatar
Benoit Viguier committed
18
19
20
21
22
23
24
25
readme:
	less README.md


# DEFINE GENERIC ROUTINES (hidden via . prefix)
.configure1 .configure2:
	cd $P && $(SHELL) configure.sh

26
27
.building1: .configure1
.building2: .configure2
Benoit Viguier's avatar
Benoit Viguier committed
28
.building1 .building2:
29
	cd $P && $(MAKE) -j all
Benoit Viguier's avatar
Benoit Viguier committed
30
31
	cd $P && $(MAKE) install

32
33
.dusting1: .configure1
.dusting2: .configure2
Benoit Viguier's avatar
Benoit Viguier committed
34
35
36
37
38
39
40
41
.dusting1 .dusting2:
	cd $P && $(MAKE) clean
	cd $P && rm _CoqProject
	cd $P && rm Makefile
	cd $P && rm Makefile.conf

# DEFINE REAL TARGETS
coq-tweetnacl-spec: P=proofs/spec
42
coq-tweetnacl-spec: .building1
Benoit Viguier's avatar
Benoit Viguier committed
43
44

clean-spec: P=proofs/spec
45
clean-spec: .dusting1
Benoit Viguier's avatar
Benoit Viguier committed
46
47

coq-tweetnacl-vst: P=proofs/vst
48
coq-tweetnacl-vst: coq-tweetnacl-spec .building2
Benoit Viguier's avatar
Benoit Viguier committed
49
50

clean-vst: P=proofs/vst
51
clean-vst: .dusting2
Benoit Viguier's avatar
Benoit Viguier committed
52

Benoit Viguier's avatar
Benoit Viguier committed
53
.PHONY: clean
Benoit Viguier's avatar
Benoit Viguier committed
54
55
56
clean: clean-spec clean-vst clean-dist

# build paper
Benoit Viguier's avatar
Benoit Viguier committed
57
.PHONY: paper
Benoit Viguier's avatar
Benoit Viguier committed
58
59
60
61
62
63
64
65
paper:
	cd paper && $(MAKE)

clean-paper:
	cd paper && $(MAKE) clean

# generate artefact
$(DIST):
Benoit Viguier's avatar
Benoit Viguier committed
66
	@echo $(BOLD)$(ORANGE)"Creating $(DIST)"$(NO_COLOR)$(DARKGRAY)
Benoit Viguier's avatar
Benoit Viguier committed
67
68
	mkdir $(DIST)

Benoit Viguier's avatar
Benoit Viguier committed
69
70
71
72
73
74
75
$(DIST)/specs_map.pdf:
	@echo $(BOLD)$(YELLOW)"Building map for specs"$(NO_COLOR)$(DARKGRAY)
	cd paper && $(MAKE) specs_map.pdf
	mv specs_map.pdf $(DIST)/specs_map.pdf

dist: $(DIST) $(DIST)/specs_map.pdf
	@echo $(BOLD)$(YELLOW)"Preparing $(DIST)"$(NO_COLOR)$(DARKGRAY)
Benoit Viguier's avatar
Benoit Viguier committed
76
77
78
79
80
81
82
83
84
85
	cp -r proofs $(DIST)
	mkdir $(DIST)/packages
	cp -r packages/coq-compcert $(DIST)/packages/
	cp -r packages/coq-reciprocity $(DIST)/packages/
	cp -r packages/coq-ssr-elliptic-curves $(DIST)/packages/
	cp -r packages/coq-vst $(DIST)/packages/
	cp repo $(DIST)/
	cp version $(DIST)/
	cp README.md $(DIST)/
	cp Makefile $(DIST)/
Benoit Viguier's avatar
Benoit Viguier committed
86
	cp opam $(DIST)/
Benoit Viguier's avatar
Benoit Viguier committed
87
	@echo $(BOLD)$(LIGHTPURPLE)"Building $(DIST).tar.gz"$(NO_COLOR)$(DARKGRAY)
Benoit Viguier's avatar
Benoit Viguier committed
88
	tar -czvf $(DIST).tar.gz $(DIST)
Benoit Viguier's avatar
Benoit Viguier committed
89
	@echo $(BOLD)$(GREEN)"Done."$(NO_COLOR)
Benoit Viguier's avatar
Benoit Viguier committed
90

Benoit Viguier's avatar
Benoit Viguier committed
91
92
clean-dist:
	@echo $(BOLD)$(YELLOW)"removing $(DIST)"$(NO_COLOR)$(DARKGRAY)
Benoit Viguier's avatar
Benoit Viguier committed
93
	rm -r $(DIST)
Benoit Viguier's avatar
Benoit Viguier committed
94
95
	rm $(DIST).tar.gz
	@echo $(BOLD)$(GREEN)"Done."$(NO_COLOR)