From 5eade939bcfc14b937f1040587fa65e11d09249c Mon Sep 17 00:00:00 2001 From: "Jan \"Yenya\" Kasprzak" Date: Fri, 8 Jun 2012 18:17:58 +0200 Subject: [PATCH] Makefile: more targets --- Makefile | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 227e395..99b9793 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,7 @@ FORMAT=ihex CC=avr-gcc OBJCOPY=avr-objcopy +OBJDUMP=avr-objdump AVRDUDE=avrdude all: $(PROGRAM).hex $(PROGRAM).eep @@ -24,6 +25,20 @@ 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 @@ -46,7 +61,7 @@ program: $(PROGRAM).hex $(PROGRAM).eep $(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 -- 2.43.5