Makefile 1.25 KB
Newer Older
Poseidon's avatar
Poseidon committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
PYBIN := python3
VENVDIR := $(shell pwd)/.venv
VENVPY := ${VENVDIR}/bin/python

BUILDDIR := .build

.PHONY: help setup firmware serial run 

all: help

help:
	@ echo "USAGE: make <target>    where <target> can be:"
	@ echo ""
	@ echo " setup       Execute once to prepare the required Python virtual environment" 
	@ echo " firmware    Compile and upload the firmware to the Arduino board via serial"
	@ echo " serial      Starts a serial session with Python for board communication"
	@ echo ""
18
19
	@ echo " store       Execute the logger on the foreground. Hit Ctrl+C to stop it."
	@ echo " analyse     Execute the analyses data routine"
Poseidon's avatar
Poseidon committed
20
21
22
23
24
25
26
27
28
29

install-debian-deps:
	sudo apt-get install -y python3 supervisor curl dialog

install-pip3:
	wget https://bootstrap.pypa.io/get-pip.py
	sudo python3 get-pip.py
	rm get-pip.py

install-python-deps: install-pip3
30
	sudo pip3 install -r scripts/requirements.pip
Poseidon's avatar
Poseidon committed
31
32
33
34
35
36
37
38
39
40

install-platformio:
	sudo python -c "$$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)"

setup: install-debian-deps install-python-deps install-platformio venv
	

firmware:
	python3 scripts/run_platformio.py

41
42
serial:
	python3 scripts/init_serial.py --loop
Poseidon's avatar
Poseidon committed
43

44
45
pyserial:
	python3 -i scripts/init_serial.py
Poseidon's avatar
Poseidon committed
46
 
47
48
run:
	python3 logger/run.py
Poseidon's avatar
Poseidon committed
49