Skip to content

Commit

Permalink
kbuild: move include directives of board configuration files
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
masahir0y authored and trini committed Feb 19, 2014
1 parent 47f1571 commit 01072b4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
15 changes: 0 additions & 15 deletions config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,6 @@ PLATFORM_LDFLAGS =

#########################################################################

# Load generated board configuration
ifeq ($(CONFIG_TPL_BUILD),y)
# Include TPL autoconf
sinclude include/tpl-autoconf.mk
else
ifeq ($(CONFIG_SPL_BUILD),y)
# Include SPL autoconf
sinclude include/spl-autoconf.mk
else
# Include normal autoconf
sinclude include/autoconf.mk
endif
endif
sinclude $(OBJTREE)/include/config.mk

# Some architecture config.mk files need to know what CPUDIR is set to,
# so calculate CPUDIR before including ARCH/SOC/CPU config.mk files.
# Check if arch/$ARCH/cpu/$CPU exists, otherwise assume arch/$ARCH/cpu contains
Expand Down
11 changes: 11 additions & 0 deletions scripts/Makefile.build
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@ subdir-ccflags-y :=
# Read auto.conf if it exists, otherwise ignore
-include include/config/auto.conf

# Added for U-Boot: Load U-Boot configuration
ifeq ($(CONFIG_TPL_BUILD),y)
-include include/tpl-autoconf.mk
else
ifeq ($(CONFIG_SPL_BUILD),y)
-include include/spl-autoconf.mk
else
-include include/autoconf.mk
endif
endif

include scripts/Kbuild.include

# Added for U-Boot
Expand Down
8 changes: 8 additions & 0 deletions spl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ else
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)
Expand Down

0 comments on commit 01072b4

Please sign in to comment.