-
Notifications
You must be signed in to change notification settings - Fork 65
/
ex-build-test.sh
42 lines (36 loc) · 1023 Bytes
/
ex-build-test.sh
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
#!/usr/bin/env bash
OS=`uname -s`
echo "OS =" ${OS}
PWD=`pwd`
TOOLDIR=~/llvm/test
if [ -e /proc/cpuinfo ]; then
procs=`cat /proc/cpuinfo | grep processor | wc -l`
else
procs=1
fi
rm -rf ${TOOLDIR}/cmake_debug_build/* ${TOOLDIR}/src/lib/Target/Cpu0/*
# Chapter 2
cp -rf lbdex/Cpu0/* ${TOOLDIR}/src/lib/Target/Cpu0/.
pushd ${TOOLDIR}/cmake_debug_build
echo "#define CH CH2" > ../src/lib/Target/Cpu0/Cpu0SetChapter.h
cmake -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_FLAGS=-std=c++11 -DCMAKE_BUILD_TYPE=Debug \
-DLLVM_TARGETS_TO_BUILD=Cpu0 -G "Unix Makefiles" ../src
result=`make -j$procs -l$procs`
echo "result: ${result}"
if [ ${result} ] ; then
exit 1;
fi
allch="3_1 3_2 3_3 3_4 3_5 4_1 4_2 5_1 6_1 7_1 8_1 8_2 9_1 9_2 9_3 10_1 \
11_1 11_2 12_1"
# All other Chapters
for ch in $allch
do
echo "#define CH CH${ch}" > ../src/lib/Target/Cpu0/Cpu0SetChapter.h
result=`make -j$procs -l$procs`
echo "result: ${result}"
if [ ${result} ] ; then
exit 1;
fi
done
popd