diff --git a/cpu/cc2538/Makefile.cc2538 b/cpu/cc2538/Makefile.cc2538 index ad54c59e8..073de35bb 100644 --- a/cpu/cc2538/Makefile.cc2538 +++ b/cpu/cc2538/Makefile.cc2538 @@ -27,7 +27,7 @@ ifdef NODEID endif ### CPU-dependent cleanup files -CLEAN += symbols.c symbols.h *.d *.elf +CLEAN += symbols.c symbols.h *.d *.elf *.hex ### CPU-dependent directories CONTIKI_CPU_DIRS = . dev usb @@ -54,7 +54,7 @@ CONTIKI_SOURCEFILES += $(CONTIKI_CPU_SOURCEFILES) $(DEBUG_IO_SOURCEFILES) CONTIKI_SOURCEFILES += $(USB_CORE_SOURCEFILES) $(USB_ARCH_SOURCEFILES) ### Don't treat the .elf as intermediate -.PRECIOUS: %.elf %.bin +.PRECIOUS: %.elf %.hex %.bin ### Always re-build ieee-addr.o in case the command line passes a new NODEID FORCE: @@ -70,12 +70,15 @@ CUSTOM_RULE_LINK=1 $(TRACE_LD) $(Q)$(LD) $(LDFLAGS) ${filter-out $(LDSCRIPT) %.a,$^} ${filter %.a,$^} -o $@ +%.hex: %.elf + $(OBJCOPY) -O ihex $< $@ + %.bin: %.elf $(OBJCOPY) $(OBJCOPY_FLAGS) $< $@ -### We don't really need the .bin for the .$(TARGET) but let's make sure it -### gets built -%.$(TARGET): %.elf %.bin +### We don't really need the .hex and .bin for the .$(TARGET) but let's make +### sure they get built +%.$(TARGET): %.elf %.hex %.bin cp $< $@ ### This rule is used to generate the correct linker script