build/roms: Don't rebuild crossgcc if it was already built

The roms_helper script skips building crossgcc-i386 if its target
directory exists. Skip it for other architectures as well.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
fsdg20230625
Alper Nebi Yasak 2022-12-07 21:55:05 +03:00
parent bee5054077
commit 5b6bf2a826
1 changed files with 15 additions and 17 deletions

View File

@ -175,36 +175,34 @@ if [ ! -d "${cbdir}" ]; then
./download coreboot ${cbtree}
fi
cat version > "${cbdir}/.coreboot-version"
if [ "${arch}" = "x86_32" ] || [ "${arch}" = "x86_64" ]; then
if [ ! -d "${cbdir}/util/crossgcc/xgcc/i386-elf/" ]; then
(
cat version > "${cbdir}/.coreboot-version"
cd "${cbdir}"
make crossgcc-i386 CPUS=$(nproc) # even for 64-bit machines, coreboot builds
# 32-bit ROM images, so we only need to worry about i386-elf
)
# Even for 64-bit machines, coreboot builds 32-bit ROM
# images, so we only need to worry about i386-elf
make -C "${cbdir}" crossgcc-i386 CPUS=$(nproc)
fi
case "$(uname -m)" in
x86*|i*86|amd64) : ;;
*) export CROSS_COMPILE=i386-elf- ;;
esac
elif [ "${arch}" = "ARMv7" ]; then
(
cat version > "${cbdir}/.coreboot-version"
cd "${cbdir}"
make crossgcc-arm CPUS=$(nproc) # This is for armv7, doesn't apply to aarch64
)
if [ ! -d "${cbdir}/util/crossgcc/xgcc/arm-eabi/" ]; then
make -C "${cbdir}" crossgcc-arm CPUS=$(nproc)
fi
case "$(uname -m)" in
arm|arm32|armv6*|armv7*) : ;;
*) export CROSS_COMPILE=arm-eabi- ;;
esac
elif [ "${arch}" = "AArch64" ]; then
(
cat version > "${cbdir}/.coreboot-version"
cd "${cbdir}"
# aarch64 needs armv7 toolchain for arm-trusted-firmware
make crossgcc-arm crossgcc-aarch64 CPUS=$(nproc)
)
if [ ! -d "${cbdir}/util/crossgcc/xgcc/aarch64-elf/" ]; then
make -C "${cbdir}" crossgcc-aarch64 CPUS=$(nproc)
fi
# aarch64 also needs armv7 toolchain for arm-trusted-firmware
if [ ! -d "${cbdir}/util/crossgcc/xgcc/arm-eabi/" ]; then
make -C "${cbdir}" crossgcc-arm CPUS=$(nproc)
fi
case "$(uname -m)" in
arm64|aarch64) : ;;
*) export CROSS_COMPILE=aarch64-elf- ;;