mrrrrow owo

This commit is contained in:
Kimapr 2024-04-04 11:23:46 +05:00
parent 24be4c3472
commit f7dd2dd766
4 changed files with 20 additions and 3 deletions

9
build
View file

@ -3,8 +3,13 @@ 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
cc -O3 -shared -static -nostdlib -nodefaultlibs target/amogus.o -o target/amogus || exit
objdump -d target/amogus
strip --strip-section-headers -K entry target/amogus
strip -K entry target/amogus
objdump -t target/amogus
du -b target/amogus
rm -rf target/cg/
mkdir -p target/cg
cp target/amogus target/cg/
cp amogus.h target/cg/

7
ctest Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
./build || exit
export C_INCLUDE_PATH="$PWD:$C_INCLUDE_PATH"
export LD_LIBRARY_PATH="$PWD/target:$LD_LIBRARY_PATH"
export LIBRARY_PATH="$PWD/target:$LIBRARY_PATH"
gcc test.c -o target/cmogus -L"$LIBRARY_PATH" -l:amogus || exit
target/cmogus

2
meow.s
View file

@ -24,7 +24,7 @@ usage:
mov $help0l,%rsi
call write
mov [argv],%rdi
mov argv(%rip),%rdi
push %rdi
call strlen
pop %rdi

5
test.c
View file

@ -1,4 +1,9 @@
#include <amogus.h>
#include <stdio.h>
int main() {
char* match;
if(!entry("meow.*|m(r(r(p..*)))",&match))
return 1;
printf("%s",match);
}