Makefile 1.57 KB
Newer Older
Benoit Viguier's avatar
Benoit Viguier committed
1
2
DIST=coq-verif-tweetnacl

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# 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"
#
# all: coq-tweetnacl-spec coq-tweetnacl-vst

include coq.mk
Benoit Viguier's avatar
Benoit Viguier committed
19

Benoit Viguier's avatar
Benoit Viguier committed
20
.PHONY: clean
Benoit Viguier's avatar
Benoit Viguier committed
21
22
23
clean: clean-spec clean-vst clean-dist

# build paper
Benoit Viguier's avatar
Benoit Viguier committed
24
.PHONY: paper
Benoit Viguier's avatar
Benoit Viguier committed
25
paper:
26
	@cd paper && $(MAKE)
Benoit Viguier's avatar
Benoit Viguier committed
27
28
29
30
31
32

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

# generate artefact
$(DIST):
Benoit Viguier's avatar
Benoit Viguier committed
33
	@echo $(BOLD)$(ORANGE)"Creating $(DIST)"$(NO_COLOR)$(DARKGRAY)
Benoit Viguier's avatar
Benoit Viguier committed
34
35
	mkdir $(DIST)

Benoit Viguier's avatar
Benoit Viguier committed
36
37
38
39
40
$(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

41
dist: clean-dist $(DIST) $(DIST)/specs_map.pdf
Benoit Viguier's avatar
Benoit Viguier committed
42
	@echo $(BOLD)$(YELLOW)"Preparing $(DIST)"$(NO_COLOR)$(DARKGRAY)
Benoit Viguier's avatar
Benoit Viguier committed
43
44
45
46
47
48
49
50
51
	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)/
52
	cp coq.mk $(DIST)/Makefile
Benoit Viguier's avatar
Benoit Viguier committed
53
	cp opam $(DIST)/
Benoit Viguier's avatar
Benoit Viguier committed
54
	@echo $(BOLD)$(LIGHTPURPLE)"Building $(DIST).tar.gz"$(NO_COLOR)$(DARKGRAY)
Benoit Viguier's avatar
Benoit Viguier committed
55
	tar -czvf $(DIST).tar.gz $(DIST)
Benoit Viguier's avatar
Benoit Viguier committed
56
	@echo $(BOLD)$(GREEN)"Done."$(NO_COLOR)
Benoit Viguier's avatar
Benoit Viguier committed
57

Benoit Viguier's avatar
Benoit Viguier committed
58
59
clean-dist:
	@echo $(BOLD)$(YELLOW)"removing $(DIST)"$(NO_COLOR)$(DARKGRAY)
60
61
	-rm -r $(DIST)
	-rm $(DIST).tar.gz
Benoit Viguier's avatar
Benoit Viguier committed
62
	@echo $(BOLD)$(GREEN)"Done."$(NO_COLOR)