bkw@venus:~/tmp/code$ cat Makefile MCU=atmega16 F_CPU=4000000 F_OSC=4000000 CC=avr-gcc OBJCOPY=avr-objcopy # optimize for size: CFLAGS=-g -mmcu=$(MCU) -Wall -Wstrict-prototypes -Os -mcall-prologues all: test.hex test.hex : test.out $(OBJCOPY) -R .eeprom -O ihex test.out test.hex test.out : test.o $(CC) $(CFLAGS) -o test.out -Wl,-Map,test.map test.o test.o : test.c $(CC) $(CFLAGS) -Os -c test.c #erase the AVR before it is programmed load: test.hex clean: rm -f *.o *.map *.out