build: reorganize lib/ target to avoid nested make calls
This commit is contained in:
parent
5048b578ff
commit
11216e9d25
1 changed files with 4 additions and 6 deletions
10
Makefile
10
Makefile
|
|
@ -24,16 +24,14 @@ requirements.txt: poetry.lock
|
|||
|
||||
lib/: requirements.txt
|
||||
$(VENV) python -m pip install -r requirements.txt --target lib/
|
||||
$(MAKE) compile_lib
|
||||
$(MAKE) install_lib
|
||||
|
||||
compile_lib:
|
||||
compile_lib: lib/
|
||||
@for f in $(shell find lib/ -type f -regex ".+\.py"); do \
|
||||
echo Compile $$f; \
|
||||
$(MPYCROSS) $$f; \
|
||||
done
|
||||
|
||||
install_lib: lib_tree
|
||||
install_lib: compile_lib lib_tree
|
||||
@for f in $(shell find lib/ -type f -regex ".+\.mpy"); do \
|
||||
echo Uploading $$f; \
|
||||
$(AMPY) put $$f $$f; \
|
||||
|
|
@ -55,9 +53,9 @@ erase_flash:
|
|||
flash_esp: erase_flash
|
||||
$(ESP_TOOL) --baud 460800 write_flash --flash_size=detect 0 $(MICRO_PYTHON_FIRMWARE)
|
||||
|
||||
install: check lib/ $(JUPYTER_PYTHON_FILES)
|
||||
install: check install_lib $(JUPYTER_PYTHON_FILES)
|
||||
$(AMPY) put src/main.py
|
||||
@for f in $(filter-out check lib/,$?); do \
|
||||
@for f in $(filter-out check install_lib,$?); do \
|
||||
echo Uploading $$f; \
|
||||
$(AMPY) put $$f; \
|
||||
done
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue