-
Notifications
You must be signed in to change notification settings - Fork 348
/
BuildMac.sh
executable file
·114 lines (102 loc) · 2.3 KB
/
BuildMac.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/bin/sh
#
# A complete build script for Polycode on Mac OS X
# Author: Mark Austin <[email protected]>
#
# Make sure you have the following libraries and tools installed prior to running a build
# Xcode
# py-ply
# pkgconfig
# cmake
#
# With macports you can easily install most of the needed libs with the following command:
# sudo port install py-ply pkgconfig cmake
#
# Note: Building with macports versions will require changing your python version to the macports version
# so that the lua binding build
# sudo port select python python27
#
# Start
#
#
# Validate that the build command exited cleanly
#
function validate(){
if [ $? -eq 0 ]; then
echo "[INFO] Build command executed successfully."
else
echo "[ERROR] One of the build commands failed!"
exit 1
fi
}
function cleanup(){
# Do not remove this by default since it takes a while to download stuff
# if [ -d Dependencies/Build ]; then
# rm -fr Dependencies/Build
# echo "[INFO] Removed previous Dependencies/Build folder."
# fi
if [ -d Build ]; then
rm -fr Build
echo "[INFO] Removed previous Build folder."
fi
if [ -d Standalone/Build ]; then
rm -fr Standalone/Build
echo "[INFO] Removed previous Standalone/Build folder."
fi
}
#
# Cleanup
#
cleanup
#
# Build debug and release static dependencies
#
mkdir -p Dependencies/Build
cd Dependencies/Build
cmake -G Xcode ..
validate
xcodebuild -target ALL_BUILD -configuration Debug
validate
xcodebuild -target ALL_BUILD -configuration Release
validate
cd ../../
#
# Build polycode player and bindings
#
mkdir -p Build
cd Build
cmake -G Xcode .. -DPOLYCODE_BUILD_BINDINGS=1 -DPOLYCODE_BUILD_PLAYER=1
validate
xcodebuild -DPOLYCODE_BUILD_BINDINGS=1 -DPOLYCODE_BUILD_PLAYER=1 -target ALL_BUILD -configuration Debug
validate
xcodebuild -target PolycodeLua -configuration Debug
validate
xcodebuild -target install -configuration Debug
validate
xcodebuild -DPOLYCODE_BUILD_BINDINGS=1 -DPOLYCODE_BUILD_PLAYER=1 -target ALL_BUILD -configuration Release
validate
xcodebuild -target PolycodeLua -configuration Release
validate
xcodebuild -target install -configuration Release
validate
cd ../
#
# Build standalone
#
mkdir -p Standalone/Build
cd Standalone/Build
cmake -G "Unix Makefiles" ..
validate
make install
validate
cd ../../
#
# Build IDE
#
cd IDE/Build/Mac\ OS\ X/
xcodebuild
validate
#
# End
#
exit 0