rust
E. Almqvist 3 years ago
parent 66641460af
commit 5b13d9b1ba
  1. 14
      Makefile

@ -1,16 +1,22 @@
# Compiler/assembler settings # Compiler/assembler settings
# C
CC = gcc CC = gcc
CFLAGS = -fno-pie -m32 -Os -ffreestanding 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 AA = nasm
AFLAGS = AFLAGS =
# Linking
LD = gcc LD = gcc
LDFLAGS = -Wl,--oformat=binary -ffreestanding -nostdlib -shared -Ttext 0x1000 -m32 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/Debug settings
VM = qemu-system-x86_64 VM = qemu-system-x86_64
VMFLAGS = VMFLAGS =
@ -49,7 +55,7 @@ kernel.bin: kernel/kernel_entry.o kernel/enable_paging.o $(OBJ) $(ROBJ)
$(CC) $(CFLAGS) -c $< -o $@ $(CC) $(CFLAGS) -c $< -o $@
%.o : %.rs %.o : %.rs
$(RC) $(RFLAGS) $< -O $@ $(RC) $(RFLAGS) $< -o $@
%.o : %.asm %.o : %.asm
$(AA) $< -f elf -o $@ $(AFLAGS) $(AA) $< -f elf -o $@ $(AFLAGS)

Loading…
Cancel
Save