aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorØyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>2020-04-02 15:34:50 +0200
committerAnton Komlev <Anton.Komlev@arm.com>2020-06-19 14:21:17 +0000
commit762415cf8eb5515a5bb4daa391ecb9c0e9a7db60 (patch)
treef732c86ab971a36d8e0dd7469da1673eac17fa54 /cmake
parente409401fdf0e769516cd784de6000a8eaa16b2b2 (diff)
downloadtrusted-firmware-m-762415cf8eb5515a5bb4daa391ecb9c0e9a7db60.tar.gz
Build: Create hex and elf files of executables
Install hex and elf files to the same location as the axf and bin files Change-Id: I20a54560e733df875705f98b0ec3c3a1f5a01657 Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Common/CompilerArmClangCommon.cmake8
-rw-r--r--cmake/Common/CompilerGNUARMCommon.cmake8
2 files changed, 16 insertions, 0 deletions
diff --git a/cmake/Common/CompilerArmClangCommon.cmake b/cmake/Common/CompilerArmClangCommon.cmake
index 49379fff4..517e6e859 100644
--- a/cmake/Common/CompilerArmClangCommon.cmake
+++ b/cmake/Common/CompilerArmClangCommon.cmake
@@ -186,6 +186,14 @@ function(compiler_generate_binary_output TARGET)
add_custom_command(TARGET ${TARGET} POST_BUILD COMMAND ${CMAKE_ARMCCLANG_FROMELF} ARGS --bincombined --output=$<TARGET_FILE_DIR:${TARGET}>/${TARGET}.bin $<TARGET_FILE:${TARGET}>)
endfunction()
+function(compiler_generate_hex_output TARGET)
+ add_custom_command(TARGET ${TARGET} POST_BUILD COMMAND ${CMAKE_ARMCCLANG_FROMELF} ARGS --i32combined --output=$<TARGET_FILE_DIR:${TARGET}>/${TARGET}.hex $<TARGET_FILE:${TARGET}>)
+endfunction()
+
+function(compiler_generate_elf_output TARGET)
+ add_custom_command(TARGET ${TARGET} POST_BUILD COMMAND ${CMAKE_ARMCCLANG_FROMELF} ARGS --elf --output=$<TARGET_FILE_DIR:${TARGET}>/${TARGET}.elf $<TARGET_FILE:${TARGET}>)
+endfunction()
+
# Function for creating a new target that preprocesses a .c file
#INPUTS:
# SRC - (mandatory) - file to be preprocessed
diff --git a/cmake/Common/CompilerGNUARMCommon.cmake b/cmake/Common/CompilerGNUARMCommon.cmake
index 6d427ecbf..be1ac8faa 100644
--- a/cmake/Common/CompilerGNUARMCommon.cmake
+++ b/cmake/Common/CompilerGNUARMCommon.cmake
@@ -191,6 +191,14 @@ function(compiler_generate_binary_output TARGET)
add_custom_command(TARGET ${TARGET} POST_BUILD COMMAND ${CMAKE_GNUARM_OBJCOPY} ARGS -O binary $<TARGET_FILE:${TARGET}> $<TARGET_FILE_DIR:${TARGET}>/${TARGET}.bin)
endfunction()
+function(compiler_generate_hex_output TARGET)
+ add_custom_command(TARGET ${TARGET} POST_BUILD COMMAND ${CMAKE_GNUARM_OBJCOPY} ARGS -O ihex $<TARGET_FILE:${TARGET}> $<TARGET_FILE_DIR:${TARGET}>/${TARGET}.hex)
+endfunction()
+
+function(compiler_generate_elf_output TARGET)
+ add_custom_command(TARGET ${TARGET} POST_BUILD COMMAND ${CMAKE_GNUARM_OBJCOPY} ARGS -O elf32-little $<TARGET_FILE:${TARGET}> $<TARGET_FILE_DIR:${TARGET}>/${TARGET}.elf)
+endfunction()
+
# Function for creating a new target that preprocesses a .c file
#INPUTS:
# SRC - (mandatory) - file to be preprocessed