Add ARM basic bootloader build

This commit is contained in:
2022-05-07 23:00:22 -07:00
parent 47059c1c15
commit d83d42fb60
4 changed files with 100 additions and 0 deletions

25
arm/makefile Normal file
View File

@@ -0,0 +1,25 @@
CC = arm-none-eabi-gcc
LD = arm-none-eabi-gcc
CXX = arm-none-eabi-g++
OBJCOPY = arm-none-eabi-objcopy
linker_script = bootloader.ld
CFLAGS = -march=armv6-m -g -ffunction-sections -fdata-sections -O2
CXXFLAGS = $(CFLAGS) -std=c++20 -fno-exceptions
LDFLAGS = -march=armv6-m -g --specs=nano.specs --specs=nosys.specs -Wl,--gc-sections -Wl,-T$(linker_script) -O2
all: bootloader.bin
%.bin: %.elf
$(OBJCOPY) -O binary $< $@
bootloader.elf: main.o vector_table.o
%.elf:
$(LD) $(LDFLAGS) -o $@ $^
.PHONY: clean
clean:
rm -rf *.elf *.bin *.o