-OBJ = $(SERPENT_OBJ)
-MCU_TARGET = atmega644
-OPTIMIZE = -Os
-DEFS = -D$(call uc, $(MCU_TARGET))
-FLASHCMD = avrdude -p $(MCU_TARGET) -P /dev/ttyUSB0 -c avr911 -U flash:w:# no space at the end
+MCU_TARGET = atmega128
+F_CPU = 14745600
+OPTIMIZE = -Os # -Os
+EXTRALINK = xram.o
+DEBUG = -gdwarf-2
+WARNING = -pedantic -Wall -Werror -Wstrict-prototypes
+PROGRAMMER = jtagmkII
+PROG_PORT = usb
+DEFS = -D$(call uc, $(MCU_TARGET)) -DF_CPU=$(F_CPU)
+FLASHCMD = avrdude -p $(MCU_TARGET) -P $(PROG_PORT) -c $(PROGRAMMER) -U flash:w:# no space at the end
+#FLASHCMD = avrdude -p $(MCU_TARGET) -c usbasp -U flash:w:# no space at the end
+#RESETCMD = avrdude -p $(MCU_TARGET) -P $(PROG_PORT) -c $(PROGRAMMER)
+RESETCMD = avarice -2 -R -j usb