aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml1
-rw-r--r--README.md9
-rw-r--r--build.common26
3 files changed, 16 insertions, 20 deletions
diff --git a/.travis.yml b/.travis.yml
index d216aca..8286cdb 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -27,6 +27,7 @@ addons:
env:
global:
- RISCV="/home/travis/riscv_install"
+ - MAKEFLAGS="-j3"
- PATH="/home/travis/riscv_install/bin:$PATH"
before_install:
diff --git a/README.md b/README.md
index 462a3e1..2ac8e19 100644
--- a/README.md
+++ b/README.md
@@ -30,7 +30,7 @@ To use a compiler different than the default, use:
$ CC=gcc-5 CXX=g++-5 ./build.sh
-_Note for OS X:_ We recommend using [Homebrew](http://brew.sh) to install the dependencies (`gawk gnu-sed gmp mpfr libmpc isl`) or even to install the tools [directly](https://github.com/riscv/homebrew-riscv). This repo will build with Apple's command-line developer tools (clang) in addition to gcc.
+_Note for OS X:_ We recommend using [Homebrew](http://brew.sh) to install the dependencies (`gawk gnu-sed gmp mpfr libmpc isl wget`) or even to install the tools [directly](https://github.com/riscv/homebrew-riscv). This repo will build with Apple's command-line developer tools (clang) in addition to gcc.
# <a name="newlibman"></a>The RISC-V GCC/Newlib Toolchain Installation Manual
@@ -206,12 +206,7 @@ environment variable now:
$ export PATH=$PATH:$RISCV/bin
-One more thing: If your machine doesn't have the capacity to
-handle 16 make jobs (or conversely, it can handle more), edit
-`build.common` to change the number specified by
-`JOBS`.
-
- O$ sed -i 's/JOBS=16/JOBS=[number]/' build.common
+The number of parallel compiler runs is set by `$MAKEFLAGS`.
With everything else set up, run the build script. Recall that if you're using a new-version of gcc that isn't the default on your system, you'll need to precede the `./build.sh` with `CC=gcc-4.8 CXX=g++-4.8`:
diff --git a/build.common b/build.common
index ec7cf11..3b6a1c4 100644
--- a/build.common
+++ b/build.common
@@ -1,8 +1,6 @@
# 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."
@@ -18,19 +16,21 @@ PATH="$RISCV/bin:$PATH"
set -e
function build_project {
+ PROJECT="$1"
+ shift
echo
- if [ -e "$1/build" ]
+ if [ -e "$PROJECT/build" ]
then
- echo "Removing existing $1/build directory"
- rm -rf $1/build
+ echo "Removing existing $PROJECT/build directory"
+ rm -rf "$PROJECT/build"
fi
- mkdir -p $1/build
- cd $1/build
- echo "Configuring project $1"
- ../configure $2 $3 $4 $5 $6 > build.log
- echo "Building project $1"
- $MAKE -j$JOBS >> build.log
- echo "Installing project $1"
- $MAKE -j$JOBS install >> build.log
+ mkdir -p "$PROJECT/build"
+ cd "$PROJECT/build"
+ echo "Configuring project $PROJECT"
+ ../configure $* > build.log
+ echo "Building project $PROJECT"
+ $MAKE >> build.log
+ echo "Installing project $PROJECT"
+ $MAKE install >> build.log
cd - > /dev/null
}