Skip to content

Commit 498b996

Browse files
committed
build updates
add get_variant_name.sh script build_all: convert to read from targets.json
1 parent 99504de commit 498b996

File tree

4 files changed

+28
-13
lines changed

4 files changed

+28
-13
lines changed

extra/build.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ source venv/bin/activate
2424
ZEPHYR_BASE=$(west topdir)/zephyr
2525

2626
# Get the variant name (NORMALIZED_BOARD_TARGET in Zephyr)
27-
tmpdir=$(mktemp -d)
28-
variant=$(cmake -DBOARD=$board -P extra/get_variant_name.cmake | grep 'VARIANT=' | cut -d '=' -f 2)
29-
rm -rf ${tmpdir}
27+
variant=$(extra/get_variant_name.sh $board)
3028

3129
if [ -z "${variant}" ] ; then
3230
echo "Failed to get variant name from '$board'"

extra/build_all.sh

+7-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
# Update this file if a new board gets supported
2-
1+
#!/bin/bash
2+
#
33
set -e
44

5-
./extra/build.sh arduino_giga_r1//m7 --shield giga_display_shield
6-
./extra/build.sh arduino_nano_33_ble//sense
7-
./extra/build.sh arduino_nicla_sense_me
8-
./extra/build.sh arduino_portenta_c33
9-
./extra/build.sh [email protected]//m7
10-
./extra/build.sh ek_ra8d1
11-
./extra/build.sh frdm_mcxn947/mcxn947/cpu0
12-
./extra/build.sh frdm_rw612
5+
jq -cr '.[]' < ./extra/targets.json | while read -r item; do
6+
board=$(jq -cr '.board' <<< "$item")
7+
args=$(jq -cr '.args' <<< "$item")
8+
./extra/build.sh "$board" $args
9+
done

extra/get_variant_name.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# Get the variant name (NORMALIZED_BOARD_TARGET in Zephyr)
5+
tmpdir=$(mktemp -d)
6+
variant=$(cmake -DBOARD=$1 -P extra/get_variant_name.cmake | grep 'VARIANT=' | cut -d '=' -f 2)
7+
rm -rf ${tmpdir}
8+
9+
echo $variant

extra/targets.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[
2+
{ "board": "arduino_giga_r1//m7", "args": "--shield giga_display_shield" },
3+
{ "board": "arduino_nano_33_ble//sense" },
4+
{ "board": "arduino_nicla_sense_me" },
5+
{ "board": "arduino_portenta_c33" },
6+
{ "board": "[email protected]//m7" },
7+
{ "board": "ek_ra8d1" },
8+
{ "board": "frdm_mcxn947/mcxn947/cpu0" },
9+
{ "board": "frdm_rw612" },
10+
{}
11+
]

0 commit comments

Comments
 (0)