Skip to content
Snippets Groups Projects
Commit 62fa36bc authored by Kent McLeod's avatar Kent McLeod
Browse files

hardware_gen.py: Only rebuild dts if input stale

configure_file only updates the target file if the source file has
changed. This will detect changes due to changing the target platform.
check_outfile_stale will check that the dtb is newer than the
dts, otherwise rebuild it.
parent 0cc4997a
No related branches found
No related tags found
No related merge requests found
......@@ -119,14 +119,17 @@ if (DEFINED KernelDTSList)
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/gen_headers/plat/machine/"
)
execute_process(
COMMAND bash -c "cat ${dts_list} > ${KernelDTSIntermediate}"
COMMAND bash -c "cat ${dts_list} > ${KernelDTSIntermediate}.in"
)
# Compile DTS to DTB
execute_process(
COMMAND ${DTC_TOOL} -q -I dts -O dtb -o ${KernelDTBPath} ${KernelDTSIntermediate}
)
configure_file(${KernelDTSIntermediate}.in ${KernelDTSIntermediate} COPYONLY)
check_outfile_stale(regen ${KernelDTBPath} KernelDTSIntermediate)
if (regen)
# Compile DTS to DTB
execute_process(
COMMAND ${DTC_TOOL} -q -I dts -O dtb -o ${KernelDTBPath} ${KernelDTSIntermediate}
)
endif()
# Generate devices_gen header based on DTB
execute_process(
COMMAND ${PYTHON} "${HARDWARE_GEN_PATH}" --dtb "${KernelDTBPath}" --compatibility-strings "${compatibility_outfile}" --output "${device_dest}" --config "${config_file}" --schema "${config_schema}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment