]> www.fi.muni.cz Git - bike-lights.git/commitdiff
Makefile: more targets
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Fri, 8 Jun 2012 16:17:58 +0000 (18:17 +0200)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Fri, 8 Jun 2012 16:17:58 +0000 (18:17 +0200)
Makefile

index 227e3958f137d83f2e70b718ed5db70b02b82a43..99b97938e5db89f661382c25d8152eae3f1bb0e0 100644 (file)
--- 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