From f5e48e94a2f4d4bbd6e5628c7f2afafc6dbcc459 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Thu, 7 Mar 2024 17:28:52 -0500 Subject: build: Build mlibc + add distclean target Signed-off-by: Ian Moffett --- Makefile.in | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'Makefile.in') diff --git a/Makefile.in b/Makefile.in index 8b098c6..f61c4e9 100644 --- a/Makefile.in +++ b/Makefile.in @@ -69,10 +69,19 @@ override KERNEL_ASMOBJECTS = $(KERNEL_ASMFILES:.S=.S.o) override KERNEL_HEADER_DEPS = $(KERNEL_CFILES:.c=.d) .PHONY: all -all: base/boot/hyra-kernel +all: base lib base/usr/lib/ld.so base/boot/hyra-kernel rm -f sys/include/machine rm -rf iso_root +base: + mkdir -p base/usr/lib/ + +lib: lib/mlibc base/usr/lib/ld.so + +lib/mlibc: + git clone https://github.com/sigsegv7/hyra-mlibc lib/mlibc + cp builddeps/cross_file.txt lib/mlibc/ + .PHONY: run run: $(QEMU) $(QEMU_FLAGS) @@ -81,6 +90,14 @@ run: cross: bash tools/cross.sh $(ARCH) +.PHONY: clean +distclean: + make clean + rm -f $(KERNEL_ASMOBJECTS) $(KERNEL_OBJECTS) $(KERNEL_HEADER_DEPS) + rm -f sys/include/machine + rm -f base/usr/lib/ld.so + cd lib/; make clean + .PHONY: clean clean: rm -f $(KERNEL_ASMOBJECTS) $(KERNEL_OBJECTS) $(KERNEL_HEADER_DEPS) @@ -89,6 +106,13 @@ clean: sys/include/machine/: cd sys/include/; ln -sf arch/$(ARCH) machine +base/usr/lib/ld.so: lib/mlibc/ + cd lib/; make mlibc/build/ + $(PROMPT) " DYNLD " base/usr/lib/ld.so + $(PROMPT) " LIBC " base/usr/lib/libc.so + cp lib/mlibc/build/ld.so base/usr/lib/ + cp lib/mlibc/build/libc.so base/usr/lib/ + base/boot/hyra-kernel: $(KERNEL_OBJECTS) $(KERNEL_ASMOBJECTS) rm -rf iso_root mkdir -p base/boot/ -- cgit v1.2.3