rpi4-osdev/part15-tcpip-webserver/Makefile.gcc

21 lines
705 B
Text
Raw Normal View History

CFILES = $(wildcard *.c lib/*.c kernel/*.c net/*.c tcpip/*.c)
2021-10-13 09:33:40 +00:00
SFILES = $(wildcard boot/*.S lib/*.S kernel/*.S)
OFILES = $(CFILES:.c=.o) $(SFILES:.S=.o)
GCCFLAGS = -Wall -O2 -ffreestanding -nostartfiles -mstrict-align
GCCPATH = ../../arm-gnu-toolchain-13.2.Rel1-darwin-arm64-aarch64-none-elf/bin
2021-10-13 09:33:40 +00:00
all: clean kernel8.img
%.o: %.c
$(GCCPATH)/aarch64-none-elf-gcc $(GCCFLAGS) -c $< -o $@
%.o: %.S
$(GCCPATH)/aarch64-none-elf-gcc $(GCCFLAGS) -c $< -o $@
kernel8.img: $(OFILES)
$(GCCPATH)/aarch64-none-elf-ld -nostdlib $(OFILES) -T boot/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