From 8b9afc3fed115b4abfb80ade92875dda278ec2ed Mon Sep 17 00:00:00 2001 From: Francisco Molina Date: Tue, 28 Jan 2020 13:02:10 +0100 Subject: [PATCH] makefiles/dependencies_debug.inc.mk: add DEPENDENCY_DEBUG_SORT_VARS Define DEPENDENCY_DEBUG_SORT_VARS that can be set as 1 so that DEPS_DEBUG_VARS are sorted before saving to file. --- makefiles/dependencies_debug.inc.mk | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/makefiles/dependencies_debug.inc.mk b/makefiles/dependencies_debug.inc.mk index 5926b61357..e8cb46db19 100644 --- a/makefiles/dependencies_debug.inc.mk +++ b/makefiles/dependencies_debug.inc.mk @@ -50,6 +50,13 @@ file_save_dependencies_variables = $(call file_save_variable,$(DEPENDENCY_DEBUG_ # Remove file before to be sure appending is started with an empty file file_save_variable = $(shell mkdir -p $(dir $1); rm -f $1)$(foreach v,$2,$(file >>$1,$(call _print_var,$v))) +# print variables sorted, this can eliminate false positives but will not allow +# to tell in what order the variables where updated. +DEPENDENCY_DEBUG_SORT_VARS ?= 0 # Remove spaces in case of empty value # Remove spaces around value as it happens -_print_var = $(strip $1 = $(strip $($1))) +ifneq (1,$(DEPENDENCY_DEBUG_SORT_VARS)) + _print_var = $(strip $1 = $(strip $($1))) +else + _print_var = $(sort $(strip $1 = $(strip $($1)))) +endif