-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sh
executable file
·41 lines (34 loc) · 898 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
#!/bin/bash
#
# build.sh
# spectreScope
#
# Created by Maxim Morozov on 04/01/2018.
# Copyright © 2018 Maxim Morozov. All rights reserved.
#
BUILD_HOME=$(pwd)
BUILD_CMAKE_HOME=${BUILD_HOME}/cmake.build
# CMake supports the build types: Debug, Release, MinSizeRel, RelWithDebInfo.
BUILD_TYPE=Release
rm -rf ${BUILD_CMAKE_HOME}
mkdir -p ${BUILD_CMAKE_HOME}
pushd ${BUILD_CMAKE_HOME} >/dev/null
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${BUILD_HOME}
EXIT_CODE=$?
if [[ $EXIT_CODE -eq 0 ]]; then
make
EXIT_CODE=$?
if [[ $EXIT_CODE -eq 0 ]]; then
make install
EXIT_CODE=$?
if [[ $EXIT_CODE -ne 0 ]]; then
echo "ERROR: Make install failed with exit code $EXIT_CODE"
fi
else
echo "ERROR: Make failed with exit code $EXIT_CODE"
fi
else
echo "ERROR: CMake failed with exit code $EXIT_CODE"
fi
popd >/dev/null
exit $EXIT_CODE