aboutsummaryrefslogtreecommitdiff
path: root/build.common
blob: b5685cd41624ab440e0d5dd2b132a93d5eb6413f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Script to build RISC-V ISA simulator, proxy kernel, and GNU toolchain.
# Tools will be installed to $RISCV.

JOBS=16

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$JOBS >> build.log
  echo "Installing project $1"
  make -j$JOBS install >> build.log
  cd - > /dev/null
}

function build_tests {
  echo
  cd riscv-tests/isa > /dev/null
  echo "Building project riscv-tests/isa"
  make -j$JOBS clean > /dev/null
  make -j$JOBS > /dev/null
  cd - > /dev/null
  cd riscv-tests/benchmarks > /dev/null
  echo "Building project riscv-tests/benchmarks"
  make -j$JOBS clean > /dev/null
  make -j$JOBS > /dev/null
  cd - > /dev/null
}