7 TARGET = ${ARCH}-none-elf
10 ASFLAGS = -target ${TARGET}
13 CXXFLAGS = -target ${TARGET}
14 CXXFLAGS +=-Wall -Wextra -Werror
15 CXXFLAGS +=-nostdlib -fno-exceptions -std=c++11
16 CXXFLAGS +=-ffreestanding -mgeneral-regs-only
18 CXXFILES = kernel.cc uart_${BOARD}.cc
20 OBJS = ${ASFILES:.S=.o} ${CXXFILES:.cc=.o}
24 .PHONY: clean qemu gdb-remote
29 ${OBJCOPY} squat.elf -O binary squat.img
31 squat.elf: linker.ld ${OBJS}
32 ${LD} -T linker.ld -o squat.elf ${OBJS}
35 ${AS} ${ASFLAGS} -c $< -o $@
38 rm -rf *.o squat.elf squat.img
41 qemu-system-${ARCH} -M ${BOARD} -cpu cortex-a53 \
42 -kernel squat.img -nographic -monitor none -serial stdio
44 qemu-system-${ARCH} -s -S -M ${BOARD} -cpu cortex-a53 \
45 -kernel squat.img -nographic -monitor none -serial stdio