-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathwindows-release
executable file
·75 lines (60 loc) · 1.82 KB
/
windows-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
#!/bin/bash
set -e
GCC_LIBS="stdc++-6 gcc_s_sjlj-1"
ALLEGRO_DEP_LIBS="ogg-0 vorbis-0 vorbisfile-3 FLAC-8"
ALLEGRO_LIBS="allegro allegro_acodec allegro_audio allegro_dialog \
allegro_font allegro_image allegro_primitives"
HOST=i686-w64-mingw32
BUILD=x86_64-linux-gnu
PREFIX=/usr/i686-w64-mingw32
# build MININIM
if [ -f Makefile ]; then make clean; fi
mv build-aux/texinfo.tex{,.bkp}
autoreconf --install --force
mv build-aux/texinfo.tex{.bkp,}
if [ "$1" != "--enable-debug" ]
then ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX
else ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX --enable-debug
fi
make -j4
# build documentation
cd doc
make mininim.pdf
cd ..
# determine version and release directory
VERSION=$(grep -Po '#define VERSION "\K.*?(?=")' config.h)-win32
if [ "$1" = "--enable-debug" ]; then VERSION=$VERSION-debug; fi
RELEASE_DIR=release/mininim-$VERSION
# create release directory
rm -rf $RELEASE_DIR
mkdir -p $RELEASE_DIR
# copy MININIM executable, data and documentation
cp -r data mininim.exe doc/mininim.pdf $RELEASE_DIR
# copy libs
for f in $GCC_LIBS
do cp -v /usr/lib/gcc/$HOST/4.9-win32/lib$f.dll $RELEASE_DIR
done
for f in $ALLEGRO_DEP_LIBS
do cp -v /usr/$HOST/bin/lib$f.dll $RELEASE_DIR
done
for f in $ALLEGRO_LIBS
do
# if [ "$1" != "--enable-debug" ]
# then cp -v /usr/$HOST/bin/$f-5.2.dll $RELEASE_DIR
# else cp -v /usr/$HOST/bin/$f-debug-5.2.dll $RELEASE_DIR
# fi
# cp -v /usr/$HOST/bin/$f-5.2.dll $RELEASE_DIR
cp -v /usr/$HOST/bin/$f-debug-5.2.dll $RELEASE_DIR
done
# copy Allegro configuration
unix2dos -n allegro5.cfg $RELEASE_DIR/allegro5.cfg
# strip them all
if [ "$1" != "--enable-debug" ]
then $HOST-strip $RELEASE_DIR/{*.dll,*.exe}
fi
# create package
cd release
zip -9r ${RELEASE_DIR#release/} ${RELEASE_DIR#release/}
cd ..
# remove temporary release directory
rm -rf $RELEASE_DIR