2021-02-07 19:18:44 +00:00
|
|
|
CFILES = $(wildcard *.c)
|
|
|
|
OFILES = $(CFILES:.c=.o)
|
|
|
|
GCCFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib -nostartfiles
|
2021-08-27 10:56:23 +00:00
|
|
|
GCCPATH = ../../gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin
|
2021-02-07 19:18:44 +00:00
|
|
|
|
|
|
|
all: clean kernel8.img
|
|
|
|
|
|
|
|
boot.o: boot.S
|
|
|
|
$(GCCPATH)/aarch64-none-elf-gcc $(GCCFLAGS) -c boot.S -o boot.o
|
|
|
|
|
|
|
|
BCM4345C0.o : BCM4345C0.hcd
|
|
|
|
$(GCCPATH)/aarch64-none-elf-objcopy -I binary -O elf64-littleaarch64 -B aarch64 $< $@
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(GCCPATH)/aarch64-none-elf-gcc $(GCCFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
kernel8.img: boot.o $(OFILES) BCM4345C0.o
|
2021-08-27 10:56:23 +00:00
|
|
|
$(GCCPATH)/aarch64-none-elf-ld -nostdlib boot.o $(OFILES) BCM4345C0.o -T link.ld -o kernel8.elf
|
2021-02-07 19:18:44 +00:00
|
|
|
$(GCCPATH)/aarch64-none-elf-objcopy -O binary kernel8.elf kernel8.img
|
|
|
|
|
|
|
|
clean:
|
|
|
|
/bin/rm kernel8.elf *.o *.img > /dev/null 2> /dev/null || true
|