aboutsummaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'makefile')
-rw-r--r--makefile10
1 files changed, 7 insertions, 3 deletions
diff --git a/makefile b/makefile
index f45d65a..1a50a18 100644
--- a/makefile
+++ b/makefile
@@ -6,8 +6,12 @@
export TARGET := i686-elf
export AR := llvm-ar
-export AS := clang
-export LD := ld.lld
+
+AS := clang
+
+LD := ld.lld
+LD_FLAGS := -T linker.ld -lk
+
export CXX := clang
export CXX_FLAGS := -std=c++20 -ffreestanding -nostdlib -nostdinc -nostdinc++ \
-fno-exceptions -fno-rtti -Wall -Wextra -O2
@@ -24,7 +28,7 @@ check-grub: glitch.elf
grub-file --is-x86-multiboot2 glitch.elf
glitch.elf: boot.o $(CXX_OBJ) libk/libk.a
- $(LD) -T linker.ld -o glitch.elf boot.o $(CXX_OBJ) -lk
+ $(LD) $(LD_FLAGS) -o $@ boot.o $(CXX_OBJ)
boot.o: boot.s
$(AS) -target $(TARGET) -nostdlib -Wall -Wextra -c $^ -o $@