-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathbuild
More file actions
executable file
·76 lines (69 loc) · 2.2 KB
/
Copy pathbuild
File metadata and controls
executable file
·76 lines (69 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/env bash
TARGET=$1
shift
IFS=";"
CPP_FLAGS=$*
IFS=" "
# comment out the following line to disable USB logging
USB_LOGGING="-S zmk-usb-logging"
# comment out the following lines to disable ZMK Studio support
ZMK_STUDIO_SNIPPET="-S studio-rpc-usb-uart"
ZMK_STUDIO_CMAKE="-DCONFIG_ZMK_STUDIO=y"
# comment out the following line to enable incremental builds
PRISTINE="-p"
# target: Quacken Flex or Quacken Zero
# - Ergogen keebs rely on an MCU board, the keeb itself is just a shield
# - keebs with an integrated MCU are custom boards and don’t use any shield
BOARD=
SHIELD=
case $TARGET in
flex)
BOARD="-b quacken_flex"
;;
zero)
BOARD="-b sparkfun_pro_micro_rp2040//zmk"
SHIELD="-DSHIELD=quacken_zero"
;;
test)
BOARD="-b sparkfun_pro_micro_rp2040//zmk"
SHIELD="-DSHIELD=tester_pro_micro" # 'naked60' would work as well
;;
*)
echo "Usage:"
echo " $0 TARGET [optional_C++_flags]"
echo
echo "where TARGET can be:"
echo " - flex: Quacken Flex 25.10+ / embedded RP2040"
echo " - zero: Quacken Zero 25.07+ / SparkFun Pro Micro RP2040"
echo " - test: dummy tester shield / SparkFun Pro Micro RP2040"
echo
echo "[optional_C++_flags] are defined in keymaps/quacken.keymap:"
echo " - layout (qwerty by default): KB_LAYOUT_{ERGOL,AZERTY,QWERTY_LAFAYETTE...}"
echo " - hold-taps (HRM by default): HT_{NONE,THUMB_TAPS,HOME_ROW_MODS} "
echo " - options: VIM_NAVIGATION, LEFT_HAND_SPACE, HRM_SHIFT, MACOS"
echo
exit 1
;;
esac
# ensure we have a symlink to a proper ZMK setup
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
ZMK_APP_DIR=$SCRIPT_DIR/zmk/app
if [ ! -d $ZMK_APP_DIR ]; then
echo "Expecting a 'zmk' symlink to your local ZMK/Zephyr setup. Aborting."
exit 1
fi
# build
cd $ZMK_APP_DIR
source ../.venv/bin/activate
west build $PRISTINE $USB_LOGGING $ZMK_STUDIO_SNIPPET $BOARD -- $SHIELD \
$ZMK_STUDIO_CMAKE \
-DKEYMAP_FILE="$SCRIPT_DIR/keymaps/quacken.keymap" \
-DZMK_EXTRA_MODULES="$SCRIPT_DIR" \
-DDTS_EXTRA_CPPFLAGS="$CPP_FLAGS" && {
OUTPUT_FILE="zmk_quacken_$TARGET.uf2"
mv build/zephyr/zmk.uf2 "$SCRIPT_DIR/$OUTPUT_FILE"
echo
echo "Successfully generated: $OUTPUT_FILE"
echo " \\_o<"
# check $ZMK_APP_DIR/build/zephyr/.config
}