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