Makefile 1.17 KB
Newer Older
Nelso Jost's avatar
Nelso Jost committed
1
PY := python3
2
VENV := .venv
Nelso Jost's avatar
Nelso Jost committed
3
4
5

all:
	@ echo "USAGE:"
6
7
8
9
10
11
12
	@ echo "    make deb-install -- Attempt to install required system wide"
	@ echo "                        Debian packages via apt"
	@ echo ""
	@ echo "    make setup  -- Create a local Python virtual environment"
	@ echo "                   that will hold requirements.pip modules"
	@ echo ""
	@ echo "    make run    -- Executes the logger "
Nelso Jost's avatar
Nelso Jost committed
13

14
setup: install-deb venv
Nelso Jost's avatar
Nelso Jost committed
15

16
17
deb-install:
	sudo apt-get install python3 python3-pip supervisor
Nelso Jost's avatar
Nelso Jost committed
18
19
	sudo pip3 install virtualenv

20
venv: clean-venv
Nelso Jost's avatar
Nelso Jost committed
21
	@ echo "-------------------------------------------------------"
22
23
24
25
26
27
28
29
30
31
32
33
34
35
	virtualenv -v --python='${PY}' ${VENV}
	@ echo "Virtualenv with interpreter '${PY}' was created at ${VENV}"
	@ echo "-------------------------------------------------------"
	${VENV}/bin/pip3 install --upgrade pip
	@ echo "-------------------------------------------------------"
	${VENV}/bin/pip3 install -r requirements.pip
	@ echo "-------------------------------------------------------"
	@ echo "Virtualenv is ready at ${VENV}!"
	@ echo " "
	@ echo "TOTAL SIZE: "
	@ du -sh ${VENV}

clean-venv:
	rm -rf ${VENV}
Nelso Jost's avatar
Nelso Jost committed
36

37
38
run:
	${VENV}/bin/python3 logger.py -v
Nelso Jost's avatar
Nelso Jost committed
39

40
41
deploy:
	${VENV}/bin/python3 deploy.py