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
|
2022-08-19 15:23:21 +02:00
|
|
|
[[ -e "build/giteapc-skip-rebuild.txt" ]] && exit 0
|
2021-01-08 10:00:34 +01:00
|
|
|
|
2021-01-02 00:13:11 +01:00
|
|
|
source util.sh
|
|
|
|
cd build
|
2020-12-30 23:03:15 +01:00
|
|
|
|
2021-03-18 14:24:13 +01:00
|
|
|
# Number of processor cores
|
2022-02-18 08:57:22 +01:00
|
|
|
if [[ $(uname) == "OpenBSD" || $(uname) == "Darwin" ]]; then
|
2021-03-18 14:24:13 +01:00
|
|
|
cores=$(sysctl -n hw.ncpu)
|
|
|
|
else
|
|
|
|
cores=$(nproc)
|
|
|
|
fi
|
|
|
|
|
2022-08-19 15:23:21 +02:00
|
|
|
if [[ -e "giteapc-build-libstdcxx.txt" ]]; then
|
|
|
|
echo "$TAG Compiling libstdc++-v3..."
|
|
|
|
run_quietly giteapc-build-libstdcxx.log \
|
|
|
|
$MAKE_COMMAND -j"$cores" all-target-libstdc++-v3
|
2021-03-18 14:25:27 +01:00
|
|
|
else
|
2022-08-19 15:23:21 +02:00
|
|
|
echo "$TAG Compiling gcc (usually 10-20 minutes)..."
|
|
|
|
run_quietly giteapc-build.log \
|
|
|
|
$MAKE_COMMAND -j"$cores" all-gcc all-target-libgcc
|
2021-03-18 14:25:27 +01:00
|
|
|
fi
|