-
Notifications
You must be signed in to change notification settings - Fork 2
/
compile.sh
executable file
·33 lines (33 loc) · 1.12 KB
/
compile.sh
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
mkdir release
mkdir -p borg.AppDir/usr/bin
mkdir -p deb/usr/bin
rm -f borg.AppDir/usr/bin/borg
rm -f deb/usr/bin/borg
rm -f release/borg
rm -f release/borg_native
rm -f release/borg.exe
rm -f release/borg.AppImage
rm -f release/borg.deb
rm -f release/borg_win.zip
clang main.c -Ofast -lSDL2 -lm -o release/borg
clang main.c -march=native -Ofast -lSDL2 -lm -o release/borg_native
i686-w64-mingw32-gcc -std=c17 main.c -ISDL2/include -LSDL2/lib -Ofast -Wall -lmingw32 -lSDL2main -lSDL2 -o release/borg.exe
strip --strip-unneeded release/borg
strip --strip-unneeded release/borg_native
strip --strip-unneeded release/borg.exe
upx --lzma --best release/borg
upx --lzma --best release/borg_native
upx --lzma --best release/borg.exe
cp release/borg borg.AppDir/usr/bin/borg
./appimagetool-x86_64.AppImage borg.AppDir release/borg.AppImage
cp release/borg deb/usr/bin/borg
dpkg-deb --build deb release/borg.deb
rm -f borg.AppDir/usr/bin/borg
rm -f deb/usr/bin/borg
cp SDL2/bin/SDL2.dll release/SDL2.dll
strip --strip-unneeded release/SDL2.dll
upx --lzma --best release/SDL2.dll
cd release
zip borg_win.zip SDL2.dll borg.exe
rm -f SDL2.dll
rm -f borg.exe