2018-09-03 10:23:15 +02:00
|
|
|
.PHONY: \
|
|
|
|
build-feather \
|
|
|
|
circuitpy-deps \
|
|
|
|
circuitpy-freeze-kmk-nrf \
|
|
|
|
devdeps \
|
2018-10-06 00:31:00 +02:00
|
|
|
freeze-nrf-build-deps \
|
2018-09-03 10:23:15 +02:00
|
|
|
lint
|
2018-09-03 05:06:53 +02:00
|
|
|
|
2018-09-16 09:15:16 +02:00
|
|
|
AMPY_PORT ?= /dev/ttyUSB0
|
|
|
|
AMPY_BAUD ?= 115200
|
|
|
|
AMPY_DELAY ?= 1.5
|
2018-09-04 01:46:12 +02:00
|
|
|
ARDUINO ?= /usr/share/arduino
|
2018-10-06 00:31:00 +02:00
|
|
|
PIPENV ?= $(shell which pipenv)
|
2018-09-03 12:22:11 +02:00
|
|
|
|
2018-10-06 10:32:17 +02:00
|
|
|
.devdeps: Pipfile.lock
|
2018-10-08 16:06:34 +02:00
|
|
|
@echo "===> Installing dependencies with pipenv"
|
2018-10-07 09:51:37 +02:00
|
|
|
@$(PIPENV) install --dev --ignore-pipfile
|
2018-10-06 10:32:17 +02:00
|
|
|
@touch .devdeps
|
|
|
|
|
|
|
|
devdeps: .devdeps
|
2018-09-03 05:06:53 +02:00
|
|
|
|
|
|
|
lint: devdeps
|
2018-10-06 00:31:00 +02:00
|
|
|
@$(PIPENV) run flake8
|
2018-09-03 05:06:53 +02:00
|
|
|
|
2018-09-22 08:44:03 +02:00
|
|
|
fix-isort: devdeps
|
2018-10-06 00:31:00 +02:00
|
|
|
@find kmk/ user_keymaps/ -name "*.py" | xargs $(PIPENV) run isort
|
|
|
|
|
2018-10-08 16:06:34 +02:00
|
|
|
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
|
2018-10-06 00:31:00 +02:00
|
|
|
|
|
|
|
powerwash: clean
|
2018-10-08 16:06:34 +02:00
|
|
|
@echo "===> Removing vendor/ to force a re-pull"
|
|
|
|
@rm -rf vendor
|
|
|
|
@echo "===> Removing pipenv-managed virtual environment"
|
|
|
|
@$(PIPENV) --rm || true
|
2018-09-22 08:44:03 +02:00
|
|
|
|
2018-09-23 11:38:28 +02:00
|
|
|
test: micropython-build-unix
|
|
|
|
@echo "===> Testing keymap_sanity_check.py script"
|
|
|
|
@echo " --> Known good layout should pass..."
|
|
|
|
@MICROPYPATH=tests/test_data:./ ./bin/micropython.sh bin/keymap_sanity_check.py keymaps/known_good.py
|
|
|
|
@echo " --> Layer with ghosted MO should fail..."
|
|
|
|
@MICROPYPATH=tests/test_data:./ ./bin/micropython.sh bin/keymap_sanity_check.py keymaps/ghosted_layer_mo.py 2>/dev/null && exit 1 || exit 0
|
|
|
|
@echo " --> Sharing a pin between rows/cols should fail..."
|
|
|
|
@MICROPYPATH=tests/test_data:./ ./bin/micropython.sh bin/keymap_sanity_check.py keymaps/duplicated_pins_between_row_col.py 2>/dev/null && exit 1 || exit 0
|
|
|
|
@echo " --> Sharing a pin between two rows should fail..."
|
|
|
|
@MICROPYPATH=tests/test_data:./ ./bin/micropython.sh bin/keymap_sanity_check.py keymaps/duplicate_row_pins.py 2>/dev/null && exit 1 || exit 0
|
|
|
|
@echo "===> The sanity checker is sane, unlike klardotsh"
|
|
|
|
|
2018-10-06 00:31:00 +02:00
|
|
|
.submodules: .gitmodules submodules.toml
|
2018-09-03 05:06:53 +02:00
|
|
|
@echo "===> Pulling dependencies, this may take several minutes"
|
2018-10-08 16:06:34 +02:00
|
|
|
@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
|
2018-10-07 10:01:37 +02:00
|
|
|
@rsync -ah vendor/ build/
|
2018-09-03 10:23:15 +02:00
|
|
|
@touch .submodules
|
|
|
|
|
|
|
|
.circuitpy-deps: .submodules
|
2018-09-03 05:06:53 +02:00
|
|
|
@echo "===> Building circuitpython/mpy-cross"
|
2018-10-08 16:06:34 +02:00
|
|
|
@echo "===> Building circuitpython/mpy-cross" >> .build.log
|
|
|
|
@pipenv run $(MAKE) -C build/circuitpython/mpy-cross 2>&1 >> .build.log
|
2018-09-03 05:06:53 +02:00
|
|
|
@echo "===> Pulling Nordic BLE stack"
|
2018-10-08 16:06:34 +02:00
|
|
|
@echo "===> Pulling Nordic BLE stack" >> .build.log
|
2018-10-06 00:31:00 +02:00
|
|
|
@cd build/circuitpython/ports/nrf && ./drivers/bluetooth/download_ble_stack.sh 2>/dev/null >/dev/null
|
2018-09-03 10:23:15 +02:00
|
|
|
@touch .circuitpy-deps
|
|
|
|
|
2018-09-04 01:22:04 +02:00
|
|
|
.micropython-deps: .submodules
|
|
|
|
@echo "===> Building micropython/mpy-cross"
|
2018-10-08 16:06:34 +02:00
|
|
|
@echo "===> Building micropython/mpy-cross" >> .build.log
|
|
|
|
@pipenv run $(MAKE) -C build/micropython/mpy-cross 2>&1 >> .build.log
|
2018-09-17 22:25:37 +02:00
|
|
|
@touch .micropython-deps
|
2018-09-04 01:22:04 +02:00
|
|
|
|
2018-10-06 00:31:00 +02:00
|
|
|
submodules: .submodules
|
2018-09-03 10:23:15 +02:00
|
|
|
circuitpy-deps: .circuitpy-deps
|
2018-09-04 01:22:04 +02:00
|
|
|
micropython-deps: .micropython-deps
|
|
|
|
|
2018-10-06 00:31:00 +02:00
|
|
|
build/micropython/ports/unix/micropython: micropython-deps build/micropython/ports/unix/modules/.kmk_frozen
|
2018-10-08 16:06:34 +02:00
|
|
|
@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
|
2018-09-23 09:45:55 +02:00
|
|
|
|
2018-10-06 00:31:00 +02:00
|
|
|
micropython-build-unix: build/micropython/ports/unix/micropython
|
2018-09-23 09:45:55 +02:00
|
|
|
|
2018-10-06 10:32:17 +02:00
|
|
|
freeze-atmel-samd-build-deps: build/circuitpython/ports/atmel-samd/modules/.kmk_frozen
|
2018-10-06 00:31:00 +02:00
|
|
|
freeze-nrf-build-deps: build/circuitpython/ports/nrf/freeze/.kmk_frozen
|
|
|
|
freeze-stm32-build-deps: build/micropython/ports/stm32/freeze/.kmk_frozen
|
2018-09-04 01:22:04 +02:00
|
|
|
|
2018-10-06 10:32:17 +02:00
|
|
|
build/micropython/ports/unix/modules/.kmk_frozen: upy-freeze.txt submodules.toml
|
2018-10-08 16:06:34 +02:00
|
|
|
@echo "===> Preparing vendored dependencies for bundling into MicroPython for Unix"
|
|
|
|
@echo "===> Preparing vendored dependencies for bundling into MicroPython for Unix" >> .build.log
|
2018-10-07 10:39:04 +02:00
|
|
|
@rm -rf build/micropython/ports/unix/modules/*
|
|
|
|
@cat upy-freeze.txt | egrep -v '(^#|^\s*$|^\s*\t*#)' | grep MICROPY | cut -d'|' -f2- | \
|
2018-10-08 16:06:34 +02:00
|
|
|
xargs -I '{}' rsync -ah {} build/micropython/ports/unix/modules/
|
2018-10-06 10:32:17 +02:00
|
|
|
@touch $@
|
|
|
|
|
|
|
|
build/circuitpython/ports/atmel-samd/modules/.kmk_frozen: upy-freeze.txt submodules.toml
|
2018-10-08 16:06:34 +02:00
|
|
|
@echo "===> Preparing vendored dependencies for bundling into CircuitPython for atmel-samd"
|
|
|
|
@echo "===> Preparing vendored dependencies for bundling into CircuitPython for atmel-samd" >> .build.log
|
2018-10-06 10:32:17 +02:00
|
|
|
@rm -rf build/circuitpython/ports/atmel-samd/modules/*
|
2018-10-07 10:39:04 +02:00
|
|
|
@cat upy-freeze.txt | egrep -v '(^#|^\s*$|^\s*\t*#)' | grep CIRCUITPY | cut -d'|' -f2- | \
|
2018-10-08 16:06:34 +02:00
|
|
|
xargs -I '{}' rsync -ah {} build/circuitpython/ports/atmel-samd/modules/
|
2018-09-23 09:45:55 +02:00
|
|
|
@touch $@
|
|
|
|
|
2018-10-06 10:32:17 +02:00
|
|
|
build/circuitpython/ports/nrf/freeze/.kmk_frozen: upy-freeze.txt submodules.toml
|
2018-10-08 16:06:34 +02:00
|
|
|
@echo "===> Preparing vendored dependencies for bundling into CircuitPython for NRF"
|
|
|
|
@echo "===> Preparing vendored dependencies for bundling into CircuitPython for NRF" >> .build.log
|
2018-10-06 00:31:00 +02:00
|
|
|
@rm -rf build/circuitpython/ports/nrf/freeze/*
|
2018-10-07 10:39:04 +02:00
|
|
|
@cat upy-freeze.txt | egrep -v '(^#|^\s*$|^\s*\t*#)' | grep CIRCUITPY | cut -d'|' -f2- | \
|
2018-10-08 16:06:34 +02:00
|
|
|
xargs -I '{}' rsync -ah {} build/circuitpython/ports/nrf/freeze/
|
2018-09-03 10:23:15 +02:00
|
|
|
@touch $@
|
|
|
|
|
2018-10-06 10:32:17 +02:00
|
|
|
build/micropython/ports/stm32/freeze/.kmk_frozen: upy-freeze.txt submodules.toml
|
2018-10-08 16:06:34 +02:00
|
|
|
@echo "===> Preparing vendored dependencies for bundling into MicroPython for STM32"
|
|
|
|
@echo "===> Preparing vendored dependencies for bundling into MicroPython for STM32" >> .build.log
|
2018-10-06 00:31:00 +02:00
|
|
|
@mkdir -p build/micropython/ports/stm32/freeze/
|
|
|
|
@rm -rf build/micropython/ports/stm32/freeze/*
|
2018-10-07 10:39:04 +02:00
|
|
|
@cat upy-freeze.txt | egrep -v '(^#|^\s*$|^\s*\t*#)' | grep MICROPY | cut -d'|' -f2- | \
|
2018-10-08 16:06:34 +02:00
|
|
|
xargs -I '{}' rsync -ah {} build/micropython/ports/stm32/freeze/
|
2018-09-16 09:15:16 +02:00
|
|
|
@touch $@
|
|
|
|
|
2018-10-06 10:32:17 +02:00
|
|
|
circuitpy-freeze-kmk-atmel-samd: freeze-atmel-samd-build-deps
|
2018-10-08 16:06:34 +02:00
|
|
|
@echo "===> Preparing KMK source for bundling into CircuitPython for atmel-samd"
|
|
|
|
@echo "===> Preparing KMK source for bundling into CircuitPython for atmel-samd" >> .build.log
|
2018-10-06 10:32:17 +02:00
|
|
|
@rm -rf build/circuitpython/ports/atmel-samd/modules/kmk*
|
2018-10-08 16:06:34 +02:00
|
|
|
@rsync -ah kmk build/circuitpython/ports/atmel-samd/modules/ --exclude kmk/micropython
|
2018-10-06 10:32:17 +02:00
|
|
|
|
2018-10-06 00:31:00 +02:00
|
|
|
circuitpy-freeze-kmk-nrf: freeze-nrf-build-deps
|
2018-10-08 16:06:34 +02:00
|
|
|
@echo "===> Preparing KMK source for bundling into CircuitPython for NRF"
|
|
|
|
@echo "===> Preparing KMK source for bundling into CircuitPython for NRF" >> .build.log
|
2018-10-06 00:31:00 +02:00
|
|
|
@rm -rf build/circuitpython/ports/nrf/kmk*
|
2018-10-08 16:06:34 +02:00
|
|
|
@rsync -ah kmk build/circuitpython/ports/nrf/freeze/ --exclude kmk/micropython
|
2018-09-04 01:22:04 +02:00
|
|
|
|
2018-10-06 00:31:00 +02:00
|
|
|
micropython-freeze-kmk-stm32: freeze-stm32-build-deps
|
2018-10-08 16:06:34 +02:00
|
|
|
@echo "===> Preparing KMK source for bundling into MicroPython for STM32"
|
|
|
|
@echo "===> Preparing KMK source for bundling into MicroPython for STM32" >> .build.log
|
2018-10-06 00:31:00 +02:00
|
|
|
@rm -rf build/micropython/ports/stm32/freeze/kmk*
|
2018-10-08 16:06:34 +02:00
|
|
|
@rsync -ah kmk build/micropython/ports/stm32/freeze/ --exclude kmk/circuitpython
|
2018-09-16 09:15:16 +02:00
|
|
|
|
2018-10-06 10:32:17 +02:00
|
|
|
circuitpy-build-feather-m4-express:
|
2018-10-08 16:06:34 +02:00
|
|
|
@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
|
2018-10-06 10:32:17 +02:00
|
|
|
|
2018-10-07 09:22:54 +02:00
|
|
|
circuitpy-build-itsybitsy-m4-express:
|
2018-10-08 16:06:34 +02:00
|
|
|
@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
|
2018-10-07 09:22:54 +02:00
|
|
|
|
2018-09-17 22:25:37 +02:00
|
|
|
circuitpy-build-nrf:
|
2018-10-08 16:06:34 +02:00
|
|
|
@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
|
2018-09-17 22:25:37 +02:00
|
|
|
|
2018-10-06 10:32:17 +02:00
|
|
|
circuitpy-flash-feather-m4-express:
|
2018-10-08 16:06:34 +02:00
|
|
|
@echo
|
|
|
|
@echo "!!!!!!!!!!!!!!!!!!!!"
|
2018-10-06 10:32:17 +02:00
|
|
|
@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"
|
2018-10-08 16:06:34 +02:00
|
|
|
@echo "!!!!!!!!!!!!!!!!!!!!"
|
|
|
|
@echo
|
2018-10-06 10:32:17 +02:00
|
|
|
|
2018-10-07 09:22:54 +02:00
|
|
|
circuitpy-flash-itsybitsy-m4-express:
|
2018-10-08 16:06:34 +02:00
|
|
|
@echo
|
|
|
|
@echo "!!!!!!!!!!!!!!!!!!!!"
|
2018-10-07 09:22:54 +02:00
|
|
|
@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"
|
2018-10-08 16:06:34 +02:00
|
|
|
@echo "!!!!!!!!!!!!!!!!!!!!"
|
|
|
|
@echo
|
2018-10-07 09:22:54 +02:00
|
|
|
|
2018-09-17 22:25:37 +02:00
|
|
|
circuitpy-flash-nrf: circuitpy-build-nrf
|
|
|
|
@echo "===> Flashing CircuitPython with KMK and your keymap"
|
2018-10-08 16:06:34 +02:00
|
|
|
@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
|
2018-09-03 10:23:15 +02:00
|
|
|
|
2018-09-17 22:25:37 +02:00
|
|
|
micropython-build-pyboard:
|
2018-10-08 16:06:34 +02:00
|
|
|
@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
|
2018-09-17 22:25:37 +02:00
|
|
|
|
|
|
|
micropython-flash-pyboard: micropython-build-pyboard
|
2018-10-08 16:06:34 +02:00
|
|
|
@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
|
2018-09-16 09:15:16 +02:00
|
|
|
|
2018-09-03 10:23:15 +02:00
|
|
|
circuitpy-flash-nrf-entrypoint:
|
2018-09-03 08:39:55 +02:00
|
|
|
@echo "===> Flashing entrypoint if it doesn't already exist"
|
|
|
|
@sleep 2
|
2018-10-06 00:31:00 +02:00
|
|
|
@-timeout -k 5s 10s $(PIPENV) run ampy -p ${AMPY_PORT} -d ${AMPY_DELAY} -b ${AMPY_BAUD} rm main.py 2>/dev/null
|
|
|
|
@-timeout -k 5s 10s $(PIPENV) run ampy -p ${AMPY_PORT} -d ${AMPY_DELAY} -b ${AMPY_BAUD} put entrypoints/feather_nrf52832.py main.py
|
2018-09-03 08:39:55 +02:00
|
|
|
@echo "===> Flashed keyboard successfully!"
|
2018-09-03 05:06:53 +02:00
|
|
|
|
2018-10-06 10:32:17 +02:00
|
|
|
ifndef USER_KEYMAP
|
|
|
|
build-feather-m4-express:
|
|
|
|
@echo "===> Must provide a USER_KEYMAP (usually from user_keymaps/...) to build!" && exit 1
|
|
|
|
|
|
|
|
flash-feather-m4-express:
|
|
|
|
@echo "===> Must provide a USER_KEYMAP (usually from user_keymaps/...) to build!" && exit 1
|
|
|
|
else
|
2018-10-07 10:01:37 +02:00
|
|
|
ifndef SKIP_KEYMAP_VALIDATION
|
2018-10-08 16:06:34 +02:00
|
|
|
build-feather-m4-express: clean-build-log lint circuitpy-deps circuitpy-freeze-kmk-atmel-samd micropython-build-unix
|
2018-10-08 15:10:07 +02:00
|
|
|
else
|
2018-10-08 16:06:34 +02:00
|
|
|
build-feather-m4-express: clean-build-log lint circuitpy-deps circuitpy-freeze-kmk-atmel-samd
|
2018-10-07 10:01:37 +02:00
|
|
|
endif
|
2018-10-08 16:06:34 +02:00
|
|
|
@echo "===> Preparing keyboard script for bundling into CircuitPython for atmel-samd"
|
2018-10-07 10:01:37 +02:00
|
|
|
ifndef SKIP_KEYMAP_VALIDATION
|
|
|
|
@MICROPYPATH=./ ./bin/micropython.sh bin/keymap_sanity_check.py ${USER_KEYMAP}
|
|
|
|
endif
|
2018-10-07 10:55:41 +02:00
|
|
|
@rsync -ah ${USER_KEYMAP} build/circuitpython/ports/atmel-samd/modules/kmk_keyboard_user.py
|
2018-10-07 12:51:14 +02:00
|
|
|
@rsync -ah kmk/entrypoints/global.py build/circuitpython/ports/atmel-samd/modules/_main.py
|
2018-10-06 10:32:17 +02:00
|
|
|
@$(MAKE) circuitpy-build-feather-m4-express
|
|
|
|
|
2018-10-07 10:55:41 +02:00
|
|
|
flash-feather-m4-express: build-feather-m4-express circuitpy-flash-feather-m4-express
|
2018-10-06 10:32:17 +02:00
|
|
|
endif
|
|
|
|
|
2018-09-23 07:36:28 +02:00
|
|
|
ifndef USER_KEYMAP
|
2018-09-03 22:51:04 +02:00
|
|
|
build-feather-nrf52832:
|
2018-09-23 12:12:31 +02:00
|
|
|
@echo "===> Must provide a USER_KEYMAP (usually from user_keymaps/...) to build!" && exit 1
|
2018-09-17 22:25:37 +02:00
|
|
|
|
|
|
|
flash-feather-nrf52832:
|
2018-09-23 12:12:31 +02:00
|
|
|
@echo "===> Must provide a USER_KEYMAP (usually from user_keymaps/...) to build!" && exit 1
|
2018-09-03 22:51:04 +02:00
|
|
|
else
|
2018-10-08 16:06:34 +02:00
|
|
|
build-feather-nrf52832: clean-build-log lint circuitpy-deps circuitpy-freeze-kmk-nrf
|
|
|
|
@echo "===> Preparing keyboard script for bundling into CircuitPython for NRF"
|
2018-10-07 10:55:41 +02:00
|
|
|
@rsync -ah ${USER_KEYMAP} build/circuitpython/ports/nrf/freeze/kmk_keyboard_user.py
|
2018-09-17 22:25:37 +02:00
|
|
|
@$(MAKE) circuitpy-build-nrf
|
|
|
|
|
2018-10-08 16:06:34 +02:00
|
|
|
flash-feather-nrf52832: clean-build-log build-feather-nrf52832 circuitpy-flash-nrf circuitpy-flash-nrf-endpoint
|
2018-09-03 22:51:04 +02:00
|
|
|
endif
|
2018-09-03 10:23:15 +02:00
|
|
|
|
2018-10-07 09:22:54 +02:00
|
|
|
ifndef USER_KEYMAP
|
|
|
|
build-itsybitsy-m4-express:
|
|
|
|
@echo "===> Must provide a USER_KEYMAP (usually from user_keymaps/...) to build!" && exit 1
|
|
|
|
|
|
|
|
flash-itsybitsy-m4-express:
|
|
|
|
@echo "===> Must provide a USER_KEYMAP (usually from user_keymaps/...) to build!" && exit 1
|
|
|
|
else
|
2018-10-07 10:01:37 +02:00
|
|
|
ifndef SKIP_KEYMAP_VALIDATION
|
2018-10-08 16:06:34 +02:00
|
|
|
build-itsybitsy-m4-express: clean-build-log lint circuitpy-deps circuitpy-freeze-kmk-atmel-samd micropython-build-unix
|
2018-10-08 15:10:07 +02:00
|
|
|
else
|
2018-10-08 16:06:34 +02:00
|
|
|
build-itsybitsy-m4-express: clean-build-log lint circuitpy-deps circuitpy-freeze-kmk-atmel-samd
|
2018-10-07 10:01:37 +02:00
|
|
|
endif
|
2018-10-08 16:06:34 +02:00
|
|
|
@echo "===> Preparing keyboard script for bundling into CircuitPython for atmel-samd"
|
2018-10-07 10:01:37 +02:00
|
|
|
ifndef SKIP_KEYMAP_VALIDATION
|
|
|
|
@MICROPYPATH=./ ./bin/micropython.sh bin/keymap_sanity_check.py ${USER_KEYMAP}
|
|
|
|
endif
|
2018-10-07 10:55:41 +02:00
|
|
|
@rsync -ah ${USER_KEYMAP} build/circuitpython/ports/atmel-samd/modules/kmk_keyboard_user.py
|
2018-10-07 12:51:14 +02:00
|
|
|
@rsync -ah kmk/entrypoints/global.py build/circuitpython/ports/atmel-samd/modules/_main.py
|
2018-10-07 09:22:54 +02:00
|
|
|
@$(MAKE) circuitpy-build-itsybitsy-m4-express
|
|
|
|
|
2018-10-07 10:55:41 +02:00
|
|
|
flash-itsybitsy-m4-express: build-itsybitsy-m4-express circuitpy-flash-itsybitsy-m4-express
|
2018-09-04 01:22:04 +02:00
|
|
|
endif
|
|
|
|
|
2018-09-23 07:36:28 +02:00
|
|
|
ifndef USER_KEYMAP
|
2018-09-16 09:15:16 +02:00
|
|
|
build-pyboard:
|
2018-09-23 12:12:31 +02:00
|
|
|
@echo "===> Must provide a USER_KEYMAP (usually from user_keymaps/...) to build!" && exit 1
|
2018-09-17 22:25:37 +02:00
|
|
|
|
|
|
|
flash-pyboard:
|
2018-09-23 12:12:31 +02:00
|
|
|
@echo "===> Must provide a USER_KEYMAP (usually from user_keymaps/...) to build!" && exit 1
|
|
|
|
else
|
|
|
|
ifndef SKIP_KEYMAP_VALIDATION
|
2018-10-08 16:06:34 +02:00
|
|
|
build-pyboard: clean-build-log lint micropython-deps micropython-freeze-kmk-stm32 micropython-build-unix
|
2018-09-16 09:15:16 +02:00
|
|
|
else
|
2018-10-08 16:06:34 +02:00
|
|
|
build-pyboard: clean-build-log lint micropython-deps micropython-freeze-kmk-stm32
|
2018-09-23 12:12:31 +02:00
|
|
|
endif
|
2018-10-08 16:06:34 +02:00
|
|
|
@echo "===> Preparing keyboard script for bundling into MicroPython for STM32"
|
2018-09-23 12:12:31 +02:00
|
|
|
ifndef SKIP_KEYMAP_VALIDATION
|
|
|
|
@MICROPYPATH=./ ./bin/micropython.sh bin/keymap_sanity_check.py ${USER_KEYMAP}
|
|
|
|
endif
|
2018-10-07 10:55:41 +02:00
|
|
|
@rsync -ah ${USER_KEYMAP} build/micropython/ports/stm32/freeze/kmk_keyboard_user.py
|
|
|
|
@rsync -ah kmk/entrypoints/global.py build/micropython/ports/stm32/freeze/_main.py
|
|
|
|
@rsync -ah kmk/entrypoints/handwire/pyboard_boot.py build/micropython/ports/stm32/freeze/_boot.py
|
2018-09-17 22:25:37 +02:00
|
|
|
@$(MAKE) AMPY_PORT=/dev/ttyACM0 AMPY_BAUD=115200 micropython-build-pyboard
|
|
|
|
|
2018-10-07 10:55:41 +02:00
|
|
|
flash-pyboard: build-pyboard micropython-flash-pyboard
|
2018-09-16 09:15:16 +02:00
|
|
|
endif
|
|
|
|
|
2018-09-27 08:19:11 +02:00
|
|
|
reset-bootloader:
|
2018-10-06 00:31:00 +02:00
|
|
|
@-timeout -k 5s 10s $(PIPENV) run ampy -p /dev/ttyACM0 -d ${AMPY_DELAY} -b ${AMPY_BAUD} run util/bootloader.py
|
2018-09-27 08:19:11 +02:00
|
|
|
|
|
|
|
reset-board:
|
2018-10-06 00:31:00 +02:00
|
|
|
@-timeout -k 5s 10s $(PIPENV) run ampy -p /dev/ttyACM0 -d ${AMPY_DELAY} -b ${AMPY_BAUD} run util/reset.py
|