# $Id: Makefile,v 1.1 2010/10/19 05:18:47 bsd Exp $ TARGET = xram OBJS = main.o SRCS = main.c CPU = atmega128 # the following lets the linker know where we want the data area and # heap; the stack remains in its default location which is the top of # internal SRAM (for speed) EXTERNAL_RAM = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff OPTIMIZE = -O CEXTRA = -Wa,-adhlns=$(<:.c=.lst) CFLAGS = -g -mmcu=${CPU} -Wall ${OPTIMIZE} ${CEXTRA} LDFLAGS = -mmcu=${CPU} ${EXTERNAL_RAM} -Wl,-u,vfprintf -lprintf_flt -lm CC = avr-gcc all : ${TARGET}.hex ${TARGET} : ${OBJS} avr-gcc ${LDFLAGS} -o ${TARGET} ${OBJS} ${LIBDIRS} ${LIBS} ${TARGET}.hex : ${TARGET} avr-objcopy -O ihex ${TARGET} ${TARGET}.hex .c.s : avr-gcc -c ${CFLAGS} -S -o $@ $< clean : rm -f *.srec *.lst *.o *.bin *~ .depend ${TARGET}