-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_release_binaries
executable file
·127 lines (113 loc) · 2.77 KB
/
create_release_binaries
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
126
127
#!/bin/bash
COMPFLAGS=""
LIBFLAGS=""
SHORTVIEW="1"
function compile()
{
cd src
SOURCE_FILES=`ls *.cpp`
for fn in $SOURCE_FILES; do
if [ $SHORTVIEW -eq 1 ]; then
echo -n "."
g++ -Wall -c $COMPFLAGS $fn > /dev/null 2>/dev/null
else
echo "C++ $fn"
g++ -Wall -c $COMPFLAGS $fn
fi
if [ $? -ne 0 ]; then
exit 1
fi
done
OUT_FILES=`ls *.o`
if [ $SHORTVIEW -eq 1 ]; then
echo -n "L"
else
echo "LINK $OUT_BINARY"
fi
g++ -o $OUT_BINARY $COMPFLAGS $OUT_FILES $LIBFLAGS
mv $OUT_BINARY ../release
rm *.o 2> /dev/null
cd ..
if [ $SHORTVIEW -eq 1 ]; then
echo "]"
fi
}
#init
if [ $# -eq 1 ]; then
if [ $1 = "--full" ]; then
SHORTVIEW="0"
fi
if [ $1 = "--help" ]; then
echo "Options: --full to view the full build process"
exit
fi
fi
# "main" function
echo -n "VERSION is "
cat "src/MyGlobal.h" | grep Fract_Version
echo -n "Do you want to continue? "
read an
echo "CLEAN"
rm -rf release 2> /dev/null
mkdir release
echo -n "Creating P5 console build "
if [ $SHORTVIEW -eq 0 ]; then
echo ""
else
echo -n " ["
fi
cd src
if [ $SHORTVIEW -eq 0 ]; then
echo "SAVE MyGlobal.h"
fi
cp MyGlobal.h MyGlobal1.h
if [ $SHORTVIEW -eq 0 ]; then
echo "EDIT MyGlobal.h"
fi
rm MyGlobal.h
cat MyGlobal1.h | grep -v "define ACTUALLYDISPLAY" > MyGlobal.h
cd ..
COMPFLAGS="-O3 -g0 -ffast-math"; LIBFLAGS="-lm -lpthread"; OUT_BINARY="fract_console_p5"; compile
if [ $SHORTVIEW -eq 1 ]; then
echo -n "Creating SSE2 console build ["
else
echo "Creating SSE2 console build"
fi
COMPFLAGS="-O3 -g0 -ffast-math -msse -msse2 -mfpmath=sse"; LIBFLAGS="-lm -lpthread"; OUT_BINARY="fract_console_sse2"; compile
if [ $SHORTVIEW -eq 0 ]; then
echo "RESTORE MyGlobal.h"
fi
cd src
rm MyGlobal.h
mv MyGlobal1.h MyGlobal.h
cd ..
if [ $SHORTVIEW -eq 1 ]; then
echo -n "Creating non-SSE2 graphics build ["
else
echo "Creating non-SSE2 graphics build"
fi
COMPFLAGS="-O3 -g0 -ffast-math"; LIBFLAGS="-lm -lSDL"; OUT_BINARY="fract_p5"; compile
if [ $SHORTVIEW -eq 1 ]; then
echo -n "Creating SSE2 scalar graphics build ["
else
echo "Creating SSE2 scalar graphics build"
fi
COMPFLAGS="-Wall -g0 -O3 -ffast-math -msse -msse2 -mfpmath=sse"; LIBFLAGS="-lm -lSDL"; OUT_BINARY="fract_sse2"; compile
if [ $SHORTVIEW -eq 1 ]; then
echo -n "Creating SSE2 vector graphics build ["
else
echo "Creating SSE2 vector graphics build"
fi
COMPFLAGS="-O3 -g0 -ffast-math -mfpmath=sse -msse -msse2 -DSIMD_VECTOR"; LIBFLAGS="-lm -lSDL"; OUT_BINARY="fract_sse2v"; compile
cd release
for fn in "fract_console fract_p5 fract_sse2 fract_sse2v"; do
echo "STRIP $fn"
strip $fn
echo "COMPRESS $fn"
upx $fn
done
ln -s ../data data
cd ..
echo "#"
echo "# your release is done. Binaries are in ./release"
echo "#"