mirror of
https://github.com/apache/nuttx.git
synced 2025-12-08 19:02:43 +08:00
tasking/cmake: Provide better .hex and .srec gen for tasking compiler
Provide better hex and srec generation for tasking compiler, without relying on freeware tricore-elf-objcopy. Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
This commit is contained in:
@@ -22,22 +22,26 @@
|
||||
|
||||
function(nuttx_generate_outputs target)
|
||||
if(CONFIG_INTELHEX_BINARY)
|
||||
add_custom_command(
|
||||
OUTPUT ${target}.hex
|
||||
COMMAND ${CMAKE_OBJCOPY} -O ihex ${target} ${target}.hex
|
||||
DEPENDS ${target})
|
||||
add_custom_target(${target}-hex ALL DEPENDS ${target}.hex)
|
||||
add_dependencies(nuttx_post ${target}-hex)
|
||||
if(NOT CONFIG_ARCH_TOOLCHAIN_TASKING)
|
||||
add_custom_command(
|
||||
OUTPUT ${target}.hex
|
||||
COMMAND ${CMAKE_OBJCOPY} -O ihex ${target} ${target}.hex
|
||||
DEPENDS ${target})
|
||||
add_custom_target(${target}-hex ALL DEPENDS ${target}.hex)
|
||||
add_dependencies(nuttx_post ${target}-hex)
|
||||
endif()
|
||||
file(APPEND ${CMAKE_BINARY_DIR}/nuttx.manifest "${target}.hex\n")
|
||||
endif()
|
||||
|
||||
if(CONFIG_MOTOROLA_SREC)
|
||||
add_custom_command(
|
||||
OUTPUT ${target}.srec
|
||||
COMMAND ${CMAKE_OBJCOPY} -O srec ${target} ${target}.srec
|
||||
DEPENDS ${target})
|
||||
add_custom_target(${target}-srec ALL DEPENDS ${target}.srec)
|
||||
add_dependencies(nuttx_post ${target}-srec)
|
||||
if(NOT CONFIG_ARCH_TOOLCHAIN_TASKING)
|
||||
add_custom_command(
|
||||
OUTPUT ${target}.srec
|
||||
COMMAND ${CMAKE_OBJCOPY} -O srec ${target} ${target}.srec
|
||||
DEPENDS ${target})
|
||||
add_custom_target(${target}-srec ALL DEPENDS ${target}.srec)
|
||||
add_dependencies(nuttx_post ${target}-srec)
|
||||
endif()
|
||||
file(APPEND ${CMAKE_BINARY_DIR}/nuttx.manifest "${target}.srec\n")
|
||||
endif()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user