summaryrefslogtreecommitdiff
path: root/firmware/common.mk
diff options
context:
space:
mode:
authorDominic Spill <dominicgs@gmail.com>2011-07-12 15:01:39 +0000
committerDominic Spill <dominicgs@gmail.com>2011-07-12 15:01:39 +0000
commit6502f5aa6c5bde84c6979ab8a18f29bff4e4aca3 (patch)
treedcf59e7f2036662f02040191d3cd5ea9c3c4a365 /firmware/common.mk
parenta8f5f9a797b264287361d67b88fd1749f58562ee (diff)
Add dfu file suffix support
Diffstat (limited to 'firmware/common.mk')
-rw-r--r--firmware/common.mk13
1 files changed, 12 insertions, 1 deletions
diff --git a/firmware/common.mk b/firmware/common.mk
index 9a8c29a..2ce3110 100644
--- a/firmware/common.mk
+++ b/firmware/common.mk
@@ -236,6 +236,8 @@ READELF = arm-none-eabi-readelf
SIZE = arm-none-eabi-size
AR = arm-none-eabi-ar -r
NM = arm-none-eabi-nm
+PYTHON = /usr/bin/env python
+DFU_TOOL = $(PYTHON) ../../host/usb_dfu/ubertooth-dfu
REMOVE = rm -f
# Define Messages
@@ -245,6 +247,7 @@ MSG_END = -------- end --------
MSG_SIZE_BEFORE = Size before:
MSG_SIZE_AFTER = Size after:
MSG_FLASH = Creating load file for Flash:
+MSG_DFU = Creating DFU firmware file:
MSG_EEPROM = Creating load file for EEPROM:
MSG_EXTENDED_LISTING = Creating Extended Listing:
MSG_SYMBOL_TABLE = Creating Symbol Table:
@@ -276,7 +279,7 @@ ALL_CFLAGS_LINKER = -mcpu=$(CPU) -$(CPU_MODE) $(CPU_FLAGS_ASM)
all: begin gccversion sizebefore build showtarget sizeafter end
# Change the build target to build a HEX file or a library.
-build: elf hex bin srec lss sym
+build: elf hex bin srec lss sym dfu
#build: lib
elf: $(TARGET).elf
@@ -286,6 +289,7 @@ srec: $(TARGET).srec
eep: $(TARGET).eep
lss: $(TARGET).lss
sym: $(TARGET).sym
+dfu: $(TARGET).dfu
LIBNAME=lib$(TARGET).a
lib: $(LIBNAME)
@@ -357,6 +361,12 @@ program: $(TARGET).hex
@echo $(MSG_SYMBOL_TABLE) $@
$(NM) -n $< > $@
+# Create a DFU file with checksum and 16 byte suffix
+%.dfu: %.bin
+ @echo
+ @echo $(MSG_DFU) $@
+ $(DFU_TOOL) sign $(TARGET).bin
+
# Create library from object files.
.SECONDARY : $(TARGET).a
.PRECIOUS : $(OBJ)
@@ -432,6 +442,7 @@ clean_list:
$(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVE) $(TARGET).bin
+ $(REMOVE) $(TARGET).dfu
$(REMOVE) $(TARGET).srec
doxygen: