new string.h implementation & tests

This commit is contained in:
2024-08-09 12:39:48 -05:00
parent 3e30c10d55
commit 9fa68697f5
10 changed files with 599 additions and 101 deletions

24
host_test/Makefile Normal file
View File

@@ -0,0 +1,24 @@
rose_objects = string.o
objects = main.o
CFLAGS = -m32 -mgeneral-regs-only -march=i386 -fno-stack-protector -Wno-int-conversion -c -Iinclude
LFLAGS = -m32
all: test
./test
test: $(objects) $(rose_objects)
clang $(LFLAGS) -o $@ $^
%.o: ../%.nasm
nasm -f elf32 -o $@ $<
objcopy --prefix-symbols=rose_ $@
%.o: %.c
clang $(CFLAGS) -ffunction-sections -fdata-sections -Os -o $@ $<
%.o: ../%.c
clang $(CFLAGS) -nostdlib -ffunction-sections -fdata-sections -Os -o $@ $<
objcopy --prefix-symbols=rose_ $@
clean:
rm -f $(objects) $(rose_objects) test