From 5b6bf2a82631f15ad8d3923520e678b9b0065302 Mon Sep 17 00:00:00 2001 From: Alper Nebi Yasak Date: Wed, 7 Dec 2022 21:55:05 +0300 Subject: 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 --- resources/scripts/build/boot/roms_helper | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/resources/scripts/build/boot/roms_helper b/resources/scripts/build/boot/roms_helper index abec7402..f533e6ab 100755 --- a/resources/scripts/build/boot/roms_helper +++ b/resources/scripts/build/boot/roms_helper @@ -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- ;; -- cgit v1.2.1