-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_release
executable file
·84 lines (80 loc) · 1.82 KB
/
build_release
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
#!/bin/sh
set -e
if [ -z "$OS" ]; then
OS=`uname -s`
fi
if [ $OS = "Linux" ]; then
cd sdl
./configure
make all
cd ..
rm -rf lib
mkdir lib
cp sdl/build/.libs/libSDL2-*.so.*.*.* lib
sdl=`ls lib`
link=`echo $sdl | sed -E 's/(so\.[0-9]*).*/\1/'`
cd lib
ln -s "$sdl" "$link"
ln -s "$sdl" libSDL2.so
cd ..
cd glew
make all
cd ..
fi
echo "Path is: $PATH"
if [ $OS = "Win64" ]; then
make PORTABLE=1 OS=Windows CPU=x86_64 clean all
SDLDLLPATH=sdl/x86_64-w64-mingw32/bin
else
make PORTABLE=1 clean all
SDLDLLPATH=sdl/i686-w64-mingw32/bin
fi
make menu.bin
if [ $OS = "Windows" -o $OS = "Win64" ]; then
binaries="dis.exe zdis.exe vgmplay.exe blastem.exe $SDLDLLPATH/SDL2.dll"
verstr=`sed -E -n 's/^[^B]+BLASTEM_VERSION "([^"]+)"/blastem \1/p' blastem.c`
txt=".txt"
else
binaries="dis zdis vgmplay blastem termhelper"
if [ $OS = "Darwin" ]; then
binaries="$binaries Frameworks"
else
binaries="$binaries lib"
fi
verstr=`./blastem -v`
txt=""
fi
binaries="$binaries menu.bin"
ver=`echo $verstr | awk '/blastem/ { gsub(/\r/, "", $2); print $2 }'`
if [ $OS = "Windows" ]; then
suffix='-win32'
elif [ $OS = "Win64" ]; then
suffix='-win64'
elif [ $OS = "Darwin" ]; then
suffix='-osx'
else
suffix=`file ./blastem | sed -E 's/^[^:]*: [^ ]* ([0-9]*)-bit .*/\1/'`
fi
dir="blastem${suffix}-${ver}"
echo $dir
rm -rf "$dir"
mkdir "$dir"
cp -r $binaries shaders images default.cfg rom.db gamecontrollerdb.txt systems.cfg "$dir"
for file in README COPYING CHANGELOG; do
cp "$file" "$dir"/"$file$txt"
done
if [ $OS = "Darwin" ]; then
cp SDL-LICENSE "$dir"
else
cp sdl/COPYING.txt "$dir"/SDL-LICENSE$txt
fi
cp glew/LICENSE.txt "$dir"/GLEW-LICENSE$txt
if [ $OS = "Windows" -o $OS = "Win64" ]; then
rm -f "${dir}.zip"
zip -r "${dir}.zip" "$dir"
echo "${dir}.zip"
else
rm -f "${dir}.tar.gz"
tar -cvzf "${dir}.tar.gz" "$dir"
echo "${dir}.tar.gz"
fi