Based on suggestion by Colin Cross, to avoid unnecessary rebuild of llvm
in case of *.inc generated sources older than llvm-tblgen binary.
When llvm-tblgen binary is compiled and for some reason the build is interrupted,
the generated *.inc files will have a timestamp older than llvm-tblgen binary,
at this point all libLLVM* targets depending on the *.inc files are always rebuilt.
'NINJA_ARGS="-d explain" make iso_img' command revealed the cause of the problem:
ninja explain: output out/soong/.intermediates/external/llvm/llvm-gen-attributes/gen/llvm/IR/Attributes.inc
older than most recent input out/soong/host/linux-x86/bin/llvm-tblgen (
1570914978 vs
1575285173)
ninja explain: out/soong/.intermediates/external/llvm/llvm-gen-attributes/gen/llvm/IR/Attributes.inc is dirty
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Command: "${llvmTblgen} ${includes} ${generator} -d ${depfile} -o ${out} ${in}",
CommandDeps: []string{"${llvmTblgen}"},
Description: "LLVM TableGen $in => $out",
+ Restat: true,
}, "includes", "depfile", "generator")
)