RISC-V/V003/math/avr/gcc.mk

21 lines
457 B
Makefile
Raw Permalink Normal View History

2024-03-11 15:05:36 +01:00
# 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