Makefile 1.13 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 53
INOMODEL=atmega328

INODIR=.ino

PYBIN=python3

.PHONY: firmware

all: run

run:
	${PYBIN} main.py

install-pip2:
	curl https://bootstrap.pypa.io/get-pip.py | sudo python

install-pip3:
	curl https://bootstrap.pypa.io/get-pip.py | sudo python3

install-ino: install-pip
	sudo pip2 install ino

install-py2-deps:
	sudo pip2 install pyserial

install-py3-deps:
	sudo pip3 install pyserial

install-pygame-py2:
	sudo apt-get install python-pygame

install-pygame-py3:
	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

list-inomodels:
	ino list-models

firmware:
	cd firmware && rm -rf ${INODIR} && mkdir -p ${INODIR} && cd ${INODIR} && ino init && cp -rf ../pot/pot.ino src/sketch.ino && ino build -m ${INOMODEL} && ino upload -m ${INOMODEL}

clean:
	rm -rf firmware/${INODIR}
	rm -rf __pycache__
	rm -rf *.pyc

serial:
	cd firmware && ino serial