From 5b13d9b1badd932ede2e22b9071dca81935df0f4 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Tue, 5 Apr 2022 10:35:52 +0200 Subject: [PATCH] Refactor --- Makefile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 7111407..c7a582e 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,22 @@ # Compiler/assembler settings + +# C CC = gcc CFLAGS = -fno-pie -m32 -Os -ffreestanding +# Rust +RC = rustc +# WARN: target might not exist on your machine. Just swap it out to whatever 32bit target that you have. +RFLAGS = --emit=obj --target i686-unknown-linux-gnu + +# Assembly AA = nasm AFLAGS = +# Linking LD = gcc LDFLAGS = -Wl,--oformat=binary -ffreestanding -nostdlib -shared -Ttext 0x1000 -m32 -RS = rustc -RFLAGS = --emit=obj --target i686-unknown-linux-gnu # WARN: target might not exist on your machine. Just swap it out to whatever 32bit target that you have. - # VM/Debug settings VM = qemu-system-x86_64 VMFLAGS = @@ -49,7 +55,7 @@ kernel.bin: kernel/kernel_entry.o kernel/enable_paging.o $(OBJ) $(ROBJ) $(CC) $(CFLAGS) -c $< -o $@ %.o : %.rs - $(RC) $(RFLAGS) $< -O $@ + $(RC) $(RFLAGS) $< -o $@ %.o : %.asm $(AA) $< -f elf -o $@ $(AFLAGS)