Skip to content

Commit

Permalink
kbuild: allow empty board directories
Browse files Browse the repository at this point in the history
U-Boot has compelled all boards to have
board/${BOARD}/ or board/${VENDOR}/${BOARD}/ directory.

Sometimes it does not seem suitable for some boards,
for example Sandbox. (Is it a board?)

And arcangel4 board has nothing to compile
under the board directory.

This commit makes the build system more flexible:
If '<none>' is given to the 6th column (=Board name) of boards.cfg,
Kbuild will not descend into the board directory.

Signed-off-by: Masahiro Yamada <[email protected]>
  • Loading branch information
masahir0y authored and trini committed Mar 4, 2014
1 parent 603f51c commit 33a02da
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ endif
libs-$(CONFIG_ARM) += arch/arm/cpu/
libs-$(CONFIG_PPC) += arch/powerpc/cpu/

libs-y += board/$(BOARDDIR)/
libs-y += $(if $(BOARDDIR),board/$(BOARDDIR)/)

libs-y := $(sort $(libs-y))

Expand Down
2 changes: 2 additions & 0 deletions config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ sinclude $(TOPDIR)/$(CPUDIR)/config.mk # include CPU specific rules
ifdef SOC
sinclude $(TOPDIR)/$(CPUDIR)/$(SOC)/config.mk # include SoC specific rules
endif
ifneq ($(BOARD),)
ifdef VENDOR
BOARDDIR = $(VENDOR)/$(BOARD)
else
BOARDDIR = $(BOARD)
endif
endif
ifdef BOARD
sinclude $(TOPDIR)/board/$(BOARDDIR)/config.mk # include board specific rules
endif
Expand Down
6 changes: 4 additions & 2 deletions mkconfig
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ CONFIG_NAME="${7%_config}"
arch="$2"
cpu=`echo $3 | awk 'BEGIN {FS = ":"} ; {print $1}'`
spl_cpu=`echo $3 | awk 'BEGIN {FS = ":"} ; {print $2}'`
if [ "$6" = "-" ] ; then
if [ "$6" = "<none>" ] ; then
board=
elif [ "$6" = "-" ] ; then
board=${BOARD_NAME}
else
board="$6"
Expand Down Expand Up @@ -177,8 +179,8 @@ echo "#define CONFIG_SYS_BOARD \"${board}\"" >> config.h

[ "${soc}" ] && echo "#define CONFIG_SYS_SOC \"${soc}\"" >> config.h

[ "${board}" ] && echo "#define CONFIG_BOARDDIR board/$BOARDDIR" >> config.h
cat << EOF >> config.h
#define CONFIG_BOARDDIR board/$BOARDDIR
#include <config_cmd_defaults.h>
#include <config_defaults.h>
#include <configs/${CONFIG_NAME}.h>
Expand Down

0 comments on commit 33a02da

Please sign in to comment.