aboutsummaryrefslogtreecommitdiffstats
path: root/mkrel
blob: e150523f56e73dec9d40b8e9693fe27e373fe585 (plain)
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
#!/bin/bash -xe

project=abc80sim
pv="$(git describe --abbrev=4)"

mkdir -p rel/"$pv"
cd rel/"$pv"

( cd ../.. && git archive --format=tar --prefix="$pv"/ HEAD ) | \
    tar xvvf -
cd "$pv"
./autogen.sh
cd ..
tar cvvf "$pv".tar "$pv"
xz -9ek "$pv".tar
gzip -9 "$pv".tar

for target in x86_64-w64-mingw32; do
    mkdir "$target"
    cd "$target"
    dlldir="/usr/$target/sys-root/mingw/bin"
    tar xf ../"$pv".tar.xz
    cd "$pv"
    ./configure --host="$target"
    make clean
    make -j
    cd ..
    mv "$pv" _build
    mkdir "$pv"
    cp $(find _build -type f -name '*.exe') "$pv"/
    rm -f _build/stdout.txt _build/stderr.txt || true
    for f in $(find _build -type f -name '*.txt'); do
	todos < "$f" > "$pv"/"$(basename "$f")"
    done
    for d in SDL.dll libpng16-16.dll zlib1.dll; do
	cp "$dlldir"/"$d" "$pv"/
    done
    zip -9r -o "$pv".zip "$pv"
    cd ..
done

ln x86_64-w64-mingw32/"$pv".zip "$pv"-win64.zip
#ln i686-w64-mingw32/"$pv".zip   "$pv"-win32.zip