Blob


1 AS = clang
2 CXX = clang++
3 LD = ld.lld
4 OBJCOPY = llvm-objcopy
5 OBJDUMP = llvm-objdump
7 ARCH = aarch64
8 TARGET = ${ARCH}-none-elf
9 -include config.mk
10 #BOARD ?= virt
11 BOARD ?= a64
13 ASFLAGS = -target ${TARGET}
14 ASFILES += boot.S
16 CXXFLAGS += -target ${TARGET}
17 CXXFLAGS +=-Wall -Wextra -Werror
18 CXXFLAGS +=-nostdlib -fno-exceptions -std=c++11
19 CXXFLAGS +=-ffreestanding -mgeneral-regs-only
20 CXXFLAGS +=-Iinclude
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}
36 .S.o:
37 ${AS} ${ASFLAGS} -c $< -o $@
39 clean:
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
46 tools:
47 ${MAKE} -C tools/img_eGON.BT0 img_eGON.BT0