summaryrefslogtreecommitdiff
path: root/bin/build.sh
diff options
context:
space:
mode:
authorThomas Huber <113915837+huber-th@users.noreply.github.com>2024-02-05 01:55:24 -0800
committerGitHub <noreply@github.com>2024-02-05 09:55:24 +0000
commitcbc065666897ce7ae66a4e7d30c88211537f6148 (patch)
treecd2386a0360c6e13e9804c8a637f601408168a3d /bin/build.sh
parent0737d53e019903fd986df25d1ee3384f16ad7639 (diff)
Makefile enhancements to optimize local workflows (#363)
- Enhance the Makefile to enable firmware building exclusively for the left side. To modify the keymap, flashing only the left side's firmware suffices. This change facilitates the creation of firmware for the left side only, thereby expediting the build process. Usage: make left This update maintains existing functionality. Without specifying the left target, firmware for both halves will be generated. - Add separate make targets to clean firmware and docker image Add targets clean_firmware and clean_image independently while maintaing clean to run both - Ensure files modified by the build process are reset at the end The current build process dynamically generates the content of the version macro in config/version.dtsi to enable users to print out the precise version and commit the firmware was built on via a keybinding on the keymap. This change ensurs that the changes to this macro file are reset at the end of the build process to ensure it isn't shown as modified and added to keymap commit changes.
Diffstat (limited to 'bin/build.sh')
-rwxr-xr-xbin/build.sh16
1 files changed, 11 insertions, 5 deletions
diff --git a/bin/build.sh b/bin/build.sh
index cd68988..bab8570 100755
--- a/bin/build.sh
+++ b/bin/build.sh
@@ -10,9 +10,15 @@ COMMIT="${COMMIT:-$(echo xxxxxx)}"
west build -s zmk/app -d build/left -b adv360_left -- -DZMK_CONFIG="${PWD}/config"
# Adv360 Left Kconfig file
grep -vE '(^#|^$)' build/left/zephyr/.config
-# West Build (right)
-west build -s zmk/app -d build/right -b adv360_right -- -DZMK_CONFIG="${PWD}/config"
-# Adv360 Right Kconfig file
-grep -vE '(^#|^$)' build/right/zephyr/.config
# Rename zmk.uf2
-cp build/left/zephyr/zmk.uf2 "./firmware/${TIMESTAMP}-${COMMIT}-left.uf2" && cp build/right/zephyr/zmk.uf2 "./firmware/${TIMESTAMP}-${COMMIT}-right.uf2"
+cp build/left/zephyr/zmk.uf2 "./firmware/${TIMESTAMP}-${COMMIT}-left.uf2"
+
+# Build right side if selected
+if [ "${BUILD_RIGHT}" = true ]; then
+ # West Build (right)
+ west build -s zmk/app -d build/right -b adv360_right -- -DZMK_CONFIG="${PWD}/config"
+ # Adv360 Right Kconfig file
+ grep -vE '(^#|^$)' build/right/zephyr/.config
+ # Rename zmk.uf2
+ cp build/right/zephyr/zmk.uf2 "./firmware/${TIMESTAMP}-${COMMIT}-right.uf2"
+fi