diff options
| author | Bond_009 <bond.009@outlook.com> | 2022-11-05 23:12:31 +0100 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2022-11-05 23:12:31 +0100 |
| commit | b0ca9b1780d048e54bc269b8f224dc17e9af35b2 (patch) | |
| tree | 17fedfeefc004cebdad97e84f896d0aa9f674b1a /scripts/.local/bin/update-gdb | |
| parent | 11be9bde17c8b949118f02acbfd04adf16df1e04 (diff) | |
Add update-gdb script
Diffstat (limited to 'scripts/.local/bin/update-gdb')
| -rwxr-xr-x | scripts/.local/bin/update-gdb | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/scripts/.local/bin/update-gdb b/scripts/.local/bin/update-gdb new file mode 100755 index 0000000..e6e0c6d --- /dev/null +++ b/scripts/.local/bin/update-gdb @@ -0,0 +1,36 @@ +#!/bin/sh + +set -ef + +TARGETS="aarch64-elf riscv64-elf x86_64-elf" + +[ -z "$1" ] && echo "$0: missing url" && exit 1 + +if [ -n "$2" ]; then + TARGETS="$2" +fi + +TMPFILE=$(mktemp) +TMPDIR=$(mktemp -d) + +echo "downloading..." +curl -o "$TMPFILE" "$1" +echo "extracting..." +tar Jxf "$TMPFILE" --strip-components=1 -C "$TMPDIR" +echo "cleaning up temp file" +rm "$TMPFILE" +cd "$TMPDIR" +for TARGET in $TARGETS +do + echo "configuring target $TARGET..." + ./configure --target="$TARGET" --prefix="$HOME/opt/cross" \ + --disable-nls --disable-werror + echo "building target $TARGET..." + make -j "$(nproc)" + echo "installing target $TARGET..." + make install + echo "cleaning after target $TARGET" + make distclean +done +echo "cleaning up temp dir" +rm -rf "$TMPDIR" |
