Implement SHA256 update file checking
This commit is contained in:
@@ -136,8 +136,14 @@ add_custom_command(
|
||||
)
|
||||
|
||||
set(HEX_PATH "${CMAKE_CURRENT_BINARY_DIR}/${HEXFILE}")
|
||||
add_custom_target(update-image ALL DEPENDS ${HEX_PATH})
|
||||
add_custom_target(update-image ALL DEPENDS ${HEX_PATH} "${HEX_PATH}.sha")
|
||||
add_custom_command(
|
||||
DEPENDS ${ELFFILE}
|
||||
OUTPUT ${HEX_PATH}
|
||||
COMMAND ${CMAKE_OBJCOPY} -O ihex ${ELFFILE} ${HEX_PATH})
|
||||
COMMAND ${CMAKE_OBJCOPY} -O ihex ${ELFFILE} ${HEX_PATH}
|
||||
)
|
||||
add_custom_command(
|
||||
DEPENDS ${HEX_PATH}
|
||||
OUTPUT "${HEX_PATH}.sha"
|
||||
COMMAND sha256sum "${HEX_PATH}" | cut -d " " -f 1 > "${HEX_PATH}.sha"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user