-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
71 lines (52 loc) · 2.87 KB
/
Makefile
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
today: 20180627_report.md 20180627_deltareport.md
all: 20180627_report.md 20180627_deltareport.md \
20180621_report.md 20180621_deltareport.md \
20180618_report.md 20180618_deltareport.md \
20180615_report.md 20180615_deltareport.md \
20180614_report.md 20180614_deltareport.md \
20180613_report.md 20180613_deltareport.md \
20180612_report.md 20180612_deltareport.md \
20180611_report.md 20180611_deltareport.md \
20180610_report.md 20180610_deltareport.md \
20180609_report.md 20180609_deltareport.md \
20180608_report.md 20180608_deltareport.md \
20180607_report.md 20180607_deltareport.md \
20180606_report.md 20180606_deltareport.md \
20180605_4_report.md 20180605_4_deltareport.md \
20180605_1_report.md
# Prevent make from deleting any of the intermediate files
.SECONDARY:
%_ballotimage.txt:
wget http://www.sfelections.org/results/20180605/data/$(@:_ballotimage.txt=)/$@
%_masterlookup.txt:
wget http://www.sfelections.org/results/20180605/data/$(@:_masterlookup.txt=)/$@
%_data.json: %_ballotimage.txt %_masterlookup.txt
node parse.js $(@:_data.json=) > $@
%.sqlite3: %_data.json
node tosqlite.js $< $@
%_analysis.json: %_data.json
node analyze.js $< > $@
%_report.md: %.sqlite3
./generatereport.sh $^ > $@
20180615_deltareport.md: 20180615.sqlite3 20180614.sqlite3
./generatereport.sh $< `echo 'SELECT MAX(id) FROM ballots' | sqlite3 20180614.sqlite3` > $@
20180614_deltareport.md: 20180614.sqlite3 20180613.sqlite3
./generatereport.sh $< `echo 'SELECT MAX(id) FROM ballots' | sqlite3 20180613.sqlite3` > $@
20180613_deltareport.md: 20180613.sqlite3 20180612.sqlite3
./generatereport.sh $< `echo 'SELECT MAX(id) FROM ballots' | sqlite3 20180612.sqlite3` > $@
20180612_deltareport.md: 20180612.sqlite3 20180611.sqlite3
./generatereport.sh $< `echo 'SELECT MAX(id) FROM ballots' | sqlite3 20180611.sqlite3` > $@
20180611_deltareport.md: 20180611.sqlite3 20180610.sqlite3
./generatereport.sh $< `echo 'SELECT MAX(id) FROM ballots' | sqlite3 20180610.sqlite3` > $@
20180610_deltareport.md: 20180610.sqlite3 20180609.sqlite3
./generatereport.sh $< `echo 'SELECT MAX(id) FROM ballots' | sqlite3 20180609.sqlite3` > $@
20180609_deltareport.md: 20180609.sqlite3 20180608.sqlite3
./generatereport.sh $< `echo 'SELECT MAX(id) FROM ballots' | sqlite3 20180608.sqlite3` > $@
20180608_deltareport.md: 20180608.sqlite3 20180607.sqlite3
./generatereport.sh $< `echo 'SELECT MAX(id) FROM ballots' | sqlite3 20180607.sqlite3` > $@
20180607_deltareport.md: 20180607.sqlite3 20180606.sqlite3
./generatereport.sh $< `echo 'SELECT MAX(id) FROM ballots' | sqlite3 20180606.sqlite3` > $@
20180606_deltareport.md: 20180606.sqlite3 20180605_4.sqlite3
./generatereport.sh $< `echo 'SELECT MAX(id) FROM ballots' | sqlite3 20180605_4.sqlite3` > $@
20180605_4_deltareport.md: 20180605_4.sqlite3 20180605_1.sqlite3
./generatereport.sh $< `echo 'SELECT MAX(id) FROM ballots' | sqlite3 20180605_1.sqlite3` > $@