diff options
Diffstat (limited to 'utils/cmake/toolchains/AVR_GCC/hex-generator.cmake')
-rw-r--r-- | utils/cmake/toolchains/AVR_GCC/hex-generator.cmake | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/utils/cmake/toolchains/AVR_GCC/hex-generator.cmake b/utils/cmake/toolchains/AVR_GCC/hex-generator.cmake new file mode 100644 index 0000000..5be3c67 --- /dev/null +++ b/utils/cmake/toolchains/AVR_GCC/hex-generator.cmake @@ -0,0 +1,9 @@ +add_custom_command( + OUTPUT "${PROJECT_SOURCE_DIR}/${codal.output_folder}/${device.device}.hex" + COMMAND "${AVR_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") |