Makefile 1.54 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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 ""
Nelso Jost's avatar
Nelso Jost committed
17
	@ echo "    make bus            --  build & upload & start serial picocom"
Nelso Jost's avatar
Nelso Jost committed
18
	@ echo ""
19
	@ echo "    make serial         --  Starts a picocom serial communication"
20
21
	@ echo ""
	@ echo "    make list-models    --  List possible Arduino models for ino.ini"
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

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:
Nelso Jost's avatar
Nelso Jost committed
47
	mkdir -p src/ lib/
48
49
	cp -rf ../meteorolog/. src/
	${VENV}/bin/ino build
Nelso Jost's avatar
Nelso Jost committed
50
	
51
52
53
upload:
	${VENV}/bin/ino upload

Nelso Jost's avatar
Nelso Jost committed
54
bus: build upload serial
Nelso Jost's avatar
Nelso Jost committed
55

56
serial:
Nelso Jost's avatar
Nelso Jost committed
57
	${VENV}/bin/ino serial -- -c -r -l
58

59
60
61
list-models:
	${VENV}/bin/ino list-models