Skip to content

Commit 76e3cd8

Browse files
Added a couple shell scripts to make the release build process fully transparent
1 parent 1f3287e commit 76e3cd8

5 files changed

Lines changed: 56 additions & 2 deletions

File tree

emcc_make.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
make
2-
./build -cc "emcc" -ccflags "-O3" -stb-ccflags "-O3" \
2+
./build -cc "emcc" -ccflags "-O3 -ffast-math -g0" \
33
-ldflags "-s ASYNCIFY -s USE_GLFW=3 -s EXPORTED_RUNTIME_METHODS=cwrap \
44
-s EXPORTED_FUNCTIONS=_main,_on_resize --shell-file web/shell.html \
5-
-O3" \
5+
-O3 -g0" \
66
-exext ".html .js .wasm" -no-glfw -syslibs ""

musl-sysroot_clean.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rm -rf musl-sysroot

musl-sysroot_make.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
curl -o musl.tar.gz https://musl.libc.org/releases/musl-1.2.5.tar.gz
2+
tar -xvf musl.tar.gz
3+
rm musl.tar.gz
4+
mkdir musl-sysroot
5+
cd musl-1.2.5
6+
CC="zig cc --target=x86_64-linux-musl" CFLAGS="-O2 -g0" \
7+
./configure --prefix=../musl-sysroot/ --target=x86_64-linux-musl
8+
make
9+
make install
10+
cd ..
11+
rm -rf musl-1.2.5
12+

release_clean.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rm -rf build_release

release_make.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
make
2+
mkdir build_release
3+
./build \
4+
-ccflags "cc -target x86_64-linux-gnu -std=c11 -g0 -O3 -ffast-math -DNDEBUG" \
5+
-ldflags "cc -g0 -O3 -target x86_64-linux-gnu"
6+
mv build_out build_release/x86_64-linux-gnu
7+
zip build_release/x86_64-linux-gnu.zip build_release/x86_64-linux-gnu/*
8+
tar -czvf build_release/x86_64-linux-gnu.tar.gz build_release/x86_64-linux-gnu
9+
./build \
10+
-ccflags "cc -target x86_64-linux-musl -std=c11 -g0 -O3 -ffast-math -DNDEBUG" \
11+
-ldflags "cc -g0 -O3 --sysroot $MUSL_SYSROOT -L/lib -Wl,--dynamic-linker,/lib/ld-musl-x86_64.so.1" \
12+
-syslibs "c"
13+
mv build_out build_release/x86_64-linux-musl
14+
zip build_release/x86_64-linux-musl.zip build_release/x86_64-linux-musl/*
15+
tar -czvf build_release/x86_64-linux-musl.tar.gz build_release/x86_64-linux-musl
16+
./build clean
17+
./build \
18+
-ccflags "cc -target x86_64-windows-gnu -std=c11 -g0 -O3 -ffast-math -DNDEBUG" \
19+
-ldflags "cc -g0 -O3 -target x86_64-windows-gnu" \
20+
-windres "zig" -windresflags "rc" -windresoutflag "/fo" \
21+
-exext ".exe" -obext ".o" -soext ".dll" -arext ".a" -wrext ".o" \
22+
-ldwinflag "-Wl,--subsystem,windows" -winutf8 -winpthreads \
23+
-syslibs "kernel32 user32 gdi32 shell32"
24+
rm build_out/visualization.pdb
25+
mv build_out build_release/x86_64-windows-gnu
26+
zip build_release/x86_64-windows-gnu.zip build_release/x86_64-windows-gnu/*
27+
tar -czvf build_release/x86_64-windows-gnu.tar.gz build_release/x86_64-windows-gnu
28+
./build \
29+
-ccflags "cc -target x86_64-windows-gnu -std=c11 -g0 -O3 -ffast-math -DNDEBUG" \
30+
-ldflags "cc -g0 -O3 -target x86_64-windows-gnu" \
31+
-windres "zig" -windresflags "rc" -windresoutflag "/fo" \
32+
-exext ".exe" -obext ".o" -soext ".dll" -arext ".a" -wrext ".o" \
33+
-ldwinflag "-Wl,--subsystem,windows" -winutf8 -winpthreads clean
34+
./emcc_make.sh
35+
mv build_out build_release/wasm32-unknown-emscripten
36+
zip build_release/wasm32-unknown-emscripten.zip build_release/wasm32-unknown-emscripten/*
37+
tar -czvf build_release/wasm32-unknown-emscripten.tar.gz build_release/wasm32-unknown-emscripten
38+
./emcc_clean.sh
39+
40+

0 commit comments

Comments
 (0)