[#3756] Regenerate files only if there is a difference