-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (50 loc) · 1.09 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
# Varables
VENV = .venv
# PYTHON = $(VENV)/bin/python
# PIP = $(VENV)/bin/pip
PYTHON = python
PIP = pip
# Dependencies & scripts
REQUIREMENTS = requirements.txt
SANITIZER = hltb_sanitizer.py
BARCHART = hltb_barchartrace.py
ANALYZER = hltb_analyzer.py
PLOT = hltb_visualizer.py
# Default target, run one by one
all:
$(MAKE) install
$(MAKE) sanitize
$(MAKE) analyze plot
# make run
run:
$(MAKE) sanitize
$(MAKE) analyze
$(MAKE) plot
# Install dependencies for Python
install: $(VENV)
$(PIP) install -r $(REQUIREMENTS)
$(VENV):
@echo "Setting up virtualenv..."
virtualenv $(VENV)
source $(VENV)/bin/activate; \
$(PIP) install -r $(REQUIREMENTS)
# Sanitize data
sanitize: $(SANITIZER)
$(PYTHON) $(SANITIZER)
$(PYTHON) $(BARCHART)
# Analyze data
analyze: $(ANALYZER)
$(PYTHON) $(ANALYZER)
# Generate plots
plot: $(PLOT)
$(PYTHON) $(PLOT)
# Clean up outputs
clean:
-rm HLTB-sanitized-*.csv HLTB-barchartrace-*.csv output/*.png output/word-frequency.txt
-rm output/errors.csv
# Uninstall and purge cache
uninstall:
@echo "Cleaning up..."
@deactivate || true
rm -rf $(VENV)
pip cache purge || true