|
|
@@ -60,6 +60,11 @@ function(stm32_print_size_of_target TARGET)
|
|
|
)
|
|
|
endfunction()
|
|
|
|
|
|
+# This function calls the objcopy program defined in CMAKE_OBJCOPY to generate
|
|
|
+# file with object format specified in OBJCOPY_BFD_OUTPUT.
|
|
|
+# The generated file has the name of the target output but with extension
|
|
|
+# corresponding to the OUTPUT_EXTENSION argument value.
|
|
|
+# The generated file will be placed in the same directory as the target output file.
|
|
|
function(_stm32_generate_file TARGET OUTPUT_EXTENSION OBJCOPY_BFD_OUTPUT)
|
|
|
get_target_property(TARGET_OUTPUT_NAME ${TARGET} OUTPUT_NAME)
|
|
|
set(OUTPUT_FILE_NAME "${TARGET_OUTPUT_NAME}.${OUTPUT_EXTENSION}")
|
|
|
@@ -80,14 +85,20 @@ function(_stm32_generate_file TARGET OUTPUT_EXTENSION OBJCOPY_BFD_OUTPUT)
|
|
|
)
|
|
|
endfunction()
|
|
|
|
|
|
+# This function adds post-build generation of the binary file from the target ELF.
|
|
|
+# The generated file will be placed in the same directory as the ELF file.
|
|
|
function(stm32_generate_binary_file TARGET)
|
|
|
_stm32_generate_file(${TARGET} "bin" "binary")
|
|
|
endfunction()
|
|
|
|
|
|
+# This function adds post-build generation of the Motorola S-record file from the target ELF.
|
|
|
+# The generated file will be placed in the same directory as the ELF file.
|
|
|
function(stm32_generate_srec_file TARGET)
|
|
|
_stm32_generate_file(${TARGET} "srec" "srec")
|
|
|
endfunction()
|
|
|
|
|
|
+# This function adds post-build generation of the Intel hex file from the target ELF.
|
|
|
+# The generated file will be placed in the same directory as the ELF file.
|
|
|
function(stm32_generate_hex_file TARGET)
|
|
|
_stm32_generate_file(${TARGET} "hex" "ihex")
|
|
|
endfunction()
|