# # Handle generic compile to .mpy and upload to a Pico board # LIBS = lib/homeutil.mpy lib/devices.mpy 3p/microdot.mpy 3p/ezt.mpy 3p/easydict/__init__.mpy ### what to do with this? PACKAGES = 3p/easydict MICRODOT = https://raw.githubusercontent.com/miguelgrinberg/microdot/main/src/microdot/microdot.py MICRODOT_MPY = 3p/microdot.mpy # Just build everything as a .mpy all: $(LIBS) # Install the libs onto the Pico. All apps use the same main.py, # which loads app.py (app.mpy) and calls into it. install: $(LIBS) config.repr -mpremote mkdir :lib/ > /dev/null mpremote ls :lib | fgrep logging > /dev/null || mpremote mip install logging collections mpremote cp main.py :/ mpremote cp config.repr :/ mpremote cp lib/homeutil.mpy :lib/ mpremote cp lib/devices.mpy :lib/ mpremote cp $(MICRODOT_MPY) :lib/ -mpremote mkdir :lib/easydict > /dev/null mpremote cp 3p/easydict/__init__.mpy :lib/easydict/ mpremote cp 3p/ezt.mpy :lib/ fetch: wget -O 3p/microdot.py $(MICRODOT) pip3 install --target 3p ezt easydict config.repr: config.yaml python3 -c "import yaml ; print(repr(yaml.safe_load(open('$<'))))" > $@ %.mpy : %.py mpy-cross $<