-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·59 lines (49 loc) · 1.15 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
# Varables
VENV = .venv
# PYTHON = $(VENV)/bin/python
# PIP = $(VENV)/bin/pip
PYTHON = python
PIP = pip
R = Rscript
# Dependencies & scripts
REQUIREMENTS = requirements.txt
PACKAGES = tidyverse corrplot gridExtra
SANITIZER = vndb_sanitizer.py
BARCHART = vndb_barchartrace.py
QUERY = vndb_query.py
PLOT = vndb-plot.r
# Default target, run one by one
all:
$(MAKE) install
$(MAKE) clean
$(MAKE) sanitize
$(MAKE) plot
run:
$(MAKE) clean
$(MAKE) sanitize
$(MAKE) plot
# Install dependencies for Python and R
install: $(VENV) $(PACKAGES)
$(PIP) install -r $(REQUIREMENTS)
$(R) -e "install.packages(c('$(PACKAGES)'), repos = 'https://cran.rstudio.com/')"
$(VENV):
virtualenv $(VENV)
source $(VENV)/bin/activate; \
$(PIP) install -r $(REQUIREMENTS)
# Get data from VNDB query
query:
$(PYTHON) $(QUERY)
# Sanitize data
sanitize: $(SANITIZER)
$(PYTHON) $(SANITIZER)
$(PYTHON) $(BARCHART)
legacy:
$(PYTHON) monthly_legacy.py
# Generate plots
plot: $(BARCHART) $(PLOT)
$(R) $(PLOT)
-rm Rplots.pdf
# Clean up outputs
clean:
-rm vndb-*-sanitized-*.csv vndb-list-barchartrace-*.csv vndb-ulist-monthly-*.csv Rplots.pdf
-rm output/*.png output/*.json output/*.csv