summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorNathan Lee <me@nwlee.tech>2026-08-28 21:26:14 -0500
committerNathan Lee <me@nwlee.tech>2026-08-28 21:26:14 -0500
commit7f4c833ced046f88160a50e7adb1f55343e7e759 (patch)
treeec41ed5c02ba61bc9abf58b9db5f8a1d88c8ebd1 /Makefile
parent4bbe418d2ecea36f80a38b74462c2936343f3b7d (diff)
rework early kernel init
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 10 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 60f915b..8ea760b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,15 @@
+VERSION = 0.1.0-alpha
+
CC = clang
LD = ld.lld
OBJCOPY = llvm-objcopy
+COMPILER = $(shell $(CC) --version | head -n 1)
+LINKER = $(shell $(LD) --version | head -n 1)
+
ARCH_FLAG = \
--target=riscv32-unknown-elf \
- -march=rv32im \
+ -march=rv32g \
-mabi=ilp32 \
-D__SYS_LITTLE_ENDIAN__
@@ -20,6 +25,9 @@ COMMON_FLAGS = \
-nostdlib \
-nostdinc \
-nodefaultlibs \
+ -DVERSION='"$(VERSION)"' \
+ -DCOMPILER_NAME='"$(COMPILER)"' \
+ -DLINKER_NAME='"$(LINKER)"' \
KERNEL_FLAG = $(COMMON_FLAGS) -static
MODULE_FLAG = $(COMMON_FLAGS) -fPIC -fpie
@@ -101,7 +109,7 @@ GENERATED = \
$(foreach m,$(MODULES),$($(m)_OBJS))
.PHONY: all kernel clean modules $(MODULES)
-.SILENT:
+$(V).SILENT:
all: kernel modules
kernel: $(KERNEL_BIN)
modules: $(MODULES)