CC=avr-gcc
OBJCOPY=avr-objcopy
+OBJDUMP=avr-objdump
AVRDUDE=avrdude
all: $(PROGRAM).hex $(PROGRAM).eep
program: $(PROGRAM).hex $(PROGRAM).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) -U flash:w:$(PROGRAM).hex:i -U eeprom:w:$(PROGRAM).eep:i
+program_flash: $(PROGRAM).hex
+ $(AVRDUDE) $(AVRDUDE_FLAGS) -U flash:w:$(PROGRAM).hex:i
+
+program_eeprom: $(PROGRAM).eep
+ $(AVRDUDE) $(AVRDUDE_FLAGS) eeprom:w:$(PROGRAM).eep:i
+
+dump_eeprom:
+ $(AVRDUDE) $(AVRDUDE_FLAGS) -U eeprom:r:eeprom.raw:r
+ od -tx1 eeprom.raw
+
+objdump: $(PROGRAM).elf
+ $(OBJDUMP) --disassemble $<
+
+
.PRECIOUS : $(OBJ) $(PROGRAM).elf
%.hex: %.elf
$(CC) -c $(CFLAGS) $< -o $@
clean:
- rm -f $(PROGRAM).hex $(PROGRAM).eep $(PROGRAM).elf *.o *.s
+ rm -f $(PROGRAM).hex $(PROGRAM).eep $(PROGRAM).elf *.o *.s eeprom.raw
-.PHONY: all clean
+.PHONY: all clean dump_eeprom program program_flash program_eeprom objdump