summaryrefslogtreecommitdiff
path: root/scripts/Makefile.autoconf
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/Makefile.autoconf')
-rw-r--r--scripts/Makefile.autoconf36
1 files changed, 26 insertions, 10 deletions
diff --git a/scripts/Makefile.autoconf b/scripts/Makefile.autoconf
index 58e1642fb9..f054081c98 100644
--- a/scripts/Makefile.autoconf
+++ b/scripts/Makefile.autoconf
@@ -7,9 +7,17 @@
# (= When we move all CONFIGs from header files to Kconfig)
# this makefile can be deleted.
-# obj is "include" or "spl/include" or "tpl/include"
-# for non-SPL, SPL, TPL, respectively
-include $(obj)/config/auto.conf
+__all: include/autoconf.mk include/autoconf.mk.dep
+
+ifeq ($(shell grep -q '^CONFIG_SPL=y' include/config/auto.conf 2>/dev/null && echo y),y)
+__all: spl/include/autoconf.mk
+endif
+
+ifeq ($(shell grep -q '^CONFIG_TPL=y' include/config/auto.conf 2>/dev/null && echo y),y)
+__all: tpl/include/autoconf.mk
+endif
+
+include include/config/auto.conf
include scripts/Kbuild.include
@@ -22,7 +30,6 @@ CPP = $(CC) -E
include config.mk
UBOOTINCLUDE := \
- -I$(obj) \
-Iinclude \
$(if $(KBUILD_SRC), -I$(srctree)/include) \
-I$(srctree)/arch/$(ARCH)/include \
@@ -48,10 +55,10 @@ include/autoconf.mk.dep: FORCE
# same CONFIG macros
quiet_cmd_autoconf = GEN $@
cmd_autoconf = \
- $(CPP) $(c_flags) -DDO_DEPS_ONLY -dM $(srctree)/include/common.h > $@.tmp && { \
+ $(CPP) $(c_flags) $2 -DDO_DEPS_ONLY -dM $(srctree)/include/common.h > $@.tmp && { \
sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp | \
while read line; do \
- if ! grep -q "$${line%=*}=" $(obj)/config/auto.conf; then \
+ if ! grep -q "$${line%=*}=" include/config/auto.conf; then \
echo "$$line"; \
fi \
done > $@; \
@@ -60,10 +67,19 @@ quiet_cmd_autoconf = GEN $@
rm $@.tmp; false; \
}
-$(obj)/autoconf.mk: FORCE
+include/autoconf.mk: FORCE
$(call cmd,autoconf)
-include/autoconf.mk include/autoconf.mk.dep: include/config.h
+spl/include/autoconf.mk: FORCE
+ $(Q)mkdir -p $(dir $@)
+ $(call cmd,autoconf,-DCONFIG_SPL_BUILD)
+
+tpl/include/autoconf.mk: FORCE
+ $(Q)mkdir -p $(dir $@)
+ $(call cmd,autoconf,-DCONFIG_SPL_BUILD -DCONFIG_TPL_BUILD)
+
+include/autoconf.mk include/autoconf.mk.dep \
+ spl/include/autoconf.mk tpl/include/autoconf.mk: include/config.h
# include/config.h
# Prior to Kconfig, it was generated by mkconfig. Now it is created here.
@@ -75,10 +91,10 @@ define filechk_config_h
done; \
echo \#define CONFIG_BOARDDIR board/$(if $(VENDOR),$(VENDOR)/)$(BOARD);\
echo \#include \<config_defaults.h\>; \
+ echo \#include \<config_uncmd_spl.h\>; \
echo \#include \<configs/$(CONFIG_SYS_CONFIG_NAME).h\>; \
echo \#include \<asm/config.h\>; \
- echo \#include \<config_fallbacks.h\>; \
- echo \#include \<config_uncmd_spl.h\>; )
+ echo \#include \<config_fallbacks.h\>;)
endef
include/config.h: scripts/Makefile.autoconf create_symlink FORCE