Makefile 1.41 KB
Newer Older
Poseidon's avatar
Poseidon committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
PYBIN := python3
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 ""
15 16 17 18
	@ echo " run         Execute the storage and analysis scripts. It's like run 'make store'"
	@ echo "                 and 'make anlyse'."
	@ echo " store       Execute the storage data routine."
	@ echo " analyze     Execute the analysis data routine."
Poseidon's avatar
Poseidon committed
19 20 21 22 23 24 25 26 27 28

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
29
	sudo pip3 install -r scripts/requirements.pip
Poseidon's avatar
Poseidon committed
30 31 32 33 34 35 36 37 38 39

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

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

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

49 50 51 52 53
store:
	python3 scripts/coleta_script.py --store

analyze:
	python3 scripts/coleta_script.py --analyze