2024-04-22 08:49:39 +00:00
|
|
|
CFILES = $(wildcard *.c)
|
|
|
|
OFILES = $(CFILES:.c=.o)
|
2024-04-22 09:50:24 +00:00
|
|
|
GCCFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib -nostartfiles -mstrict-align
|
|
|
|
GCCPATH = ../../arm-gnu-toolchain-13.2.Rel1-darwin-arm64-aarch64-none-elf/bin
|
2024-04-22 08:49:39 +00:00
|
|
|
|
|
|
|
all: clean kernel8.img
|
|
|
|
|
|
|
|
boot.o: boot.S
|
|
|
|
$(GCCPATH)/aarch64-none-elf-gcc $(GCCFLAGS) -c boot.S -o boot.o
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(GCCPATH)/aarch64-none-elf-gcc $(GCCFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
kernel8.img: boot.o $(OFILES)
|
|
|
|
$(GCCPATH)/aarch64-none-elf-ld -nostdlib boot.o $(OFILES) -T link.ld -o kernel8.elf
|
|
|
|
$(GCCPATH)/aarch64-none-elf-objcopy -O binary kernel8.elf kernel8.img
|
|
|
|
|
|
|
|
clean:
|
|
|
|
/bin/rm kernel8.elf *.o *.img > /dev/null 2> /dev/null || true
|