Add Makefile
This commit is contained in:
parent
b06b162b2d
commit
f2fec045e4
1 changed files with 35 additions and 0 deletions
35
Makefile
Normal file
35
Makefile
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
.PHONY: all deps test-deps test deploy run reset repl
|
||||||
|
|
||||||
|
DEVICE ?= auto
|
||||||
|
DEPS = umqtt.simple
|
||||||
|
TEST_DEPS = unittest
|
||||||
|
|
||||||
|
mpremote = mpremote connect $(DEVICE)
|
||||||
|
|
||||||
|
all: deps deploy reset repl
|
||||||
|
|
||||||
|
deps: $(DEPS)
|
||||||
|
|
||||||
|
test-deps: $(TEST_DEPS)
|
||||||
|
|
||||||
|
$(DEPS) $(TEST_DEPS):
|
||||||
|
$(mpremote) mip install $@
|
||||||
|
|
||||||
|
test: deploy
|
||||||
|
$(mpremote) cp -r tests ":"
|
||||||
|
$(mpremote) exec 'import unittest; unittest.main("tests")'
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
$(mpremote) cp *.py ":"
|
||||||
|
@if test -f settings.json; then \
|
||||||
|
$(mpremote) cp settings.json ":"; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
run:
|
||||||
|
$(mpremote) run main.py
|
||||||
|
|
||||||
|
reset:
|
||||||
|
$(mpremote) reset
|
||||||
|
|
||||||
|
repl:
|
||||||
|
$(mpremote)
|
Loading…
Reference in a new issue