Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runs make clean after make-install to reduce used disk #855

Merged
merged 5 commits into from
Apr 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ version: 2.1
parameters:
tools-cache-version:
type: string
default: "v6"
default: "v7"

# default execution env.s
executors:
Expand Down
20 changes: 12 additions & 8 deletions scripts/build-toolchains.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand All @@ -37,6 +38,7 @@ die() {
TOOLCHAIN="riscv-tools"
EC2FASTINSTALL="false"
IGNOREQEMU=""
CLEANAFTERINSTALL=""
RISCV=""
ARCH=""

Expand All @@ -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 )
Expand Down
6 changes: 6 additions & 0 deletions scripts/build-util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ module_make() ( # <submodule> <target..>
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() ( # <submodule> [configure-arg..]
Expand Down Expand Up @@ -81,6 +84,9 @@ module_build() ( # <submodule> [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
)

Expand Down