1#!/bin/sh
2#
3# This file is public domain
4#
5# Project homepage:
6# https://amath.innolan.net
7#
8
9set -e
10
11version="1.8.5"
12
13echo "Building amath ${version} for Windows ..."
14
15rm -f amath-${version}.zip
16rm -Rf amath
17rm -Rf dist
18mkdir dist
19
20./configure --enable-test --cross-compile="i686-w64-mingw32" CFLAGS="-DWINDOWS" LDFLAGS="-static -static-libgcc -static-libstdc++"
21make clean
22make static
23mv amath dist/amath-${version}-x86.exe
24make clean
25
26./configure --enable-test --cross-compile="x86_64-w64-mingw32" CFLAGS="-DWINDOWS" LDFLAGS="-static -static-libgcc -static-libstdc++"
27make static
28mv amath dist/amath-${version}-x64.exe
29make clean
30
31#cd dist
32#touch hashkeys.txt
33#sha1sum amath-${version}-x86.exe >>hashkeys.txt
34#sha1sum amath-${version}-x86.exe >>hashkeys.txt
35#sha256sum amath-${version}-x86.exe >>hashkeys.txt
36#sha256sum amath-${version}-x86.exe >>hashkeys.txt
37#cd ..
38
39tr '\n' '\r' <LICENSE >dist/license.txt
40tr '\n' '\r' <HISTORY >dist/changes.txt
41
42mkdir dist/script
43cp script/* dist/script/
44date -Ru >dist/build.txt
45
46mv dist amath
47zip -r amath-${version}.zip amath/*
48