synth/arm/makefile

25 lines
544 B
Makefile
Raw Normal View History

2022-05-08 06:00:22 +00:00
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