forked from fomorians/td-gammon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (41 loc) · 874 Bytes
/
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
#
# Basic targets for interacting with the td-gammon model.
#
SHELL := /bin/bash
.PHONY: create-venv build-model clean
.ONESHELL:
create-venv:
@# create the virtualenv
[ -r venv/ok ] && {
echo "(virtualenv already exists)"
exit 0
}
virtualenv venv || {
echo "Failed to created virtualenv" 1>&2
exit 1
}
source venv/bin/activate || {
echo "Failed to activate virtualenv" 1>&2
exit 1
}
pip install -r requirements.txt || {
echo "Failed to install requirements" 1>&2
exit 1
}
echo "ok" >> venv/ok || {
echo "Failed to create virtualenv ok file." 1>&2
exit 1
}
exit 0
.ONESHELL:
build-model: create-venv
@# build the model
echo "Building model (this takes awhile)"
source venv/bin/activate || {
echo "Failed to activate venv" 1>&2
exit 1
}
python main.py
clean:
@# clean up after ourselves
@rm -rf venv logs summaries models *.pyc