RISC-V/math/stm32f051/gcc.mk
2024-03-11 15:05:36 +01:00

21 lines
457 B
Makefile

# Use gcc / binutils toolchain
PREFIX = arm-none-eabi-
CC = $(PREFIX)gcc
CXX = $(PREFIX)g++
# linker je ld
LD = $(PREFIX)g++
SIZE = $(PREFIX)size
DUMP = $(PREFIX)objdump
COPY = $(PREFIX)objcopy
CFLAGS+= -Os -flto
CCPU = -mcpu=cortex-m0
MCPU = -mthumb $(CCPU)
CFLAGS+= $(MCPU)
LFLAGS+= $(MCPU)
LFLAGS+= -Wl,--Map=$(@:%.elf=%.map),--gc-sections
LFLAGS+= -nostartfiles -flto -O3
LDLIBS+= -L./stm32f051 -T script.ld
OBJS += startup.o system.o gpio.o