-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
25 lines (17 loc) · 1.06 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.PHONY: build test clean example
DOCKER_IMAGE=micropython/unix:v1.18
DOCKER_TEST_CMD=docker run --rm -e MICROPYPATH=/scripts -v ${PWD}/bundle:/scripts/ -v ${PWD}/buzzer:/scripts/buzzer -v ${PWD}/test:/scripts/test ${DOCKER_IMAGE}
build:
python3 setup.py sdist
bundle:
# bundle all what need to run this code (in case you board doesn't bundle all micropython-lib)
docker run --rm -v ${PWD}:/scripts ${DOCKER_IMAGE} micropython-dev -m upip install -r /scripts/requirements.txt -p /scripts/bundle
# change premission so it can be delete by non root users
docker run --rm -v ${PWD}:/scripts --entrypoint '/bin/bash' ${DOCKER_IMAGE} -c 'chmod -R 777 /scripts/bundle'
test: bundle
${DOCKER_TEST_CMD} micropython-dev /scripts/test/test_buzzer.py
${DOCKER_TEST_CMD} micropython-dev /scripts/test/test_midi.py
example: bundle
docker run --rm -e MICROPYPATH=/scripts -v ${PWD}/bundle:/scripts/ -v ${PWD}/buzzer:/scripts/buzzer -v ${PWD}/example:/scripts/example ${DOCKER_IMAGE} micropython /scripts/example/example.py
clean:
rm -rf build/ *.egg-info/ dist/ __pycache__/ bundle/