sh-elf-gcc/install.sh

34 lines
952 B
Bash
Raw Permalink Normal View History

#! /usr/bin/env bash
2021-01-08 10:00:34 +01:00
# Avoid rebuilds of the same version
[[ -e "build/giteapc-skip-rebuild.txt" ]] && exit 0
2021-01-08 10:00:34 +01:00
source util.sh
PREFIX="$1"
cd build
if [[ -e "giteapc-build-libstdcxx.txt" ]]; then
echo "$TAG Installing libstdc++-v3 to the SuperH sysroot..."
run_quietly giteapc-install-libstdcxx.log \
$MAKE_COMMAND -j"$cores" install-strip-target-libstdc++-v3
2021-03-18 14:25:27 +01:00
else
echo "$TAG Installing GCC to the SuperH sysroot..."
run_quietly giteapc-install.log \
$MAKE_COMMAND install-strip-gcc install-strip-target-libgcc
# Symbolic link executables to $PREFIX/bin
echo "$TAG Symlinking sysroot binaries to $PREFIX/bin..."
mkdir -p "$PREFIX/bin"
for f in "$SYSROOT/bin"/*; do
ln -sf "$f" "$PREFIX/${f#$SYSROOT/}"
done
2021-03-18 14:25:27 +01:00
fi
cd ..
# Cleanup build files after installing libstdc++
if [[ ! -z "$CONFIG_CLEAN" && -e "build/giteapc-build-libstdcxx.txt" ]]; then
echo "$TAG Cleaning up build files..."
rm -rf gcc-*/ gcc-*.tar.* build/
fi