readme.md: Fixed typo
[deark.git] / scripts / example-build-mingw.sh
blob6e3790966116875ef032f0b5633f5fd0e46c40e1
1 #!/bin/bash
3 # This is an example script to build Deark using Mingw-w64.
4 # Run this script from your main deark directory, to create mingwobj/deark.exe.
6 # I know that a shell script is not very Windows-y. It's expected to be run
7 # via Cygwin. Otherwise, you may have to translate it to suit your needs.
9 set -e
10 export DEARK_OBJDIR="mingwobj"
11 # For 32-built builds, change "x86_64" to "i686".
12 TOOLSPREFIX="x86_64-w64-mingw32-"
13 export CC=${TOOLSPREFIX}gcc.exe
14 export AR=${TOOLSPREFIX}ar.exe
15 export DEARK_RC=src/_deark_a.rc
16 export DEARK_WINDRES=${TOOLSPREFIX}windres.exe
17 export LDFLAGS="-Wall -municode"
19 if [ "$1" = "clean" ]
20 then
21 make clean
22 else
23 mkdir -p $DEARK_OBJDIR/src
24 mkdir -p $DEARK_OBJDIR/modules
25 # (I don't know how to get windres to accept UTF-16 input.)
26 iconv -f utf16 -t cp1252 < src/deark.rc > ${DEARK_RC}
27 touch --reference=src/deark.rc ${DEARK_RC}
28 make -j4 dep
29 make -j4
30 rm ${DEARK_RC}