2024-03-27 11:57:39 +00:00
|
|
|
BOOTMNT ?= /media/cvdeveloper/bootfs
|
|
|
|
|
2021-11-06 17:16:46 +00:00
|
|
|
CFILES = $(wildcard *.c lib/*.c kernel/*.c net/*.c tcpip/*.c)
|
|
|
|
SFILES = $(wildcard boot/*.S lib/*.S kernel/*.S)
|
|
|
|
OFILES = $(CFILES:.c=.o) $(SFILES:.S=.o)
|
2024-03-27 11:57:39 +00:00
|
|
|
GCCFLAGS = -Wall -O0 -ffreestanding -nostdlib -nostartfiles
|
|
|
|
GCCPATH = ../../gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin
|
2021-11-06 17:16:46 +00:00
|
|
|
|
|
|
|
all: clean kernel8.img
|
|
|
|
|
|
|
|
%.o: %.c
|
2024-03-27 11:57:39 +00:00
|
|
|
$(GCCPATH)/aarch64-none-elf-gcc $(GCCFLAGS) -c $< -o $@
|
2021-11-06 17:16:46 +00:00
|
|
|
|
|
|
|
%.o: %.S
|
2024-03-27 11:57:39 +00:00
|
|
|
$(GCCPATH)/aarch64-none-elf-gcc $(GCCFLAGS) -c $< -o $@
|
2021-11-06 17:16:46 +00:00
|
|
|
|
|
|
|
kernel8.img: $(OFILES)
|
2024-03-27 11:57:39 +00:00
|
|
|
$(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
|
|
|
|
cp kernel8.img $(BOOTMNT)/kernel8.img
|
|
|
|
cp config.txt $(BOOTMNT)/
|
|
|
|
sync
|
2021-11-06 17:16:46 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
/bin/rm kernel8.elf */*.o *.img > /dev/null 2> /dev/null || true
|