forked from pleonex/tinke
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compile.sh
executable file
·125 lines (111 loc) · 3.86 KB
/
compile.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
115
116
117
118
119
120
121
122
123
124
125
#!/bin/bash
# Get Tinke directory for relative paths.
TINKE_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
BUILD_DIR="$TINKE_DIR/build"
# Ask for release or debug configuration
if [[ "$1" != "Release" && "$1" != "Debug" ]] ; then
echo "Choose the configuration. Press '1' for Release and '2' for Debug: "
select rd in "Release" "Debug"; do
case $rd in
Release) CONF="Release"; break;;
Debug) CONF="Debug"; break;;
esac
done
echo
else
echo "Using $1 configuration."
CONF=$1
fi
# Ask for 64 or 32 bits.
if [[ "$2" != "x86" && "$2" != "x64" ]] ; then
echo "Choose the platform. Press '1' for x86 or '2' for x64: "
select pl in "x86" "x64"; do
case $pl in
x86) PLAT="x86"; break;;
x64) PLAT="x64"; break;;
esac
done
echo
else
echo "Compiling for platform $2."
PLAT=$2
fi
# Remove previous builds
if [ -d "$BUILD_DIR" ]; then
echo "Deleting old build directory"
rm -rf "$BUILD_DIR"
fi
# Get compiler and params
XBUILD="xbuild /v:minimal /p:Configuration=$CONF;TargetFrameworkVersion=v4.5"
# Compile program in standard directory, to allow plugins find Ekona
echo "Compiling base library..."
xbuild /v:minimal /p:TargetFrameworkVersion=v4.5 Tinke.sln > build.log
if [ $? -ne 0 ] ; then
echo "Error compiling Tinke into the default directory. Aborting."
cat build.log
exit -1
fi
# Compile Tinke
echo "Compiling Tinke..."
$XBUILD "/p:Platform=$PLAT;OutputPath=$BUILD_DIR/" Tinke.sln > build.log
if [ $? -ne 0 ] ; then
echo "Error compiling Tinke into the build dir. Aborting."
cat build.log
exit -1
fi
function compile_plugin {
echo "Compiling plugin $1..."
$XBUILD "/p:OutputPath=$BUILD_DIR/Plugins/" "$1" > build.log
if [ $? -ne 0 ] ; then
echo "Error compiling $1. Aborting."
cat build.log
exit -1
fi
}
# Compile game plugins
compile_plugin "Plugins/LAYTON/LAYTON.sln"
compile_plugin "Plugins/KIRBY DRO/KIRBY DRO.sln"
compile_plugin "Plugins/AI IGO DS/AI IGO DS.sln"
compile_plugin "Plugins/LASTWINDOW/LASTWINDOW.sln"
compile_plugin "Plugins/TETRIS DS/TETRIS DS.sln"
compile_plugin "Plugins/999HRPERDOOR/999HRPERDOOR.sln"
compile_plugin "Plugins/EDGEWORTH/EDGEWORTH.sln"
compile_plugin "Plugins/GYAKUKEN/GYAKUKEN.sln"
compile_plugin "Plugins/DBK ULTIMATE/DBK ULTIMATE.sln"
compile_plugin "Plugins/MAPLESTORYDS/MAPLESTORYDS.sln"
compile_plugin "Plugins/NINOKUNI/NINOKUNI.sln"
compile_plugin "Plugins/TOKIMEKIGS3S/TOKIMEKIGS3S.sln"
compile_plugin "Plugins/BLOODBAHAMUT/BLOODBAHAMUT.sln"
compile_plugin "Plugins/SF FEATHER/SF FEATHER.sln"
compile_plugin "Plugins/DEATHNOTEDS/DEATHNOTEDS.sln"
compile_plugin "Plugins/INAZUMA11/INAZUMA11.sln"
compile_plugin "Plugins/TC UTK/TC UTK.sln"
compile_plugin "Plugins/PSL/PSL.sln"
compile_plugin "Plugins/HETALIA/HETALIA.sln"
compile_plugin "Plugins/TIMEACE/TIMEACE.sln"
compile_plugin "Plugins/WITCHTALE/WITCHTALE.sln"
compile_plugin "Plugins/Tokimemo1/Tokimemo1.sln"
compile_plugin "Plugins/Teniprimgaku/Teniprimgaku.sln"
compile_plugin "Plugins/SONICRUSHADV/SONICRUSHADV.sln"
compile_plugin "Plugins/1stPlayable/1stPlayable.sln"
# Compiling format plugins
compile_plugin "Plugins/Pack/Pack.sln"
compile_plugin "Plugins/TXT/TXT.sln"
compile_plugin "Plugins/Common/Common.sln"
compile_plugin "Plugins/Images/Images.sln"
compile_plugin "Plugins/SDAT/SDAT.sln"
compile_plugin "Plugins/Sounds/Sounds.sln"
compile_plugin "Plugins/Fonts/Fonts.sln"
compile_plugin "Plugins/3DModels/3DModels.sln"
# Copy dependencies
cp "$TINKE_DIR/Plugins/3DModels/OpenTK.dll" "$BUILD_DIR/"
cp "$TINKE_DIR/Plugins/3DModels/OpenTK.GLControl.dll" "$BUILD_DIR/"
# Copy license and changelog
cp "$TINKE_DIR/changelog.txt" "$BUILD_DIR/"
cp "$TINKE_DIR/Licence.txt" "$BUILD_DIR/"
cp "$TINKE_DIR/Tinke/app.config" "$BUILD_DIR/"
# Delete debug files
rm "$BUILD_DIR"/*.mdb
rm "$BUILD_DIR"/Plugins/*.mdb
rm build.log
echo "Done!"