2021-03-07 19:05:08 +00:00
|
|
|
CFILES = $(wildcard *.c lib/*.c)
|
|
|
|
OFILES = $(CFILES:.c=.o)
|
|
|
|
LLVMPATH = /opt/homebrew/opt/llvm/bin
|
|
|
|
CLANGFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib -mcpu=cortex-a72+nosimd
|
|
|
|
|
|
|
|
all: clean kernel8.img
|
|
|
|
|
|
|
|
boot/boot.o: boot/boot.S
|
|
|
|
$(LLVMPATH)/clang --target=aarch64-elf $(CLANGFLAGS) -c $< -o $@
|
|
|
|
|
2021-03-12 13:38:35 +00:00
|
|
|
bin/wgt1pal.o: bin/wgt1.pal
|
|
|
|
$(LLVMPATH)/llvm-objcopy -I binary -O elf64-littleaarch64 -B aarch64 $< $@
|
|
|
|
|
|
|
|
bin/wgt1blk.o: bin/wgt1.blk
|
|
|
|
$(LLVMPATH)/llvm-objcopy -I binary -O elf64-littleaarch64 -B aarch64 $< $@
|
|
|
|
|
2021-03-14 19:40:02 +00:00
|
|
|
bin/wgt2blk.o: bin/wgt2.blk
|
|
|
|
$(LLVMPATH)/llvm-objcopy -I binary -O elf64-littleaarch64 -B aarch64 $< $@
|
|
|
|
|
2021-03-15 22:04:22 +00:00
|
|
|
bin/lettersspr.o: bin/letters.spr
|
|
|
|
$(LLVMPATH)/llvm-objcopy -I binary -O elf64-littleaarch64 -B aarch64 $< $@
|
|
|
|
|
2021-03-20 16:36:08 +00:00
|
|
|
bin/spacespr.o: bin/space.spr
|
|
|
|
$(LLVMPATH)/llvm-objcopy -I binary -O elf64-littleaarch64 -B aarch64 $< $@
|
|
|
|
|
2021-03-20 20:50:40 +00:00
|
|
|
bin/invaderspr.o: bin/invader.spr
|
|
|
|
$(LLVMPATH)/llvm-objcopy -I binary -O elf64-littleaarch64 -B aarch64 $< $@
|
|
|
|
|
2021-03-20 21:02:20 +00:00
|
|
|
bin/mousespr.o: bin/mouse.spr
|
|
|
|
$(LLVMPATH)/llvm-objcopy -I binary -O elf64-littleaarch64 -B aarch64 $< $@
|
|
|
|
|
2021-03-07 19:05:08 +00:00
|
|
|
%.o: %.c
|
|
|
|
$(LLVMPATH)/clang --target=aarch64-elf $(CLANGFLAGS) -c $< -o $@
|
|
|
|
|
2021-03-20 21:02:20 +00:00
|
|
|
kernel8.img: boot/boot.o $(OFILES) bin/wgt1pal.o bin/wgt1blk.o bin/wgt2blk.o bin/lettersspr.o bin/spacespr.o bin/invaderspr.o bin/mousespr.o
|
|
|
|
$(LLVMPATH)/ld.lld -m aarch64elf -nostdlib boot/boot.o $(OFILES) bin/wgt1pal.o bin/wgt1blk.o bin/wgt2blk.o bin/lettersspr.o bin/spacespr.o bin/invaderspr.o bin/mousespr.o -T boot/link.ld -o kernel8.elf
|
2021-03-07 19:05:08 +00:00
|
|
|
$(LLVMPATH)/llvm-objcopy -O binary kernel8.elf kernel8.img
|
|
|
|
|
|
|
|
clean:
|
|
|
|
/bin/rm kernel8.elf *.o bin/*.o boot/*.o lib/*.o *.img > /dev/null 2> /dev/null || true
|