generated from trr266/trer
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
45 lines (29 loc) · 1.04 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
# If you are new to Makefiles: https://makefiletutorial.com
PAPER := output/paper.pdf
PRESENTATION := output/presentation.pdf
TARGETS := $(PAPER) $(PRESENTATION)
WORLDBANK_DATA := data/pulled/worldbank.rda
GENERATED_DATA := data/generated/sample.rda
RESULTS := output/results.rda
RSCRIPT := Rscript --encoding=UTF-8
.phony: all clean very-clean dist-clean
all: $(TARGETS)
clean:
rm -f $(TARGETS)
rm -f $(RESULTS)
rm -f $(GENERATED_DATA)
dist-clean: clean
rm -f $(WORLDBANK_DATA)
$(WORLDBANK_DATA): code/R/pull_data.R
$(RSCRIPT) code/R/pull_data.R
$(GENERATED_DATA): $(WORLDBANK_DATA) code/R/prepare_data.R
$(RSCRIPT) code/R/prepare_data.R
$(RESULTS): $(GENERATED_DATA) code/R/do_analysis.R
$(RSCRIPT) code/R/do_analysis.R
$(PAPER): doc/paper.Rmd doc/references.bib $(RESULTS)
$(RSCRIPT) -e 'library(rmarkdown); render("doc/paper.Rmd")'
mv doc/paper.pdf output
rm -f doc/paper.ttt doc/paper.fff
$(PRESENTATION): doc/presentation.rmd $(RESULTS)
$(RSCRIPT) -e 'library(rmarkdown); render("doc/presentation.Rmd")'
mv doc/presentation.pdf output