sh-elf-gcc/install.sh

34 lines
952 B
Bash
Executable File

#! /usr/bin/env bash
# Avoid rebuilds of the same version
[[ -e "build/giteapc-skip-rebuild.txt" ]] && exit 0
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
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
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