diff --git a/.circleci/config.yml b/.circleci/config.yml index bdd90443..805611eb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ version: 2.1 parameters: tools-cache-version: type: string - default: "v6" + default: "v7" # default execution env.s executors: diff --git a/scripts/build-toolchains.sh b/scripts/build-toolchains.sh index ec2920a2..f4d20849 100755 --- a/scripts/build-toolchains.sh +++ b/scripts/build-toolchains.sh @@ -18,11 +18,12 @@ usage() { echo " ec2fast: if set, pulls in a pre-compiled RISC-V toolchain for an EC2 manager instance" echo "" echo "Options" - echo " --prefix PREFIX : Install destination. If unset, defaults to $(pwd)/riscv-tools-install" - echo " or $(pwd)/esp-tools-install" - echo " --ignore-qemu : Ignore installing QEMU" - echo " --arch -a : Architecture (e.g., rv64gc)" - echo " --help -h : Display this message" + echo " --prefix PREFIX : Install destination. If unset, defaults to $(pwd)/riscv-tools-install" + echo " or $(pwd)/esp-tools-install" + echo " --ignore-qemu : Ignore installing QEMU" + echo " --clean-after-install : Run make clean in calls to module_make and module_build" + echo " --arch -a : Architecture (e.g., rv64gc)" + echo " --help -h : Display this message" exit "$1" } @@ -37,6 +38,7 @@ die() { TOOLCHAIN="riscv-tools" EC2FASTINSTALL="false" IGNOREQEMU="" +CLEANAFTERINSTALL="" RISCV="" ARCH="" @@ -51,9 +53,11 @@ do RISCV=$(realpath $1) ;; --ignore-qemu ) IGNOREQEMU="true" ;; - -a | --arch ) - shift - ARCH=$1 ;; + -a | --arch ) + shift + ARCH=$1 ;; + --clean-after-install ) + CLEANAFTERINSTALL="true" ;; riscv-tools | esp-tools) TOOLCHAIN=$1 ;; ec2fast ) diff --git a/scripts/build-util.sh b/scripts/build-util.sh index 892b274d..1af11aee 100644 --- a/scripts/build-util.sh +++ b/scripts/build-util.sh @@ -49,6 +49,9 @@ module_make() ( # cd "${SRCDIR}/${1}/build" shift "${MAKE}" "$@" | tee "build-${1:-make}.log" + if [ -n "$CLEANAFTERINSTALL" ] ; then + "${MAKE}" clean # get rid of intermediate files + fi ) module_build() ( # [configure-arg..] @@ -81,6 +84,9 @@ module_build() ( # [configure-arg..] "${MAKE}" echo "==> Installing ${name}" "${MAKE}" install + if [ -n "$CLEANAFTERINSTALL" ] ; then + "${MAKE}" clean # get rid of intermediate files + fi } 2>&1 | tee build.log )