From 214704a8678c9ce674b4aa21a6d4fab6bc2e1c5e Mon Sep 17 00:00:00 2001 From: Nelson <75115576+LabNelson@users.noreply.github.com> Date: Wed, 21 Feb 2024 10:55:01 +0100 Subject: [PATCH] Add files via upload created Makefile for gcc for part11-breakout-smp --- part11-breakout-smp/Makefile.gcc | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 part11-breakout-smp/Makefile.gcc diff --git a/part11-breakout-smp/Makefile.gcc b/part11-breakout-smp/Makefile.gcc new file mode 100644 index 0000000..9c0526f --- /dev/null +++ b/part11-breakout-smp/Makefile.gcc @@ -0,0 +1,25 @@ +CFILES = $(wildcard *.c lib/*.c) +OFILES = $(CFILES:.c=.o) +GCCFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib +GCCPATH = ../../gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin + + +all: clean kernel8.img + +boot/boot.o: boot/boot.S + $(GCCPATH)/aarch64-none-elf-gcc $(GCCFLAGS) -c boot/boot.S -o boot/boot.o + +bin/BCM4345C0.o : bin/BCM4345C0.hcd + $(GCCPATH)/aarch64-none-elf-objcopy -I binary -O elf64-littleaarch64 -B aarch64 $< $@ + +bin/audio.o : bin/audio.bin + $(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/boot.o $(OFILES) bin/BCM4345C0.o bin/audio.o + $(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 +clean: + /bin/rm kernel8.elf *.o bin/*.o boot/*.o *.img > /dev/null 2> /dev/null || true