diff options
author | Andrew Waterman <waterman@cs.berkeley.edu> | 2013-01-25 19:02:58 -0800 |
---|---|---|
committer | Andrew Waterman <waterman@cs.berkeley.edu> | 2013-01-25 19:02:58 -0800 |
commit | c598c77b838a8e84be9a683e104fbf8ac55d3cd5 (patch) | |
tree | 4f1ed1123788887379a0b64df66b1f69207c4cdd /build.common | |
parent | bbfe0a699344e53cabbda2113777804c5e42173a (diff) | |
download | riscv-tools-c598c77b838a8e84be9a683e104fbf8ac55d3cd5.zip riscv-tools-c598c77b838a8e84be9a683e104fbf8ac55d3cd5.tar.gz riscv-tools-c598c77b838a8e84be9a683e104fbf8ac55d3cd5.tar.bz2 |
update to library-based fesvr; assume $RISCV env var
Diffstat (limited to 'build.common')
-rw-r--r-- | build.common | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/build.common b/build.common new file mode 100644 index 0000000..50aaac0 --- /dev/null +++ b/build.common @@ -0,0 +1,40 @@ +# Script to build RISC-V ISA simulator, proxy kernel, and GNU toolchain. +# Tools will be installed to $RISCV. + +if [ "x$RISCV" = "x" ] +then + echo "Please set the RISCV environment variable to your preferred install path." + exit 1 +fi + +PATH="$RISCV/bin:$PATH" +#GCC_VERSION=`gcc -v 2>&1 | tail -1 | awk '{print $3}'` + +set -e + +function build_project { + echo + if [ -e "$1/build" ] + then + echo "Removing existing $1/build directory" + rm -rf $1/build + fi + mkdir -p $1/build + cd $1/build + echo "Configuring project $1" + ../configure $2 $3 $4 > build.log + echo "Building project $1" + make -j > build.log + echo "Installing project $1" + make install > build.log + cd - > /dev/null +} + +function build_gcc { + echo + cd riscv-gcc + echo "Building project riscv-gcc" + make clean + make newlib INSTALL_DIR=$RISCV > build.log + cd .. +} |