generated from ttimbers/data-analysis-pipeline-make-practice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
47 lines (36 loc) · 2.03 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
# We declare these as phony targets because 'all' and 'clean' do not directly produce files
.PHONY: all clean
# The all target: we want to end up with the final report
all: report/count_report.html
# To get the report, we need all the figures:
report/count_report.html: results/figure/isles.png results/figure/abyss.png results/figure/last.png results/figure/sierra.png report/count_report.qmd
quarto render report/count_report.qmd
##################################
# Rules for generating figures
##################################
results/figure/isles.png: results/isles.dat scripts/plotcount.py
python scripts/plotcount.py --input_file=results/isles.dat --output_file=results/figure/isles.png
results/figure/abyss.png: results/abyss.dat scripts/plotcount.py
python scripts/plotcount.py --input_file=results/abyss.dat --output_file=results/figure/abyss.png
results/figure/last.png: results/last.dat scripts/plotcount.py
python scripts/plotcount.py --input_file=results/last.dat --output_file=results/figure/last.png
results/figure/sierra.png: results/sierra.dat scripts/plotcount.py
python scripts/plotcount.py --input_file=results/sierra.dat --output_file=results/figure/sierra.png
##################################
# Rules for generating .dat files
##################################
results/isles.dat: data/isles.txt scripts/wordcount.py
python scripts/wordcount.py --input_file=data/isles.txt --output_file=results/isles.dat
results/abyss.dat: data/abyss.txt scripts/wordcount.py
python scripts/wordcount.py --input_file=data/abyss.txt --output_file=results/abyss.dat
results/last.dat: data/last.txt scripts/wordcount.py
python scripts/wordcount.py --input_file=data/last.txt --output_file=results/last.dat
results/sierra.dat: data/sierra.txt scripts/wordcount.py
python scripts/wordcount.py --input_file=data/sierra.txt --output_file=results/sierra.dat
##################################
# Clean target
##################################
clean:
rm -f results/*.dat
rm -f results/figure/*.png
rm -rf report/count_report.html report/count_report_files