-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (38 loc) · 1.07 KB
/
Makefile
File metadata and controls
53 lines (38 loc) · 1.07 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
51
52
53
CONFIG = config.json
DATACHECK = data/data.complete
PLOTCHECK = plots/plots.complete
DATASET = $(DATACHECK) \
data/*[[:digit:]]*.config \
data/*.json \
data/*.sh
PLOTS = $(PLOTCHECK) \
plots/*.dat \
plots/*.pdf \
plots/*.plg
CLEAN = log.json \
$(DATASET) \
$(PLOTS)
# Change to python3 (or other alias) if needed
PYTHON = python
SUGARSCAPE = sugarscape.py
$(DATACHECK):
cd data && $(PYTHON) run.py --conf ../$(CONFIG)
touch $(DATACHECK)
$(PLOTCHECK): $(DATACHECK)
cd plots && $(PYTHON) plot.py --path ../data/ --conf ../$(CONFIG) --outf data.dat
touch $(PLOTCHECK)
all: $(DATACHECK) $(PLOTCHECK)
data: $(DATACHECK)
plots: $(PLOTCHECK)
setup:
@echo "Setup only works with a local Python 3 installation."
@echo "Please change the PYTHON variable to the path of your local Python 3 installation in the Makefile if this step fails."
$(PYTHON) setup.py && mv setup.json $(CONFIG)
test:
$(PYTHON) $(SUGARSCAPE) --conf $(CONFIG)
clean:
rm -rf $(CLEAN) || true
lean:
rm -rf $(PLOTS) || true
.PHONY: all clean data lean plots setup
# vim: set noexpandtab tabstop=4: