-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·68 lines (61 loc) · 1.23 KB
/
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env sh
# usage: ./build.sh [debug=build with debug symbols|clean=cleanup build|update=git pull]
BUILD_TYPE=RelWithDebInfo
if [ "$1" = "debug" ]; then
# debug build
echo ". building debug version"
BUILD_TYPE=Debug
elif [ "$1" = "clean" ]; then
# cleanup everything
echo ". cleaning up"
cd emushared
rm -rf build
cd ../v65xx
rm -rf build
cd ..
rm -rf build
exit 0
elif [ "$1" = "update" ]; then
# cleanup everything
echo ". git update"
cd emushared
git pull
cd ../v65xx
git pull
cd ..
git pull origin dev
exit 0
else
# default, release build
echo ". building release version"
fi
# setup environment vars
export EMUSHARED_LIB_PATH=$(pwd)/emushared/build
export EMUSHARED_INCLUDE_PATH=$(pwd)/emushared
export V65XX_LIB_PATH=$(pwd)/v65xx/build
export V65XX_INCLUDE_PATH=$(pwd)/v65xx
# build emushared
cd emushared
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE
make
if [ $? -ne 0 ]; then
exit $?
fi
# build v65xx
cd ../../v65xx
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE
make
if [ $? -ne 0 ]; then
exit $?
fi
# build emu
cd ../../
echo $(pwd)
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE
make