/
winbuild
executable file
·25 lines (21 loc) · 1.23 KB
/
winbuild
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
#!/bin/bash
# My über custom buildscript. Builds a static exe (~240k)
# I like just one exe to distribute...
# Needs a mingw32 cross compiler suite, libxml2 libpng, jpeglib, popt, libexif, upx, zip and unix2dos
# Set this where you have put your mingw32 compiler tools
CROSSTOOLS=/usr/local/cross-tools
echo "Compiling resource"
cd src
$CROSSTOOLS/bin/i386-mingw32msvc-windres -Fpe-i386 resource.rc resource.o || exit
cd ../
echo "Compiling program"
$CROSSTOOLS/bin/i386-mingw32msvc-gcc $( cat sources.txt ) src/win32.c -I. -Isrc -Isrc/libgfx -Isrc/libtaglist -I$CROSSTOOLS/include -I$CROSSTOOLS/include/libexif -I$CROSSTOOLS/include/libxml2 -I$CROSSTOOLS/include/libpng12 -L$CROSSTOOLS/lib -lpopt -ljpeg -lm -lexif -liberty -lexpat -static -lpng -lz -lwsock32 src/resource.o -o gfxindex.exe -fexpensive-optimizations -s -O3 -DSTATIC -DHAVE_CONFIG_H -DHAVE_LIBJPEG -DHAVE_LIBEXPAT -DHAVE_LIBEXIF=1 -DHAVE_LIBPNG || exit
echo "Compressing executable"
upx --best -q -q -q gfxindex.exe || exit
# This is used to send just exe to betatesters etc.
rm -f gfxindex-exe.zip >/dev/null 2>/dev/null
zip -q9 gfxindex-exe.zip gfxindex.exe
du -sm -h gfxindex.exe
echo "Updating documentation"
unix2dos -q -n COPYING COPYING.txt
unix2dos -q -n ChangeLog ChangeLog.txt