2021-02-24 20:02:43 +00:00
|
|
|
CFILES = $(wildcard *.c lib/*.c)
|
|
|
|
OFILES = $(CFILES:.c=.o)
|
2024-03-27 11:35:12 +00:00
|
|
|
GCCFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib
|
|
|
|
GCCPATH = ../../gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin
|
|
|
|
|
2021-02-24 20:02:43 +00:00
|
|
|
|
|
|
|
all: clean kernel8.img
|
|
|
|
|
|
|
|
boot/boot.o: boot/boot.S
|
2024-03-27 11:35:12 +00:00
|
|
|
$(GCCPATH)/aarch64-none-elf-gcc $(GCCFLAGS) -c boot/boot.S -o boot/boot.o
|
2021-02-24 20:02:43 +00:00
|
|
|
|
|
|
|
bin/BCM4345C0.o : bin/BCM4345C0.hcd
|
2024-03-27 11:35:12 +00:00
|
|
|
$(GCCPATH)/aarch64-none-elf-objcopy -I binary -O elf64-littleaarch64 -B aarch64 $< $@
|
|
|
|
|
2021-02-24 20:02:43 +00:00
|
|
|
bin/audio.o : bin/audio.bin
|
2024-03-27 11:35:12 +00:00
|
|
|
$(GCCPATH)/aarch64-none-elf-objcopy -I binary -O elf64-littleaarch64 -B aarch64 $< $@
|
2021-02-24 20:02:43 +00:00
|
|
|
|
|
|
|
%.o: %.c
|
2024-03-27 11:35:12 +00:00
|
|
|
$(GCCPATH)/aarch64-none-elf-gcc $(GCCFLAGS) -c $< -o $@
|
2021-02-24 20:02:43 +00:00
|
|
|
|
|
|
|
kernel8.img: boot/boot.o $(OFILES) bin/BCM4345C0.o bin/audio.o
|
2024-03-27 11:35:12 +00:00
|
|
|
$(GCCPATH)/aarch64-none-elf-ld -nostdlib boot/boot.o $(OFILES) bin/BCM4345C0.o bin/audio.o -T boot/link.ld -o kernel8.elf
|
|
|
|
$(GCCPATH)/aarch64-none-elf-objcopy -O binary kernel8.elf kernel8.img
|
2021-02-24 20:02:43 +00:00
|
|
|
clean:
|
2024-03-27 11:35:12 +00:00
|
|
|
/bin/rm kernel8.elf *.o bin/*.o boot/*.o *.img > /dev/null 2> /dev/null || true
|