summaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-09-13 16:49:42 -0400
committerIan Moffett <ian@osmora.org>2025-09-13 16:49:42 -0400
commitef5fa4b6837e75571d8e76bd218070199d296fce (patch)
tree879b57314199532404e73e4dcaadd4e5e0fea345 /src/Makefile
parente698061ebaf0cf1a10c11c51a6c6cd46a331959c (diff)
initial sources
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/Makefile b/src/Makefile
index ea6c7aa..f3232f3 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,20 +1,34 @@
TARGET = x86_64
+KBIN = sys/l5
SHIMDIR = shim
SHIMBIN = BOOTX64.EFI
SYSROOT = root
OMAR = tools/omar/bin/omar
ISO = lunos.iso
+# Build tools
+BINUTILS_DIR := $(shell pwd)/cc/toolchain/build-binutils
+CC := $(shell pwd)/cc/gcc/bin/x86_64-pc-ethos-gcc
+LD := $(BINUTILS_DIR)/bin/x86_64-pc-ethos-ld
+AS := $(BINUTILS_DIR)/bin/x86_64-pc-ethos-as
+
# QEMU emulator flags
QEMU_FLAGS = --enable-kvm -serial stdio -cdrom $(ISO) \
-M q35 -cpu host -smp 4 -m 2G
.PHONY: all
-all: root image
+all: root sys image
+
+.PHONY: sys
+sys:
+ cd sys/; make CC=$(CC) AS=$(AS) LD=$(LD)
+ cp $(KBIN) root/boot/
root:
- mkdir -p root/
- mkdir -p root/boot/
+ mkdir -p $(SYSROOT)/
+ mkdir -p $(SYSROOT)/boot/
+ mkdir -p $(SYSROOT)/usr/include/
+ cp -vr sys/include/sys/* $(SYSROOT)/usr/include/
.PHONY: sysroot
image:
@@ -35,4 +49,6 @@ run:
.PHONY: clean
clean:
- rm -f lunos.iso
+ rm -rf lunos.iso root
+ rm -f $(KBIN)
+ cd sys/; make clean