[XEN PATCH] build: fix auto defconfig rule

Anthony PERARD posted 1 patch 2 years, 2 months ago
Test gitlab-ci failed
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20220225145409.41323-1-anthony.perard@citrix.com
xen/Makefile | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
[XEN PATCH] build: fix auto defconfig rule
Posted by Anthony PERARD 2 years, 2 months ago
We should only run "defconfig" if ".config" is missing. Commit
317c98cb91 have added a dependency on "tools/fixdep", so make would
start runnning "defconfig" also when "tools/fixdep" is newer than
".config" and thus overwrite any changes made by a developer.
Reintroduce intended behavior of the rule to only generate a default
Kconfig when ".config" is missing.

Fixes: 317c98cb91 ("build: hook kconfig into xen build system")
Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 xen/Makefile | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index 133b382f86..ed4891daf1 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -243,15 +243,10 @@ ifeq ($(need-config),y)
 # changes are detected.
 -include include/config/auto.conf.cmd
 
-# This allows make to build fixdep before invoking defconfig. We can't use
-# "tools_fixdep" which is a .PHONY target and would force make to call
-# "defconfig" again to update $(KCONFIG_CONFIG).
-tools/fixdep:
-	$(Q)$(MAKE) $(build)=tools tools/fixdep
-
 # Allow people to just run `make` as before and not force them to configure
-$(KCONFIG_CONFIG): tools/fixdep
-	$(Q)$(MAKE) $(build)=tools/kconfig defconfig
+# Only run defconfig if $(KCONFIG_CONFIG) is missing
+$(KCONFIG_CONFIG): tools_fixdep
+	$(if $(wildcard $@), , $(Q)$(MAKE) $(build)=tools/kconfig defconfig)
 
 # The actual configuration files used during the build are stored in
 # include/generated/ and include/config/. Update them if .config is newer than
-- 
Anthony PERARD