kbuild: move include directives of board configuration files
This commit changes the location of include directives
of board configuration files.
The purpose of this change is:
- Slim down $(TOPDIR)/config.mk
- Prevent $(TOPDIR)/Makefile from including the same
configuration file twice
- Do not include include/config.mk multiple times
because ARCH, CPU, BOARD, VENDOR, SOC are exported
Before this commit:
- include/autoconf.mk was included from $(TOPDIR)/Makefile
and $(TOPDIR)/config.mk
(This means $(TOPDIR)/Makefile included include/autoconf.mk twice)
- include/{spl,tpl}-autoconf.mk was included from $(TOPDIR)/config.mk
- include/config.mk was included from $(TOPDIR)/Makefile
and $(TOPDIR)/config.mk
(This means $(TOPDIR)/Makefile included include/config.mk twice)
After this commit:
- include/autoconf.mk is included from $(TOPDIR)/Makefile
and $(TOPDIR)/scripts/Makefile.build
- include/{spl,tpl}-autoconf.mk is included from $(TOPDIR)/spl/Makefile
and $(TOPDIR)/scripts/Makefile.build
- include/config.mk is included from $(TOPDIR)/config.mk and
$(TOPDIR)/spl/Makefile
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
diff --git a/spl/Makefile b/spl/Makefile
index 6b985d1..13612d3 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -40,6 +40,14 @@
SPL_BIN := u-boot-spl
endif
+include include/config.mk
+
+ifeq ($(CONFIG_TPL_BUILD),y)
+ -include include/tpl-autoconf.mk
+else
+ -include include/spl-autoconf.mk
+endif
+
include $(TOPDIR)/config.mk
HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(SRCTREE)/board/$(VENDOR)/common/Makefile),y,n)