Commit 0c44db64 authored by Nelso Jost's avatar Nelso Jost

FIX: refactored dependencies check and install; ADD: README.md

parent 550605a3
......@@ -15,49 +15,42 @@ run:
firmware:
cd firmware && make
setup:
@ python3 -c "import pygame" || $(MAKE) install-pygame
@ python3 -c "import paigamu" || $(MAKE) get-paigamu
$(MAKE) install-pip
$(MAKE) install-python-deps
$(MAKE) get-platformio
cd firmware && $(MAKE) setup
@ echo "-----------------------------------------------------------"
@ echo "[OK] pip3 installed on system python3"
@ echo "[OK] python requirements installed on system python3"
@ echo "[OK] paigamu lib installed on current directory"
@ echo "[OK] pygame installed on system python3"
@ echo "[OK] platformiowizard installed"
setup: install-pygame install-paigamu install-python-deps install-platformiowizard
install-pygame:
sudo apt-get install python3-dev python3-numpy libsdl-dev libsdl-image1.2-dev \
libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsmpeg-dev libportmidi-dev \
libavformat-dev libswscale-dev libjpeg-dev libfreetype6-dev mercurial
hg clone https://bitbucket.org/pygame/pygame
cd pygame && python3 setup.py build
cd pygame && sudo python3 setup.py install
rm -rf pygame
get-paigamu:
rm -rf paigamu paigamu.git paigamu.zip
wget -O paigamu.zip https://git.cta.if.ufrgs.br/ctautils/paigamu/repository/archive.zip
unzip paigamu.zip
cp -rf paigamu.git/paigamu .
rm -rf paigamu.git paigamu.zip
get-platformio:
wget -O platformio.zip https://git.cta.if.ufrgs.br/ctautils/platformiowizard/repository/archive.zip
unzip platformio.zip
cd platformiowizard.git/firmware && cp -r .scripts Makefile ../../firmware/
rm -rf platformiowizard.git platformio.zip firmware/blink
install-pip:
@ python3 -c "import pygame" || (sudo apt-get install python3-dev \
python3-numpy libsdl-dev libsdl-image1.2-dev libsdl-mixer1.2-dev \
libsdl-ttf2.0-dev libsmpeg-dev libportmidi-dev libavformat-dev \
libswscale-dev libjpeg-dev libfreetype6-dev mercurial && \
hg clone https://bitbucket.org/pygame/pygame && \
cd pygame && python3 setup.py build && \
cd pygame && sudo python3 setup.py install && \
rm -rf pygame)
@ (python3 -c "import pygame" && echo "[OK] pygame installed") || \
echo "[FAIL] pygame is not installed"
install-paigamu:
@ python3 -c "import paigamu" || ( \
rm -rf paigamu paigamu.git paigamu.zip && \
wget -O paigamu.zip https://git.cta.if.ufrgs.br/ctautils/paigamu/repository/archive.zip && \
unzip paigamu.zip && \
cp -rf paigamu.git/paigamu . && \
rm -rf paigamu.git paigamu.zip && $(MAKE) install-paigamu)
@ (python3 -c "import paigamu" && echo "[OK] paigamu installed") || \
echo "[FAIL] paigamu is not installed"
install-platformiowizard:
@ python -c "import os; raise SystemExit(not os.path.exists('firmware/Makefile'))" || (cd firmware && wget https://git.cta.if.ufrgs.br/ctautils/platformiowizard/raw/master/get-platformiowizard.py && python get-platformiowizard.py)
@ echo "[OK] platformiowizard installed"
install-pip3:
wget https://bootstrap.pypa.io/get-pip.py
sudo -H python3 get-pip.py
@ rm get-pip.py
rm -rf get-pip.py
install-python-deps:
sudo -H pip3 install -r requirements.txt
@ python3 -c "import serial" || ($(MAKE) install-pip3 && sudo -H pip3 install pyserial && $(MAKE) install-python-deps)
@ echo "[OK] pyserial installed"
clean:
rm -rf paigamu
......
# labirinto-respirometro
Jogo onde o usuário deve utilizar o respirômetro (sensor do projeto FISIOLOG) como joystick para controlar um objeto na tela e mantê-lo dentro do labirinto.
## Instalação e uso
Um arquivo `Makefile` deverá estar presente na pasta raiz do projeto. Dentro desta pasta é possível executar os seguintes comandos para manutenção:
* `make setup`: verifica e instala todas as dependências;
* `make firmware`: instala o firmware do joystick-respirometro em uma placa Arduino;
* `make run`: executa o jogo;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment