8 TARGET = ${ARCH}-none-elf
13 ASFLAGS = -target ${TARGET}
16 CXXFLAGS += -target ${TARGET}
17 CXXFLAGS +=-Wall -Wextra -Werror
18 CXXFLAGS +=-nostdlib -fno-exceptions -std=c++11
19 CXXFLAGS +=-ffreestanding -mgeneral-regs-only
21 CXXFILES += kernel.cc uart_${BOARD}.cc
23 OBJS = ${ASFILES:.S=.o} ${CXXFILES:.cc=.o}
26 .PHONY: all clean disassemble tools
28 all: squat-${BOARD}.img tools
30 squat-${BOARD}.img: squat-${BOARD}.elf
31 ${OBJCOPY} squat-${BOARD}.elf -O binary squat-${BOARD}.img
33 squat-${BOARD}.elf: linker.ld ${OBJS}
34 ${LD} -T linker.ld -o squat-${BOARD}.elf ${OBJS}
37 ${AS} ${ASFLAGS} -c $< -o $@
40 rm -rf *.o squat-*.elf squat-*.img
41 ${MAKE} -C tools/img_eGON.BT0 clean
43 disassemble: squat-${BOARD}.elf
44 ${OBJDUMP} -d squat-${BOARD}.elf
47 ${MAKE} -C tools/img_eGON.BT0 img_eGON.BT0