aboutsummaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2021-02-03 23:39:03 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2021-02-03 23:39:43 +0200
commit039df4c04d83fc26ca60d4f870d2e58d381818ad (patch)
tree0896053cffebfe97ac98c98386d62ef7f2e980b1 /makefile
parentUpdate readme with required packages (diff)
downloadkernel.cpp-039df4c04d83fc26ca60d4f870d2e58d381818ad.tar.xz
Rewrite boot.s to use clang instead of nasm
Diffstat (limited to 'makefile')
-rw-r--r--makefile15
1 files changed, 7 insertions, 8 deletions
diff --git a/makefile b/makefile
index b149337..9c2728c 100644
--- a/makefile
+++ b/makefile
@@ -6,12 +6,11 @@
export TARGET := i686-elf
export AR := llvm-ar
-export NASM := nasm
+export AS := clang
export LD := ld.lld
-export CXX := clang++
-export CXX_FLAGS := -std=c++20 -ffreestanding \
- -nostdlib -nostdinc -nostdinc++ \
- -fno-exceptions -fno-rtti -Wall -Wextra -O2
+export CXX := clang
+export CXX_FLAGS := -std=c++20 -ffreestanding -nostdlib -nostdinc -nostdinc++ \
+ -fno-exceptions -fno-rtti -Wall -Wextra -O2
CXX_INCLUDE := $(CURDIR)/libk
CXX_OBJ := kernel.o vga.o
@@ -25,10 +24,10 @@ 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) -Llibk -lk
+ $(LD) -T linker.ld -o glitch.elf boot.o $(CXX_OBJ) -lk
-boot.o: boot.asm
- $(NASM) -felf32 -o $@ $^
+boot.o: boot.s
+ $(AS) -target $(TARGET) -nostdlib -Wall -Wextra -c $^ -o $@
$(CXX_OBJ): %.o : %.cc
$(CXX) -target $(TARGET) $(CXX_FLAGS) -I$(CXX_INCLUDE) -c $^ -o $@