22 lines
457 B
Makefile
22 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
|
||
|
|
||
|
|