aboutsummaryrefslogtreecommitdiff
path: root/utils/cmake/toolchains/AVR_GCC/bin-generator.cmake
diff options
context:
space:
mode:
authorJakob Stendahl <jakobste@uio.no>2021-01-11 13:41:18 +0100
committerJakob Stendahl <jakobste@uio.no>2021-01-11 13:41:18 +0100
commitd17bc0fc4bb057378fadf3f9feb0de1df60d611a (patch)
treeca3069eeacb0b7379cb289d87be932956e449d9c /utils/cmake/toolchains/AVR_GCC/bin-generator.cmake
parent19d65c7b2e287223113ab916e103638c5c5003f5 (diff)
downloadhoverbit-ble-d17bc0fc4bb057378fadf3f9feb0de1df60d611a.tar.gz
hoverbit-ble-d17bc0fc4bb057378fadf3f9feb0de1df60d611a.zip
:sparkles: Add working bluetooth receiver
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")