forked from kisslune/POCR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·50 lines (41 loc) · 889 Bytes
/
build.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
43
44
45
46
47
48
49
#!/usr/bin/env bash
# !bash
# type './build.sh' for release build
# type './build.sh debug' for debug build
#########
# Please change the following home directories of your LLVM builds
########
# Install SVF if not exist
if [ -z "$SVF_DIR" ]; then
# Download SVF
npm i --silent svf-lib --prefix ${HOME}
# Set environmental parameters
install_path=$(npm root)
LLVMHome="llvm-13.0.0.obj"
Z3Home="z3.obj"
export LLVM_DIR=$install_path/$LLVMHome
export Z3_DIR=$install_path/$Z3Home
export PATH=$LLVM_DIR/bin:$PATH
export SVF_DIR=$install_path/SVF/
echo "LLVM_DIR="$LLVM_DIR
echo "SVF_DIR="$SVF_DIR
echo "Z3_DIR="$Z3_DIR
fi
# Build POCR
if [[ $1 == 'debug' ]]
then
Type='Debug'
else
Type='Release'
fi
Build=$Type'-build'
rm -rf $Build
mkdir $Build
cd $Build
if [[ $1 == 'debug' ]]
then
cmake -D CMAKE_BUILD_TYPE:STRING=Debug ../
else
cmake ../
fi
make -j4