This commit is contained in:
Kimapr 2024-04-04 09:37:18 +05:00
parent d796077e7c
commit 24be4c3472
5 changed files with 16 additions and 9 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
target/

1
amogus.h Normal file
View file

@ -0,0 +1 @@
int entry(char* regex, char** output);

17
build
View file

@ -1,9 +1,10 @@
#!/bin/sh
#~/stuff/zig/zig cc -static -nostdlib -nodefaultlibs meow.s -o amogus || exit
#gcc -static -nostdlib -nodefaultlibs meow.s -o amogus.o || exit
gcc -c meow.s -o amogus.o || exit
~/stuff/zig/zig cc -static -nostdlib -nodefaultlibs amogus.o -o amogus || exit
#clang -static -nostdlib -nodefaultlibs meow.s -o amogus || exit
objdump -d amogus
strip -K entry amogus
du -b amogus
mkdir -p target
gcc -c meow.s -o target/amogus.o || exit
gnu() { shift 1 && gcc "$@"; }
"$(command -v ~/stuff/zig/zig || echo gnu)" \
cc -static -nostdlib -nodefaultlibs target/amogus.o -o target/amogus || exit
objdump -d target/amogus
strip --strip-section-headers -K entry target/amogus
du -b target/amogus

2
test
View file

@ -1,2 +1,2 @@
#!/bin/sh
./build && gdb -iex 'set confirm no' -ex 'run' amogus
./build && gdb -iex 'set confirm no' -ex 'run' target/amogus

4
test.c Normal file
View file

@ -0,0 +1,4 @@
#include <amogus.h>
int main() {
}