Bugfixes for Makefile, almost entirely silence it (send most output to .build.log)
This commit is contained in:
parent
c86abe20f3
commit
a383af2dc8
125
Makefile
125
Makefile
@ -13,6 +13,7 @@ ARDUINO ?= /usr/share/arduino
|
||||
PIPENV ?= $(shell which pipenv)
|
||||
|
||||
.devdeps: Pipfile.lock
|
||||
@echo "===> Installing dependencies with pipenv"
|
||||
@$(PIPENV) install --dev --ignore-pipfile
|
||||
@touch .devdeps
|
||||
|
||||
@ -24,12 +25,19 @@ lint: devdeps
|
||||
fix-isort: devdeps
|
||||
@find kmk/ user_keymaps/ -name "*.py" | xargs $(PIPENV) run isort
|
||||
|
||||
clean:
|
||||
rm -rf .submodules .circuitpy-deps .micropython-deps build
|
||||
clean: clean-build-log
|
||||
@echo "===> Cleaning build artifacts"
|
||||
@rm -rf .submodules .circuitpy-deps .micropython-deps .devdeps build
|
||||
|
||||
clean-build-log:
|
||||
@echo "===> Clearing previous .build.log"
|
||||
@rm -rf .build.log
|
||||
|
||||
powerwash: clean
|
||||
rm -rf vendor
|
||||
$(PIPENV) --rm
|
||||
@echo "===> Removing vendor/ to force a re-pull"
|
||||
@rm -rf vendor
|
||||
@echo "===> Removing pipenv-managed virtual environment"
|
||||
@$(PIPENV) --rm || true
|
||||
|
||||
test: micropython-build-unix
|
||||
@echo "===> Testing keymap_sanity_check.py script"
|
||||
@ -45,21 +53,25 @@ test: micropython-build-unix
|
||||
|
||||
.submodules: .gitmodules submodules.toml
|
||||
@echo "===> Pulling dependencies, this may take several minutes"
|
||||
@git submodule sync
|
||||
@git submodule update --init --recursive
|
||||
@echo "===> Pulling dependencies, this may take several minutes" >> .build.log
|
||||
@git submodule sync 2>&1 >> .build.log
|
||||
@git submodule update --init --recursive 2>&1 >> .build.log
|
||||
@rsync -ah vendor/ build/
|
||||
@touch .submodules
|
||||
|
||||
.circuitpy-deps: .submodules
|
||||
@echo "===> Building circuitpython/mpy-cross"
|
||||
@pipenv run $(MAKE) -C build/circuitpython/mpy-cross
|
||||
@echo "===> Building circuitpython/mpy-cross" >> .build.log
|
||||
@pipenv run $(MAKE) -C build/circuitpython/mpy-cross 2>&1 >> .build.log
|
||||
@echo "===> Pulling Nordic BLE stack"
|
||||
@echo "===> Pulling Nordic BLE stack" >> .build.log
|
||||
@cd build/circuitpython/ports/nrf && ./drivers/bluetooth/download_ble_stack.sh 2>/dev/null >/dev/null
|
||||
@touch .circuitpy-deps
|
||||
|
||||
.micropython-deps: .submodules
|
||||
@echo "===> Building micropython/mpy-cross"
|
||||
@pipenv run $(MAKE) -C build/micropython/mpy-cross
|
||||
@echo "===> Building micropython/mpy-cross" >> .build.log
|
||||
@pipenv run $(MAKE) -C build/micropython/mpy-cross 2>&1 >> .build.log
|
||||
@touch .micropython-deps
|
||||
|
||||
submodules: .submodules
|
||||
@ -67,7 +79,9 @@ circuitpy-deps: .circuitpy-deps
|
||||
micropython-deps: .micropython-deps
|
||||
|
||||
build/micropython/ports/unix/micropython: micropython-deps build/micropython/ports/unix/modules/.kmk_frozen
|
||||
@pipenv run $(MAKE) -j4 -C build/micropython/ports/unix
|
||||
@echo "===> Building MicroPython for Unix"
|
||||
@echo "===> Building MicroPython for Unix" >> .build.log
|
||||
@pipenv run $(MAKE) -j4 -C build/micropython/ports/unix 2>&1 >> .build.log
|
||||
|
||||
micropython-build-unix: build/micropython/ports/unix/micropython
|
||||
|
||||
@ -76,84 +90,107 @@ freeze-nrf-build-deps: build/circuitpython/ports/nrf/freeze/.kmk_frozen
|
||||
freeze-stm32-build-deps: build/micropython/ports/stm32/freeze/.kmk_frozen
|
||||
|
||||
build/micropython/ports/unix/modules/.kmk_frozen: upy-freeze.txt submodules.toml
|
||||
@echo "===> Preparing builded dependencies for local development"
|
||||
@echo "===> Preparing vendored dependencies for bundling into MicroPython for Unix"
|
||||
@echo "===> Preparing vendored dependencies for bundling into MicroPython for Unix" >> .build.log
|
||||
@rm -rf build/micropython/ports/unix/modules/*
|
||||
@cat upy-freeze.txt | egrep -v '(^#|^\s*$|^\s*\t*#)' | grep MICROPY | cut -d'|' -f2- | \
|
||||
xargs -I '{}' cp -a {} build/micropython/ports/unix/modules/
|
||||
xargs -I '{}' rsync -ah {} build/micropython/ports/unix/modules/
|
||||
@touch $@
|
||||
|
||||
build/circuitpython/ports/atmel-samd/modules/.kmk_frozen: upy-freeze.txt submodules.toml
|
||||
@echo "===> Preparing builded dependencies for bundling"
|
||||
@echo "===> Preparing vendored dependencies for bundling into CircuitPython for atmel-samd"
|
||||
@echo "===> Preparing vendored dependencies for bundling into CircuitPython for atmel-samd" >> .build.log
|
||||
@rm -rf build/circuitpython/ports/atmel-samd/modules/*
|
||||
@cat upy-freeze.txt | egrep -v '(^#|^\s*$|^\s*\t*#)' | grep CIRCUITPY | cut -d'|' -f2- | \
|
||||
xargs -I '{}' cp -a {} build/circuitpython/ports/atmel-samd/modules/
|
||||
xargs -I '{}' rsync -ah {} build/circuitpython/ports/atmel-samd/modules/
|
||||
@touch $@
|
||||
|
||||
build/circuitpython/ports/nrf/freeze/.kmk_frozen: upy-freeze.txt submodules.toml
|
||||
@echo "===> Preparing builded dependencies for bundling"
|
||||
@echo "===> Preparing vendored dependencies for bundling into CircuitPython for NRF"
|
||||
@echo "===> Preparing vendored dependencies for bundling into CircuitPython for NRF" >> .build.log
|
||||
@rm -rf build/circuitpython/ports/nrf/freeze/*
|
||||
@cat upy-freeze.txt | egrep -v '(^#|^\s*$|^\s*\t*#)' | grep CIRCUITPY | cut -d'|' -f2- | \
|
||||
xargs -I '{}' cp -a {} build/circuitpython/ports/nrf/freeze/
|
||||
xargs -I '{}' rsync -ah {} build/circuitpython/ports/nrf/freeze/
|
||||
@touch $@
|
||||
|
||||
build/micropython/ports/stm32/freeze/.kmk_frozen: upy-freeze.txt submodules.toml
|
||||
@echo "===> Preparing builded dependencies for bundling"
|
||||
@echo "===> Preparing vendored dependencies for bundling into MicroPython for STM32"
|
||||
@echo "===> Preparing vendored dependencies for bundling into MicroPython for STM32" >> .build.log
|
||||
@mkdir -p build/micropython/ports/stm32/freeze/
|
||||
@rm -rf build/micropython/ports/stm32/freeze/*
|
||||
@cat upy-freeze.txt | egrep -v '(^#|^\s*$|^\s*\t*#)' | grep MICROPY | cut -d'|' -f2- | \
|
||||
xargs -I '{}' cp -a {} build/micropython/ports/stm32/freeze/
|
||||
xargs -I '{}' rsync -ah {} build/micropython/ports/stm32/freeze/
|
||||
@touch $@
|
||||
|
||||
circuitpy-freeze-kmk-atmel-samd: freeze-atmel-samd-build-deps
|
||||
@echo "===> Preparing KMK source for bundling into CircuitPython"
|
||||
@echo "===> Preparing KMK source for bundling into CircuitPython for atmel-samd"
|
||||
@echo "===> Preparing KMK source for bundling into CircuitPython for atmel-samd" >> .build.log
|
||||
@rm -rf build/circuitpython/ports/atmel-samd/modules/kmk*
|
||||
@rsync -ah kmk build/circuitpython/ports/atmel-samd/modules/
|
||||
@rsync -ah kmk build/circuitpython/ports/atmel-samd/modules/ --exclude kmk/micropython
|
||||
|
||||
circuitpy-freeze-kmk-nrf: freeze-nrf-build-deps
|
||||
@echo "===> Preparing KMK source for bundling into CircuitPython"
|
||||
@echo "===> Preparing KMK source for bundling into CircuitPython for NRF"
|
||||
@echo "===> Preparing KMK source for bundling into CircuitPython for NRF" >> .build.log
|
||||
@rm -rf build/circuitpython/ports/nrf/kmk*
|
||||
@rsync -ah kmk build/circuitpython/ports/nrf/freeze/
|
||||
@rsync -ah kmk build/circuitpython/ports/nrf/freeze/ --exclude kmk/micropython
|
||||
|
||||
micropython-freeze-kmk-stm32: freeze-stm32-build-deps
|
||||
@echo "===> Preparing KMK source for bundling into MicroPython"
|
||||
@echo "===> Preparing KMK source for bundling into MicroPython for STM32"
|
||||
@echo "===> Preparing KMK source for bundling into MicroPython for STM32" >> .build.log
|
||||
@rm -rf build/micropython/ports/stm32/freeze/kmk*
|
||||
@rsync -ah kmk build/micropython/ports/stm32/freeze/
|
||||
@rsync -ah kmk build/micropython/ports/stm32/freeze/ --exclude kmk/circuitpython
|
||||
|
||||
circuitpy-build-feather-m4-express:
|
||||
@echo "===> Building CircuitPython"
|
||||
@pipenv run $(MAKE) -C build/circuitpython/ports/atmel-samd BOARD=feather_m4_express FROZEN_MPY_DIRS="modules" clean all
|
||||
@echo "===> Building CircuitPython for atmel-samd - Feather M4 Express"
|
||||
@echo "===> Building CircuitPython for atmel-samd - Feather M4 Express" >> .build.log
|
||||
@pipenv run $(MAKE) -C build/circuitpython/ports/atmel-samd BOARD=feather_m4_express FROZEN_MPY_DIRS="modules" clean all 2>&1 >> .build.log
|
||||
|
||||
circuitpy-build-itsybitsy-m4-express:
|
||||
@echo "===> Building CircuitPython"
|
||||
@pipenv run $(MAKE) -C build/circuitpython/ports/atmel-samd BOARD=itsybitsy_m4_express FROZEN_MPY_DIRS="modules" clean all
|
||||
@echo "===> Building CircuitPython for atmel-samd - ItsyBitsy M4 Express"
|
||||
@echo "===> Building CircuitPython for atmel-samd - ItsyBitsy M4 Express" >> .build.log
|
||||
@pipenv run $(MAKE) -C build/circuitpython/ports/atmel-samd BOARD=itsybitsy_m4_express FROZEN_MPY_DIRS="modules" clean all 2>&1 >> .build.log
|
||||
|
||||
circuitpy-build-nrf:
|
||||
@echo "===> Building CircuitPython"
|
||||
@pipenv run $(MAKE) -C build/circuitpython/ports/nrf BOARD=feather_nrf52832 SERIAL=${AMPY_PORT} SD=s132 FROZEN_MPY_DIR=freeze clean all
|
||||
@echo "===> Building CircuitPython for NRF - Feather NRF52832"
|
||||
@echo "===> Building CircuitPython for NRF - Feather NRF52832" >> .build.log
|
||||
@pipenv run $(MAKE) -C build/circuitpython/ports/nrf BOARD=feather_nrf52832 SERIAL=${AMPY_PORT} SD=s132 FROZEN_MPY_DIR=freeze clean all 2>&1 >> .build.log
|
||||
|
||||
circuitpy-flash-feather-m4-express:
|
||||
@echo
|
||||
@echo "!!!!!!!!!!!!!!!!!!!!"
|
||||
@echo "Flashing not available for Feather M4 Express over bossa right now"
|
||||
@echo "First, double tap the reset button on the Feather. You should see a red light near the USB port"
|
||||
@echo "Then, find and (if necessary) mount the USB drive that will show up (should be about 4MB)"
|
||||
@echo "Copy build/circuitpython/ports/atmel-samd/build-feather_m4_express/firmware.uf2 to this device"
|
||||
@echo "The device will auto-reboot. You may need to forcibly unmount the drive on Linuxes, with umount -f path/to/mountpoint"
|
||||
@echo "!!!!!!!!!!!!!!!!!!!!"
|
||||
@echo
|
||||
|
||||
circuitpy-flash-itsybitsy-m4-express:
|
||||
@echo
|
||||
@echo "!!!!!!!!!!!!!!!!!!!!"
|
||||
@echo "Flashing not available for ItsyBitsy M4 Express over bossa right now"
|
||||
@echo "First, double tap the reset button on the ItsyBitsy. You should see a red light near the USB port"
|
||||
@echo "Then, find and (if necessary) mount the USB drive that will show up (should be about 4MB)"
|
||||
@echo "Copy build/circuitpython/ports/atmel-samd/build-itsybitsy_m4_express/firmware.uf2 to this device"
|
||||
@echo "The device will auto-reboot. You may need to forcibly unmount the drive on Linuxes, with umount -f path/to/mountpoint"
|
||||
@echo "!!!!!!!!!!!!!!!!!!!!"
|
||||
@echo
|
||||
|
||||
circuitpy-flash-nrf: circuitpy-build-nrf
|
||||
@echo "===> Flashing CircuitPython with KMK and your keymap"
|
||||
@pipenv run $(MAKE) -C build/circuitpython/ports/nrf BOARD=feather_nrf52832 SERIAL=${AMPY_PORT} SD=s132 FROZEN_MPY_DIR=freeze dfu-gen dfu-flash
|
||||
@echo "===> Flashing CircuitPython with KMK and your keymap" >> .build.log
|
||||
@pipenv run $(MAKE) -C build/circuitpython/ports/nrf BOARD=feather_nrf52832 SERIAL=${AMPY_PORT} SD=s132 FROZEN_MPY_DIR=freeze dfu-gen dfu-flash 2>&1 >> .build.log
|
||||
|
||||
micropython-build-pyboard:
|
||||
@pipenv run $(MAKE) -j4 -C build/micropython/ports/stm32/ BOARD=PYBV11 FROZEN_MPY_DIR=freeze all
|
||||
@echo "===> Building MicroPython for STM32 - PYBV11"
|
||||
@echo "===> Building MicroPython for STM32 - PYBV11" >> .build.log
|
||||
@pipenv run $(MAKE) -j4 -C build/micropython/ports/stm32/ BOARD=PYBV11 FROZEN_MPY_DIR=freeze all 2>&1 >> .build.log
|
||||
|
||||
micropython-flash-pyboard: micropython-build-pyboard
|
||||
@pipenv run $(MAKE) -j4 -C build/micropython/ports/stm32/ BOARD=PYBV11 FROZEN_MPY_DIR=freeze deploy
|
||||
@echo "===> Flashing MicroPython with KMK and your keymap"
|
||||
@echo "===> Flashing MicroPython with KMK and your keymap" >> .build.log
|
||||
@pipenv run $(MAKE) -j4 -C build/micropython/ports/stm32/ BOARD=PYBV11 FROZEN_MPY_DIR=freeze deploy 2>&1 >> .build.log
|
||||
|
||||
circuitpy-flash-nrf-entrypoint:
|
||||
@echo "===> Flashing entrypoint if it doesn't already exist"
|
||||
@ -170,11 +207,11 @@ flash-feather-m4-express:
|
||||
@echo "===> Must provide a USER_KEYMAP (usually from user_keymaps/...) to build!" && exit 1
|
||||
else
|
||||
ifndef SKIP_KEYMAP_VALIDATION
|
||||
build-feather-m4-express: lint devdeps circuitpy-deps circuitpy-freeze-kmk-atmel-samd micropython-build-unix
|
||||
build-feather-m4-express: clean-build-log lint circuitpy-deps circuitpy-freeze-kmk-atmel-samd micropython-build-unix
|
||||
else
|
||||
build-feather-m4-express: lint devdeps circuitpy-deps circuitpy-freeze-kmk-atmel-samd
|
||||
build-feather-m4-express: clean-build-log lint circuitpy-deps circuitpy-freeze-kmk-atmel-samd
|
||||
endif
|
||||
@echo "===> Preparing keyboard script for bundling into CircuitPython"
|
||||
@echo "===> Preparing keyboard script for bundling into CircuitPython for atmel-samd"
|
||||
ifndef SKIP_KEYMAP_VALIDATION
|
||||
@MICROPYPATH=./ ./bin/micropython.sh bin/keymap_sanity_check.py ${USER_KEYMAP}
|
||||
endif
|
||||
@ -192,12 +229,12 @@ build-feather-nrf52832:
|
||||
flash-feather-nrf52832:
|
||||
@echo "===> Must provide a USER_KEYMAP (usually from user_keymaps/...) to build!" && exit 1
|
||||
else
|
||||
build-feather-nrf52832: lint devdeps circuitpy-deps circuitpy-freeze-kmk-nrf
|
||||
@echo "===> Preparing keyboard script for bundling into CircuitPython"
|
||||
build-feather-nrf52832: clean-build-log lint circuitpy-deps circuitpy-freeze-kmk-nrf
|
||||
@echo "===> Preparing keyboard script for bundling into CircuitPython for NRF"
|
||||
@rsync -ah ${USER_KEYMAP} build/circuitpython/ports/nrf/freeze/kmk_keyboard_user.py
|
||||
@$(MAKE) circuitpy-build-nrf
|
||||
|
||||
flash-feather-nrf52832: build-feather-nrf52832 circuitpy-flash-nrf circuitpy-flash-nrf-endpoint
|
||||
flash-feather-nrf52832: clean-build-log build-feather-nrf52832 circuitpy-flash-nrf circuitpy-flash-nrf-endpoint
|
||||
endif
|
||||
|
||||
ifndef USER_KEYMAP
|
||||
@ -208,11 +245,11 @@ flash-itsybitsy-m4-express:
|
||||
@echo "===> Must provide a USER_KEYMAP (usually from user_keymaps/...) to build!" && exit 1
|
||||
else
|
||||
ifndef SKIP_KEYMAP_VALIDATION
|
||||
build-itsybitsy-m4-express: lint devdeps circuitpy-deps circuitpy-freeze-kmk-atmel-samd micropython-build-unix
|
||||
build-itsybitsy-m4-express: clean-build-log lint circuitpy-deps circuitpy-freeze-kmk-atmel-samd micropython-build-unix
|
||||
else
|
||||
build-itsybitsy-m4-express: lint devdeps circuitpy-deps circuitpy-freeze-kmk-atmel-samd
|
||||
build-itsybitsy-m4-express: clean-build-log lint circuitpy-deps circuitpy-freeze-kmk-atmel-samd
|
||||
endif
|
||||
@echo "===> Preparing keyboard script for bundling into CircuitPython"
|
||||
@echo "===> Preparing keyboard script for bundling into CircuitPython for atmel-samd"
|
||||
ifndef SKIP_KEYMAP_VALIDATION
|
||||
@MICROPYPATH=./ ./bin/micropython.sh bin/keymap_sanity_check.py ${USER_KEYMAP}
|
||||
endif
|
||||
@ -231,11 +268,11 @@ flash-pyboard:
|
||||
@echo "===> Must provide a USER_KEYMAP (usually from user_keymaps/...) to build!" && exit 1
|
||||
else
|
||||
ifndef SKIP_KEYMAP_VALIDATION
|
||||
build-pyboard: lint devdeps micropython-deps micropython-freeze-kmk-stm32 micropython-build-unix
|
||||
build-pyboard: clean-build-log lint micropython-deps micropython-freeze-kmk-stm32 micropython-build-unix
|
||||
else
|
||||
build-pyboard: lint devdeps micropython-deps micropython-freeze-kmk-stm32
|
||||
build-pyboard: clean-build-log lint micropython-deps micropython-freeze-kmk-stm32
|
||||
endif
|
||||
@echo "===> Preparing keyboard script for bundling into MicroPython"
|
||||
@echo "===> Preparing keyboard script for bundling into MicroPython for STM32"
|
||||
ifndef SKIP_KEYMAP_VALIDATION
|
||||
@MICROPYPATH=./ ./bin/micropython.sh bin/keymap_sanity_check.py ${USER_KEYMAP}
|
||||
endif
|
||||
|
Loading…
Reference in New Issue
Block a user