@@ -94,34 +94,37 @@ $(MPY_DIR):
9494 @echo " Cloning micropython-steami into $( CURDIR) /$( MPY_DIR) ..."
9595 @mkdir -p $(dir $(CURDIR ) /$(MPY_DIR ) )
9696 git clone --branch $(MICROPYTHON_BRANCH ) $(MICROPYTHON_REPO ) $(CURDIR ) /$(MPY_DIR )
97- cd $( CURDIR ) / $( MPY_DIR ) /ports/stm32 && $(MAKE ) BOARD=$(BOARD ) submodules
97+ $( MAKE ) -C $(STM32_DIR ) BOARD=$(BOARD ) submodules
9898
9999.PHONY : firmware
100100firmware : $(MPY_DIR ) # # Build MicroPython firmware with current drivers
101101 @set -e
102102 @if [ ! -f " $( MPY_DIR) /lib/micropython-lib/README.md" ]; then \
103103 echo " Initializing submodules for $( BOARD) ..." ; \
104- cd $( CURDIR ) / $( MPY_DIR ) /ports/stm32 && $(MAKE ) BOARD=$(BOARD ) submodules; \
104+ $( MAKE ) -C $(STM32_DIR ) BOARD=$(BOARD ) submodules; \
105105 fi
106106 @echo " Linking local drivers..."
107107 rm -rf $(CURDIR ) /$(MPY_DIR ) /lib/micropython-steami-lib
108108 ln -s $(CURDIR ) $(CURDIR ) /$(MPY_DIR ) /lib/micropython-steami-lib
109109 @echo " Building firmware for $( BOARD) ..."
110- cd $( CURDIR ) / $( MPY_DIR ) /ports/stm32 && $(MAKE ) BOARD=$(BOARD )
111- @echo " Firmware ready: $( CURDIR ) / $( MPY_DIR ) /ports/stm32 /build-$( BOARD) /firmware.hex"
110+ $( MAKE ) -C $(STM32_DIR ) BOARD=$(BOARD )
111+ @echo " Firmware ready: $( STM32_DIR ) /build-$( BOARD) /firmware.hex"
112112
113113.PHONY : firmware-update
114114firmware-update : $(MPY_DIR ) # # Update the MicroPython clone and board-specific submodules
115115 @set -e
116116 @echo " Updating micropython-steami..."
117117 rm -rf $(CURDIR ) /$(MPY_DIR ) /lib/micropython-steami-lib
118- cd $(CURDIR ) /$(MPY_DIR ) && git fetch origin && git checkout $(MICROPYTHON_BRANCH ) && git checkout -- lib/micropython-steami-lib && git pull --ff-only
118+ git -C $(CURDIR ) /$(MPY_DIR ) fetch origin
119+ git -C $(CURDIR ) /$(MPY_DIR ) checkout $(MICROPYTHON_BRANCH )
120+ git -C $(CURDIR ) /$(MPY_DIR ) checkout -- lib/micropython-steami-lib
121+ git -C $(CURDIR ) /$(MPY_DIR ) pull --ff-only
119122 @echo " Updating required submodules for $( BOARD) ..."
120- cd $( CURDIR ) / $( MPY_DIR ) /ports/stm32 && $(MAKE ) BOARD=$(BOARD ) submodules
123+ $( MAKE ) -C $(STM32_DIR ) BOARD=$(BOARD ) submodules
121124
122125.PHONY : deploy
123126deploy : $(MPY_DIR ) # # Flash firmware to the board via OpenOCD
124- cd $( CURDIR ) / $( MPY_DIR ) /ports/stm32 && $(MAKE ) BOARD=$(BOARD ) deploy-openocd
127+ $( MAKE ) -C $(STM32_DIR ) BOARD=$(BOARD ) deploy-openocd
125128
126129.PHONY : run
127130run : # # Run a script on the board with live output (SCRIPT=path/to/file.py)
@@ -145,8 +148,8 @@ run-main: ## Re-execute main.py on the board and capture output
145148
146149.PHONY : firmware-clean
147150firmware-clean : # # Clean firmware build artifacts
148- @if [ -d " $( MPY_DIR ) /ports/stm32 " ]; then \
149- cd $( MPY_DIR ) /ports/stm32 && $(MAKE ) BOARD=$(BOARD ) clean; \
151+ @if [ -d " $( STM32_DIR ) " ]; then \
152+ $( MAKE ) -C $(STM32_DIR ) BOARD=$(BOARD ) clean; \
150153 fi
151154
152155# --- Hardware ---
0 commit comments