From de6d2f556f16cae1a2c038f50d90a3a3945e3d42 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 6 Jan 2025 16:53:12 +0000 Subject: pico-sdk: Import picotool as a dependency We were previously not handling picotool at all, and pico-sdk would download picotool itself, at build time. This means that the source archive, if created, would not contain picotool. While not strictly required, for complete corresponding source, since it's a toolchain and not the actual pico-serprog firmware, it is my policy that releases must include full corresponding source code, when it is feasible to do so. I must say, I intensely dislike cmake, with such burning passion; I am thoroughly displeased by how hacky this is, but it works and now nothing is in my way for a Libreboot 20241206 rev8 release! Signed-off-by: Leah Rowe --- include/rom.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include') diff --git a/include/rom.sh b/include/rom.sh index 2a7bc837..52e39b52 100644 --- a/include/rom.sh +++ b/include/rom.sh @@ -7,6 +7,9 @@ mkserprog() { + [ $# -lt 1 ] && $err "mkserprog: no arguments provided" + [ "$1" = "pico" ] && mkpicotool + [ "$_f" = "-d" ] && return 0 # dry run basename -as .h "$serdir/"*.h > "$TMPDIR/ser" || $err "!mk $1 $TMPDIR" @@ -20,6 +23,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 +34,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 -- cgit v1.2.1