2020-12-30 23:03:15 +01:00
|
|
|
#! /usr/bin/env bash
|
|
|
|
|
2021-01-08 10:00:34 +01:00
|
|
|
# Avoid rebuilds of the same version
|
|
|
|
[[ ! -d build ]] && exit 0
|
|
|
|
|
2021-01-02 00:13:11 +01:00
|
|
|
source util.sh
|
|
|
|
PREFIX="$1"
|
|
|
|
|
2021-03-18 14:25:27 +01:00
|
|
|
if command -v gmake >/dev/null 2>&1; then
|
|
|
|
make_command=gmake
|
|
|
|
else
|
|
|
|
make_command=make
|
|
|
|
fi
|
|
|
|
|
2021-01-02 00:13:11 +01:00
|
|
|
cd build
|
|
|
|
echo "$TAG Installing to local folder..."
|
|
|
|
run_quietly giteapc-install.log \
|
2021-03-18 14:25:27 +01:00
|
|
|
$make_command install-strip-gcc install-strip-target-libgcc
|
2021-01-02 00:13:11 +01:00
|
|
|
cd ..
|
|
|
|
|
|
|
|
# Symbolic link executables to $PREFIX/bin
|
|
|
|
echo "$TAG Symlinking binaries..."
|
|
|
|
for x in bin/*; do
|
2021-01-04 14:11:25 +01:00
|
|
|
ln -sf "$(pwd)/$x" "$PREFIX/$x"
|
2020-12-30 23:03:15 +01:00
|
|
|
done
|
|
|
|
|
2021-01-02 00:13:11 +01:00
|
|
|
# Cleanup build files
|
|
|
|
echo "$TAG Cleaning up build files..."
|
|
|
|
rm -rf gcc-*/ gcc-*.tar.*
|
|
|
|
rm -rf build/
|