Blob


1 ARCH = aarch64
2 TARGET = ${ARCH}-none-elf
3 BOARD ?=qemu_virt
5 BIN = /usr/local/bin/
7 AS = ${BIN}clang
8 ASFLAGS = -target ${TARGET}
9 ASFILES = boot.o
11 CXX = ${BIN}clang++
12 CXXFLAGS = -target ${TARGET} -Wall -Wextra -nostdlib -fno-exceptions
13 CXXFLAGS += -ffreestanding -mgeneral-regs-only
14 CXXFLAGS += -Iinclude
15 CXXFILES = kernel.cc uart_${BOARD}.cc
17 OBJS = ${ASFILES:.S=.o} ${CXXFILES:.cc=.o}
18 LD = ${BIN}ld.lld
20 .PHONY: clean
22 all: squat.img
24 squat.img: squat.elf
25 llvm-objcopy squat.elf -O binary squat.img
27 squat.elf: linker.ld ${OBJS}
28 ${LD} -T linker.ld -o squat.elf ${OBJS}
30 .S.o:
31 ${AS} ${ASFLAGS} -c boot.S -o boot.o
33 clean:
34 rm -rf *.o squat.elf squat.img