-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
93 lines (74 loc) · 2.41 KB
/
Copy pathMakefile
File metadata and controls
93 lines (74 loc) · 2.41 KB
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
86
87
88
89
90
91
92
93
SHELL := /bin/bash
start: exits
@./check
collector_url = ${COLLECTOR_HOST}/recent/
consensuses_dir = relay-descriptors/consensuses/
#exit_lists_dir = exit-lists/
descriptors_dir = relay-descriptors/server-descriptors/
data/:
@mkdir -p data
data/descriptors/: data/
@mkdir -p data/descriptors
data/consensuses/: data/
@mkdir -p data/consensuses
#data/exit-lists/: data/
# @mkdir -p data/exit-lists
data/consensus: data/consensuses/
@echo "Getting latest consensus documents"
@find data/consensuses -type f -mtime +31 | xargs rm -f
@pushd data/consensuses/; \
wget -r -nH -nd -nc --no-parent --reject "index.html*" \
$(collector_url)$(consensuses_dir); \
popd
@echo Consensuses written
#TODO - exit-addresses is based on TorDNSEL, which is not working now. All TorDNSEL code is commented out
#data/exit-addresses: data/exit-lists/
# @echo "Getting latest exit lists"
# @find data/exit-lists -mtime +31 | xargs rm -f
# @pushd data/exit-lists/; \
# wget -r -nH -nd -nc --no-parent --reject "index.html*" \
# $(collector_url)$(exit_lists_dir); \
# popd
# @echo Exit lists written
descriptors: data/descriptors/
@echo "Getting latest descriptors (This may take a while)"
@find data/descriptors -type f -mtime +31 | xargs rm -f
@pushd data/descriptors/; \
wget -r -nH -nd -nc --no-parent --reject "index.html*" \
$(collector_url)$(descriptors_dir); \
popd
@echo Done
data/cached-descriptors: descriptors
@echo "Concatenating data/descriptors/* into data/cached-descriptors"
@rm -f data/cached-descriptors
find data/descriptors -type f -mmin -60 | xargs cat > data/cached-descriptors
@echo "Done"
exits: data/consensus data/cached-descriptors # data/exit-addresses
@echo Generating exit-policies file
@python3 scripts/exitips.py
@echo Done
data/langs: data/
curl -k https://www.transifex.com/api/2/languages/ > data/langs
build:
go build
# Add -i for installing latest version, -v for verbose
test: build
! gofmt -l . 2>&1 | read
go vet
go test -v -run "$(filter)"
cover: build
go test -coverprofile cover.out
filter?=.
bench: build
go test -i
go test -benchtime 10s -bench "$(filter)" -benchmem
profile: build
go test \
-cpuprofile ../../cpu.prof \
-memprofile ../../mem.prof \
-benchtime 40s -bench "$(filter)"
install: build
mv check /usr/local/bin/check
cp scripts/check.init /etc/init.d/check
update-rc.d check defaults
.PHONY: start build i18n exits test bench cover profile descriptors install