From 13b026091be0c9d784c768242c308ffa303bf241 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Sat, 25 Apr 2020 03:59:21 +0900 Subject: kbuild: swap the include order of arch Makefile and auto.conf.cmd Include include/config/auto.conf arch/$(ARCH)/Makefile include/config/auto.conf.cmd in this order, which is the same as the current Linux does. auto.conf.cmd contains the environment variables that were referenced from Kconfig files. If an environment variable defined in arch Makefile is referenced from Kconfig files, Kbuild would end up with eternal synconfig loop. Signed-off-by: Masahiro Yamada Signed-off-by: Sascha Hauer --- Makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 797ed214ad..e01a7491a6 100644 --- a/Makefile +++ b/Makefile @@ -445,12 +445,16 @@ PHONY += scripts scripts: scripts_basic $(Q)$(MAKE) $(build)=$(@) +ifeq ($(dot-config),1) +include include/config/auto.conf +endif + # Objects we will link into barebox / subdirs we need to visit common-y := common/ drivers/ commands/ lib/ crypto/ net/ fs/ firmware/ -ifeq ($(dot-config),1) -include include/config/auto.conf +include $(srctree)/arch/$(ARCH)/Makefile +ifeq ($(dot-config),1) # Read in dependencies to all Kconfig* files, make sure to run syncconfig if # changes are detected. This should be included after arch/$(SRCARCH)/Makefile # because some architectures define CROSS_COMPILE there. @@ -476,8 +480,6 @@ $(KCONFIG_CONFIG): $(Q)$(MAKE) -f $(srctree)/Makefile syncconfig endif # $(dot-config) -include $(srctree)/arch/$(ARCH)/Makefile - KBUILD_CFLAGS += -ggdb3 # Force gcc to behave correct even for buggy distributions -- cgit v1.2.3