aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrégoire Passault <g.passault@gmail.com>2014-11-26 22:56:37 -0500
committerbnewbold <bnewbold@robocracy.org>2015-05-27 20:52:04 -0700
commit91abbf1635da21efc95ff67b13018ce97315bff0 (patch)
tree709c0cf7ff7575c738b18cc687fe082a2dd23fa6
parente400311df8c08515f6bc60b8a16432613eac5967 (diff)
downloadlibrambutan-91abbf1635da21efc95ff67b13018ce97315bff0.tar.gz
librambutan-91abbf1635da21efc95ff67b13018ce97315bff0.zip
Generate .hex files as well.
Signed-off-by: Grégoire Passault <g.passault@gmail.com> Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
-rw-r--r--Makefile2
-rw-r--r--build-targets.mk3
2 files changed, 4 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index c632ee8..82ba456 100644
--- a/Makefile
+++ b/Makefile
@@ -135,7 +135,7 @@ ifneq ($(PREV_BUILD_TYPE), $(MEMORY_TARGET))
$(shell rm -rf $(BUILD_PATH))
endif
-sketch: build-check MSG_INFO $(BUILD_PATH)/$(BOARD).bin
+sketch: build-check MSG_INFO $(BUILD_PATH)/$(BOARD).bin $(BUILD_PATH)/$(BOARD).hex
clean:
rm -rf build
diff --git a/build-targets.mk b/build-targets.mk
index 4b9c880..8232867 100644
--- a/build-targets.mk
+++ b/build-targets.mk
@@ -16,6 +16,9 @@ library: $(BUILD_PATH)/libmaple.a
$(BUILD_PATH)/$(BOARD).elf: $(BUILDDIRS) $(TGT_BIN) $(OBJ_FILES)
$(SILENT_LD) $(CXX) $(LDFLAGS) -o $@ $(TGT_BIN) $(BUILD_PATH)/main.o -Wl,-Map,$(BUILD_PATH)/$(BOARD).map
+$(BUILD_PATH)/$(BOARD).hex: $(BUILD_PATH)/$(BOARD).elf
+ $(SILENT_OBJCOPY) $(OBJCOPY) -v -Oihex $(BUILD_PATH)/$(BOARD).elf $@ 1>/dev/null
+
$(BUILD_PATH)/$(BOARD).bin: $(BUILD_PATH)/$(BOARD).elf
$(SILENT_OBJCOPY) $(OBJCOPY) -v -Obinary $(BUILD_PATH)/$(BOARD).elf $@ 1>/dev/null
$(SILENT_DISAS) $(DISAS) -d $(BUILD_PATH)/$(BOARD).elf > $(BUILD_PATH)/$(BOARD).disas