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