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

2
test
View file

@ -1,2 +1,2 @@
#!/bin/sh #!/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() {
}