sus-regex/build
2024-04-08 05:25:15 +05:00

27 lines
881 B
Bash
Executable file

#!/bin/sh
mkdir -p target
./charjmpt.lua > target/charjmpt.s
gcc -c meow.s -o target/amogus.o || exit
if command -v ~/stuff/zig/zig >/dev/null; then
~/stuff/zig/zig cc -shared -nostdlib target/amogus.o -o target/amogus || exit
elif command -v ld.lld >/dev/null; then
ld.lld -shared -nostdlib target/amogus.o -o target/amogus || exit
else
gcc -shared -nostdlib target/amogus.o -o target/amogus || exit
fi
#gnu() { shift 1 && gcc "$@"; }
#"$(command -v ~/stuff/zig/zig || echo gnu)" \
#cc -shared -nostdlib target/amogus.o -o target/amogus || exit
#ld.lld -shared -nostdlib target/amogus.o -o target/amogus || exit
objdump -d target/amogus
cp target/amogus target/amogstrip
strip -K entry target/amogstrip
objdump -t target/amogstrip
du -b target/amogstrip
rm -rf target/cg/
mkdir -p target/cg
cp target/amogstrip target/cg/amogus
cp amogus.h target/cg/
cp amogus.png target/cg/