forked from riscv-software-src/riscv-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.common
36 lines (31 loc) · 849 Bytes
/
build.common
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
# 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
# Use gmake instead of make if it exists.
MAKE=`command -v gmake || command -v make`
PATH="$RISCV/bin:$PATH"
#GCC_VERSION=`gcc -v 2>&1 | tail -1 | awk '{print $3}'`
set -e
function build_project {
PROJECT="$1"
shift
echo
if [ -e "$PROJECT/build" ]
then
echo "Removing existing $PROJECT/build directory"
rm -rf "$PROJECT/build"
fi
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
}