RISC-V/V003/math/avr/gcc.mk
2024-05-07 11:46:49 +02:00

20 lines
457 B
Makefile

# Use gcc / binutils toolchain
PREFIX = avr-
CC = $(PREFIX)gcc
CXX = $(PREFIX)g++
LD = $(PREFIX)g++
SIZE = $(PREFIX)size
DUMP = $(PREFIX)objdump
COPY = $(PREFIX)objcopy
MCU = atmega128
OBJS += simulate.o
CFLAGS+= -Os -DHAVE_STDLIB
CFLAGS+= -mmcu=$(MCU)
LFLAGS+= -mmcu=$(MCU) -Wl,--Map=$(@:%.elf=%.map),--relax,--gc-sections
LFLAGS+= -Wl,--undefined=_mmcu,--section-start=.mmcu=0x910000
#LFLAGS+= -O3
LDLIBS+= -lc
run: $(PRJ).elf
simavr ./$(PRJ).elf