Add ARM basic bootloader build
This commit is contained in:
25
arm/makefile
Normal file
25
arm/makefile
Normal 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
|
||||
Reference in New Issue
Block a user