raspberry3_bare/Makefile
2022-03-14 11:28:49 +01:00

24 lines
472 B
Makefile

#CROSS=aarch64-none-elf-
CROSS=aarch64-linux-gnu-
CC=$(CROSS)gcc
LD=$(CROSS)ld
CFLAGS=-Wall -Wextra -ffreestanding -march=armv8-a+crc -mcpu=cortex-a53
LDSCRIPT=rpi3.ld
OBJS=crt0.o uart.o hello.o
all:kernel.bin
kernel.elf: $(OBJS) $(LDSCRIPT)
$(LD) -o $@ $(OBJS) -T$(LDSCRIPT) -Map kernel.map
kernel.bin: kernel.elf
$(CROSS)objcopy -O binay -B aarch64 $< $@
clean:
rm -rf $(OBJS) *.bin *.elf *.map
run: kernel.bin
qemu-system-aarch64 -machine raspi3b -kernel $<