2012-01-05 04:11:18 +08:00
|
|
|
#!/bin/bash -xe
|
|
|
|
|
|
|
|
export BASE=`pwd`
|
|
|
|
export LLVM_SRC=${BASE}/llvm
|
|
|
|
export POLLY_SRC=${LLVM_SRC}/tools/polly
|
2012-01-16 23:19:19 +08:00
|
|
|
export CLANG_SRC=${LLVM_SRC}/tools/clang
|
2012-01-05 04:11:18 +08:00
|
|
|
export LLVM_BUILD=${BASE}/llvm_build
|
|
|
|
|
|
|
|
if [ -e /proc/cpuinfo ]; then
|
|
|
|
procs=`cat /proc/cpuinfo | grep processor | wc -l`
|
|
|
|
else
|
|
|
|
procs=1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ! test -d ${LLVM_SRC}; then
|
|
|
|
git clone http://llvm.org/git/llvm.git ${LLVM_SRC}
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ! test -d ${POLLY_SRC}; then
|
|
|
|
git clone http://llvm.org/git/polly.git ${POLLY_SRC}
|
|
|
|
fi
|
|
|
|
|
2012-01-17 22:37:45 +08:00
|
|
|
if ! test -d ${CLANG_SRC}; then
|
2012-01-16 23:19:19 +08:00
|
|
|
git clone http://llvm.org/git/clang.git ${CLANG_SRC}
|
|
|
|
fi
|
|
|
|
|
2012-01-05 04:11:18 +08:00
|
|
|
mkdir -p ${LLVM_BUILD}
|
|
|
|
cd ${LLVM_BUILD}
|
|
|
|
|
2016-01-28 20:00:33 +08:00
|
|
|
cmake ${LLVM_SRC}
|
|
|
|
make -j$procs -l$procs
|
|
|
|
make check-polly
|