build: wire qmk.json build target and justfile recipes

This commit is contained in:
2026-05-03 23:43:27 +02:00
parent 9f0d9921c6
commit e9ce66f246
3 changed files with 27 additions and 1 deletions

View File

@@ -2,6 +2,22 @@
default:
@just --list
# compile moonlander matej keymap (artifact lands in firmware/)
moonlander:
make -C qmk_upstream zsa/moonlander:matej QMK_USERSPACE={{justfile_directory()}}
mkdir -p firmware
mv -f zsa_moonlander_matej.bin firmware/
rm -f qmk_upstream/zsa_moonlander_matej.bin
# compile + flash moonlander (polls until keyboard is in DFU mode; -d filter avoids the Cambridge DAC VID:PID collision)
flash-moonlander: moonlander
until dfu-util -a 0 -d 0483:df11 -s 0x08000000:leave -D firmware/zsa_moonlander_matej.bin >/dev/null 2>&1; do sleep 0.5; done
@echo "flashed"
# generate compile_commands.json for clangd / LSP
compdb:
cd qmk_upstream && QMK_USERSPACE={{justfile_directory()}} qmk compile --compiledb -kb zsa/moonlander -km matej
# format C/H files in place
fmt:
git ls-files '*.c' '*.h' | xargs --no-run-if-empty clang-format -i