aboutsummaryrefslogtreecommitdiff
path: root/utils/cmake/toolchains/ARM_GCC/hex-generator.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'utils/cmake/toolchains/ARM_GCC/hex-generator.cmake')
-rw-r--r--utils/cmake/toolchains/ARM_GCC/hex-generator.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/utils/cmake/toolchains/ARM_GCC/hex-generator.cmake b/utils/cmake/toolchains/ARM_GCC/hex-generator.cmake
new file mode 100644
index 0000000..4948935
--- /dev/null
+++ b/utils/cmake/toolchains/ARM_GCC/hex-generator.cmake
@@ -0,0 +1,9 @@
+add_custom_command(
+ OUTPUT "${PROJECT_SOURCE_DIR}/${codal.output_folder}/${device.device}.hex"
+ COMMAND "${ARM_NONE_EABI_OBJCOPY}" -O ihex "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${device.device}" "${PROJECT_SOURCE_DIR}/${codal.output_folder}/${device.device}.hex"
+ DEPENDS ${device.device}
+ COMMENT "converting to hex file."
+)
+
+#specify a dependency on the elf file so that hex is automatically rebuilt when elf is changed.
+add_custom_target(${device.device}_hex ALL DEPENDS "${PROJECT_SOURCE_DIR}/${codal.output_folder}/${device.device}.hex")