-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (31 loc) · 1.33 KB
/
Makefile
File metadata and controls
50 lines (31 loc) · 1.33 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
-include local.makefile
DATAURL := https://covid19.who.int/WHO-COVID-19-global-data.csv
R = Rscript $^ $@
REFDIR ?= .
IDIR := ${REFDIR}/input
ODIR := ${REFDIR}/output
ISOS := $(shell cat ${IDIR}/isos.csv)
default: ${IDIR}/isos.csv figures
figures: $(patsubst %,${ODIR}/figures/cases/%.png,${ISOS}) $(patsubst %,${ODIR}/figures/deaths/%.png,${ISOS}) $(patsubst %,${ODIR}/figures/both/%.png,${ISOS})
clean:
rm raw_epi_data.csv epi_data.rds
${IDIR} ${ODIR} ${ODIR}/figures/cases ${ODIR}/figures/deaths ${ODIR}/figures/both ${ODIR}/rt:
mkdir -p $@
${IDIR}/raw_epi_data.csv: | ${IDIR}
wget -c -O $@ ${DATAURL}
${IDIR}/epi_data.rds: gen_clean_epi_data.R ${IDIR}/raw_epi_data.csv | ${IDIR}
${R}
${IDIR}/isos.csv: gen_isos.R ${IDIR}/epi_data.rds
${R}
${IDIR}/plot_elements.rda: gen_plot_elements.R
${R}
${ODIR}/africa.png: fig_case_series.R ${IDIR}/epi_data.rds | ${ODIR}
${R}
${ODIR}/rt/%.rds: est_rt.R ${IDIR}/epi_data.rds | ${ODIR}/rt
${R}
${ODIR}/figures/cases/%.png: fig_country_case_series.R ${IDIR}/epi_data.rds ${IDIR}/plot_elements.rda | ${ODIR}/figures/cases
${R}
${ODIR}/figures/deaths/%.png: fig_country_death_series.R ${IDIR}/epi_data.rds ${IDIR}/plot_elements.rda | ${ODIR}/figures/deaths
${R}
${ODIR}/figures/both/%.png: fig_country_both_series.R ${IDIR}/epi_data.rds ${IDIR}/plot_elements.rda | ${ODIR}/figures/both
${R}