TOOLCHAIN_PREFIX = /opt/gcc-arm-none-eabi/bin/arm-none-eabi- TOOLCHAIN_SUFFIX = CC = $(TOOLCHAIN_PREFIX)gcc$(TOOLCHAIN_SUFFIX) GDB = $(TOOLCHAIN_PREFIX)gdb$(TOOLCHAIN_SUFFIX) SIZE = $(TOOLCHAIN_PREFIX)size$(TOOLCHAIN_SUFFIX) OBJCOPY = $(TOOLCHAIN_PREFIX)objcopy$(TOOLCHAIN_SUFFIX) OBJDUMP = $(TOOLCHAIN_PREFIX)objdump$(TOOLCHAIN_SUFFIX) STRIP = $(TOOLCHAIN_PREFIX)strip$(TOOLCHAIN_SUFFIX) READELF = $(TOOLCHAIN_PREFIX)readelf$(TOOLCHAIN_SUFFIX) NM = $(TOOLCHAIN_PREFIX)nm$(TOOLCHAIN_SUFFIX) #environment variables ARCH_CFLAGS = -mcpu=cortex-m7 -mthumb -mlittle-endian -mfpu=fpv5-sp-d16 -mfloat-abi=hard OPT_CFLAGS = -fdata-sections -ffunction-sections PLATFORM_CFLAGS = -Wno-unused-parameter -nostdinc -ffreestanding -fno-builtin -fsigned-char -fno-common -Wno-main -I$(shell $(CC) -print-search-dirs | $(AWK) '$$1 == "install:" {print $$NF}')include PLATFORM_CFLAGS += -DARM_MATH_CM7 PLATFORM_CXXFLAGS = $(PLATFORM_CFLAGS) -fno-rtti -fno-exceptions -fno-use-cxa-atexit PLATFORM_LDFLAGS = -nostdlib -nostartfiles -nodefaultlibs -Wl,-static,-gc-sections define CONFIG_TARGETS ifdef LINK_TARGET .PHONY: link_target_size config_final_target: $(BINDIR)/$(TARGET_VER).hex $(BINDIR)/$(TARGET_VER).bin link_target_size $(BINDIR)/$(TARGET).lst $(BINDIR)/$(TARGET)_sym.rep $(BINDIR)/$(TARGET)_sym.rep: $(BINDIR)/$(LINK_TARGET) | $(BINDIR)/ $(NM) -t d -S --size-sort $(BINDIR)/$(LINK_TARGET) > $(BINDIR)/$(TARGET)_sym.rep @echo $(BINDIR)/$(TARGET).lst: $(BINDIR)/$(LINK_TARGET) | $(BINDIR)/ $(OBJDUMP) -xds -S -l $(BINDIR)/$(LINK_TARGET) > $(BINDIR)/$(TARGET).lst @echo link_target_size: $(BINDIR)/$(LINK_TARGET) @$(SIZE) -A -d $(BINDIR)/$(LINK_TARGET) @echo $(BINDIR)/$(TARGET_VER).hex: $(BINDIR)/$(LINK_TARGET) | $(BINDIR)/ $(OBJCOPY) -O ihex $(BINDIR)/$(LINK_TARGET) $(BINDIR)/$(TARGET_VER).hex @echo endif endef CMSIS_MATH_LIB = m7lfsp include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/build.mk