Makefile 1.29 KB
Newer Older
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
PY := 2
VENV := .venv

all: help

help:
	@ echo "USAGE"
	@ echo ""
	@ echo "    make apt-install    --  Uses apt to install system tools"
	@ echo ""
	@ echo "    make setup          --  Install Python requirements"
	@ echo ""
	@ echo "    make build          --  Compile the sketch"
	@ echo ""
	@ echo "    make upload         --  Send the compiled sketch to the board"
	@ echo ""
	@ echo "    make serial         --  Starts a picocom serial communication"

apt-install:
	sudo apt-get install python-pip picocom
	
setup: clean-venv
	@ echo "-------------------------------------------------------"
	virtualenv -v --python='python${PYVER}' ${VENV}
	@ echo "Virtualenv with 'python${PYVER}' interpreter was created at ${VENV}"
	@ echo "-------------------------------------------------------"
	${VENV}/bin/pip${PYVER} install --upgrade pip
	@ echo "-------------------------------------------------------"
	${VENV}/bin/pip${PYVER} install -r requirements.pip
	@ echo "-------------------------------------------------------"
	@ echo "Virtualenv is ready at ${VENV}!"
	@ echo " "
	@ echo "TOTAL SIZE: "
	@ du -sh ${VENV}

clean-venv:
	rm -rf ${VENV}

clean:
	rm -rf .build src/*

build:
	rm -rf src/*
	cp -rf ../meteorolog/. src/
	${VENV}/bin/ino build

upload:
	${VENV}/bin/ino upload

serial:
	${VENV}/bin/ino serial -- -c