forked from risvh/miniOneLifeCompile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompile.sh
59 lines (45 loc) · 1.45 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
#!/bin/bash
set -e
PLATFORM=$(cat PLATFORM_OVERRIDE)
if [[ $PLATFORM != 1 ]] && [[ $PLATFORM != 5 ]]; then PLATFORM=${1-5}; fi
if [[ $PLATFORM != 1 ]] && [[ $PLATFORM != 5 ]]; then
echo "Usage: 1 for Linux, 5 for XCompiling for Windows (Default)"
exit 1
fi
cd "$(dirname "${0}")/.."
##### Configure and Make
cd OneLife
./configure $PLATFORM
cd gameSource
if [[ $PLATFORM == 5 ]]; then export PATH="/usr/i686-w64-mingw32/bin:${PATH}"; fi
make
cd ../..
##### Create Game Folder
mkdir -p output
cd output
FOLDERS="animations categories ground music objects sounds sprites transitions"
TARGET="."
LINK="../OneLifeData7"
../miniOneLifeCompile/util/createSymLinks.sh $PLATFORM "$FOLDERS" $TARGET $LINK
FOLDERS="graphics otherSounds languages"
TARGET="."
LINK="../OneLife/gameSource"
../miniOneLifeCompile/util/createSymLinks.sh $PLATFORM "$FOLDERS" $TARGET $LINK
cp -rn ../OneLife/gameSource/settings .
cp ../OneLife/gameSource/language.txt .
cp ../OneLife/documentation/Readme.txt .
cp ../OneLife/no_copyright.txt .
cp ../OneLife/gameSource/reverbImpulseResponse.aiff .
cp ../OneLife/server/wordList.txt .
cp ../OneLifeData7/dataVersionNumber.txt .
#missing SDL.dll
if [[ $PLATFORM == 5 ]] && [ ! -f SDL.dll ]; then cp ../OneLife/build/win32/SDL.dll .; fi
##### Copy to Game Folder and Run
if [[ $PLATFORM == 5 ]]; then
mv -f ../OneLife/gameSource/OneLife.exe .
cmd.exe /c OneLife.exe
fi
if [[ $PLATFORM == 1 ]]; then
mv -f ../OneLife/gameSource/OneLife .
./OneLife
fi