summaryrefslogtreecommitdiff
path: root/include/rom.sh
diff options
context:
space:
mode:
Diffstat (limited to 'include/rom.sh')
-rw-r--r--include/rom.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/rom.sh b/include/rom.sh
index 2a7bc837..3e8c9c9b 100644
--- a/include/rom.sh
+++ b/include/rom.sh
@@ -7,7 +7,11 @@
mkserprog()
{
+ [ $# -lt 1 ] && $err "mkserprog: no arguments provided"
[ "$_f" = "-d" ] && return 0 # dry run
+
+ [ "$1" = "pico" ] && mkpicotool
+
basename -as .h "$serdir/"*.h > "$TMPDIR/ser" || $err "!mk $1 $TMPDIR"
while read -r sertarget; do
@@ -20,6 +24,7 @@ mkserprog()
ln -srf "$sersrc/build_$pt/" "$sersrc/build") \
&& x_ cmake -DPICO_BOARD="$sertarget" \
-DPICO_SDK_PATH="$picosdk" -B "$sersrc/build" "$sersrc" \
+ -Dpicotool_DIR="$picotool/picotool" \
&& x_ cmake --build "$sersrc/build"
[ "$1" = "stm32" ] && x_ make -C "$sersrc" \
libopencm3-just-make BOARD=$sertarget && x_ make -C \
@@ -30,6 +35,18 @@ mkserprog()
[ "$XBMK_RELEASE" = "y" ] && mkrom_tarball "bin/serprog_$1"; return 0
}
+mkpicotool()
+{
+ rm -Rf "$picotool" || $err "Can't remove picotool builddir"
+ (
+ x_ cd src/picotool
+ cmake -DCMAKE_INSTALL_PREFIX=xbmkbin -DPICOTOOL_FLAT_INSTALL=1 \
+ -DPICO_SDK_PATH=../pico-sdk || \
+ $err "Can't prep picotool"
+ make install || $err "Can't build picotool"; :
+ ) || $err "Can't build picotool"; :
+}
+
copyps1bios()
{
x_ rm -Rf bin/playstation