RISC-V/stm32f051/gcc.mk

22 lines
457 B
Makefile
Raw Normal View History

2024-03-07 13:46:47 +01:00
# 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