summaryrefslogtreecommitdiff
path: root/include/rom.sh
diff options
context:
space:
mode:
Diffstat (limited to 'include/rom.sh')
-rw-r--r--include/rom.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/include/rom.sh b/include/rom.sh
index ec2ad650..0ea791d2 100644
--- a/include/rom.sh
+++ b/include/rom.sh
@@ -3,7 +3,7 @@
# Copyright (c) 2021-2022 Ferass El Hafidi <vitali64pmemail@protonmail.com>
# Copyright (c) 2022 Caleb La Grange <thonkpeasant@protonmail.com>
# Copyright (c) 2022-2023 Alper Nebi Yasak <alpernebiyasak@gmail.com>
-# Copyright (c) 2023 Riku Viitanen <riku.viitanen@protonmail.com>
+# Copyright (c) 2023-2024 Riku Viitanen <riku.viitanen@protonmail.com>
mkserprog()
{
@@ -11,7 +11,14 @@ mkserprog()
basename -as .h "$serdir/"*.h > "$TMPDIR/ser" || $err "!mk $1 $TMPDIR"
while read -r sertarget; do
- [ "$1" = "rp2040" ] && x_ cmake -DPICO_BOARD="$sertarget" \
+ [ "$1" = "pico" ] &&
+ x_ rm -rf "$sersrc/build" \
+ && (pt=$(x_ grep "pico_cmake_set" \
+ "$picosdk/src/boards/include/boards/$sertarget.h" \
+ | grep "PICO_PLATFORM" | cut -d= -f2 | tr -d [:blank:])
+ mkdir -p "$sersrc/build_$pt"
+ ln -srf "$sersrc/build_$pt/" "$sersrc/build") \
+ && x_ cmake -DPICO_BOARD="$sertarget" \
-DPICO_SDK_PATH="$picosdk" -B "$sersrc/build" "$sersrc" \
&& x_ cmake --build "$sersrc/build"
[ "$1" = "stm32" ] && x_ make -C "$sersrc" \