diff --git a/mkhelper/depgen.py b/mkhelper/depgen.py index 0e4f7ed..3a48ebe 100755 --- a/mkhelper/depgen.py +++ b/mkhelper/depgen.py @@ -571,7 +571,9 @@ def format_debug_line(line, msg): "\n#\n", "# Parsed arguments:\n# ", "\n# ".join( - [k + "=" + str(v) for k, v in vars(args).items()] + sorted( + [k + "=" + str(v) for k, v in vars(args).items()] + ) ), "\n", ] @@ -600,7 +602,7 @@ def format_debug_line(line, msg): def gen_lc_deps(src_name, lc_files): result = [] if src_name and lc_files: - result.append("{0}: {1}\n".format(src_name, " ".join(lc_files))) + result.append("{0}: {1}\n".format(src_name, " ".join(sorted(lc_files)))) return result @@ -608,7 +610,7 @@ def gen_include_deps(src_name, obj_name, dep_name, included_files): result = [] targets = " ".join(filter(None, (obj_name, dep_name))) if targets: - prereqs = " ".join(filter(None, [src_name] + list(included_files))) + prereqs = " ".join(filter(None, [src_name] + sorted(included_files))) if prereqs: result.append("{0}: {1}\n".format(targets, prereqs)) return result @@ -627,8 +629,10 @@ def gen_module_deps( if obj_name: if provided_modules: targets = " ".join( - modulenames_to_filenames( - provided_modules, mod_dir, mod_upper, mod_ext + sorted( + modulenames_to_filenames( + provided_modules, mod_dir, mod_upper, mod_ext + ) ) ) result.append("{0}: {1}\n".format(targets, obj_name)) @@ -641,8 +645,10 @@ def gen_module_deps( ] if required_modules: prereqs = " ".join( - modulenames_to_filenames( - required_modules, mod_dir, mod_upper, mod_ext + sorted( + modulenames_to_filenames( + required_modules, mod_dir, mod_upper, mod_ext + ) ) ) result.append("{0}: {1}\n".format(obj_name, prereqs)) @@ -651,8 +657,10 @@ def gen_module_deps( result.extend( [ "#-hint <*:{0}>.targets: {1}\n".format(m, obj_name) - for m in modulenames_to_filenames( - extended_modules, mod_dir, mod_upper, mod_ext + for m in sorted( + modulenames_to_filenames( + extended_modules, mod_dir, mod_upper, mod_ext + ) ) ] )