From 128684dfb24b710cc67bf3de293b31c25746db0c Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Thu, 14 Mar 2024 22:01:56 -0400 Subject: libc: Initial hyra libc commit Signed-off-by: Ian Moffett --- lib/libc/Makefile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 lib/libc/Makefile (limited to 'lib/libc/Makefile') diff --git a/lib/libc/Makefile b/lib/libc/Makefile new file mode 100644 index 0000000..aa09a4c --- /dev/null +++ b/lib/libc/Makefile @@ -0,0 +1,28 @@ +CFLAGS = -c -fno-stack-protector -nostdlib -static -Iinclude/ +LIBC_CFILES = $(shell find src/ -name "*.c") +LIBC_ASMFILES = $(shell find src/ -name "*.S") + +LIBC_OBJ = $(LIBC_CFILES:.c=.o) +LIBC_ASMOBJ = $(LIBC_ASMFILES:.S=.S.o) + +all: $(LIBC_OBJ) build/ld.so + +build/ld.so: build/ linker/entry.c linker/entry.S + mkdir -p $(@D) + $(CC) $(CFLAGS) linker/entry.S -o build/entry.S.o + $(CC) $(CFLAGS) linker/entry.c -o build/entry.o + $(LD) build/entry.o build/entry.S.o -o $(LIBC_OBJ) -o $@ + +%.o: %.c + $(CC) $(CFLAGS) $< -o $@ + +%.S.o: %.S + gcc $(CFLAGS) $< -o $@ + +.PHONY: +build/: + mkdir -p build/ + +.PHONY: clean +clean: + rm -rf build/ -- cgit v1.2.3