5 Star 10 Fork 1

picospuch / eetree-mpy-lecture-code

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
makefile 1.36 KB
一键复制 编辑 原始数据 按行查看 历史
picospuch 提交于 2021-12-29 22:15 . lecture 30 finished
### micropython development system v1.2.3
#cdc = /dev/cu.usbmodem1411401
cdc = /dev/cu.usbmodem141101
bsp_objects = $(shell find bsp -depth 1 -name "*.py" \! -name ".*")
res_objects = $(shell find res -depth 1 -name "*.py" \! -name ".*")
m ?= no_this_module.py
## show help
.PHONY : help
help :
@echo "make help - show help"
@echo "make repl - enter into repl mode"
@echo "make run m=app/<filename> - run the module at once"
@echo "make main m=app/<filename> - cp the module as main.py to board"
@echo "make bsp - cp board support package to board"
@echo "make res - cp resouce files to board"
## repl
repl :
rshell -p $(cdc) repl
## run on board
run : $(m)
pyboard --follow --device $(cdc) $(m)
# ampy -p $(cdc) run $(m)
## flash bsp to board
bsp : reset out $(bsp_objects:bsp/%=out/%)
@echo "bsp updated."
## flash selected module as main.py
main : bsp
if [[ -e $(m) ]]; then rshell -p $(cdc) cp $(m) /pyboard/main.py; echo; fi
@echo "main updated."
## flash res to board
res : reset out $(res_objects:res/%=out/%)
@echo "res updated."
out :
mkdir -p out
## out cache maintaining
out/%.py : bsp/%.py
cp $< $@
rshell -p $(cdc) cp $@ /pyboard; echo;
out/%.py : res/%.py
cp $< $@
rshell -p $(cdc) cp $@ /pyboard; echo;
## others
.PHONY : reset
reset :
ampy -p $(cdc) reset
clean :
rm -r out || true
rshell -p $(cdc) rm -rf /pyboard
time :
rshell -p $(cdc) date
1
https://gitee.com/picospuch/eetree-mpy-lecture-code.git
git@gitee.com:picospuch/eetree-mpy-lecture-code.git
picospuch
eetree-mpy-lecture-code
eetree-mpy-lecture-code
main

搜索帮助

53164aa7 5694891 3bd8fe86 5694891