Skip to content

Commit

Permalink
add: better build system
Browse files Browse the repository at this point in the history
  • Loading branch information
zeljkobekcic committed Jul 9, 2024
1 parent 1b1e9b9 commit 2d3bdbd
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env zsh

ZMK_APP_PATH="$HOME/Projects/Private/zmk/app"
ZMK_CONFIG_PATH="$HOME/Projects/Private/temper-zmk-config/config"
ZMK_EXTRA_MODULES_PATH="$HOME/Projects/Private/temper-zmk-config"
OUTPUT_DIRECTORY="$HOME/Projects/Private/temper-zmk-config/outputs/"

rm -rf "$OUTPUT_DIRECTORY"
mkdir -p "$OUTPUT_DIRECTORY"

cd "$ZMK_APP_PATH"
source ../.venv/bin/activate

yq '.include | map(.board + " " + .shield)' "$ZMK_EXTRA_MODULES_PATH/build.yaml" | while read line; do
board=$(echo $line | awk '{ print $2 }')
shield=$(echo $line | awk '{ print $3 }')

west build -d "build/$shield-$board" -b $board --pristine -- -DZMK_CONFIG="$ZMK_CONFIG_PATH" -DSHIELD=$shield -DZMK_EXTRA_MODULES="$ZMK_EXTRA_MODULES_PATH"
cp "build/$shield-$board/zephyr/zmk.uf2" "$OUTPUT_DIRECTORY/$shield-$board.uf2"
done

deactivate

rm -rf build

cd -

0 comments on commit 2d3bdbd

Please sign in to comment.