Skip to contentSkip to conversation

Allow empty board dir and fix build error of arcangel4 boards

PATCH New Masahiro Yamada 2 participants 5 messages Mar 3, 2014 – Mar 4, 2014 Kbuild

lore
Share & tools
lore
#0 lore raw

cover Allow empty board dir and fix build error of arcangel4 boards

Currently arcangel4 and arcangel4-be boards are broken.

  $ make CROSS_COMPILE=arc-buildroot-linux-uclibc- arcangel4_config all
  Configuring for arcangel4 board...
    GEN     include/autoconf.mk.dep
    GEN     include/autoconf.mk
    CHK     include/config/uboot.release
    [snip]
    LDS     u-boot.lds
    LD      u-boot
  arc-buildroot-linux-uclibc-ld.bfd: cannot find board/synopsys/arcangel4/built-in.o: No such file or directory
  make[1]: *** [u-boot] Error 1
  make: *** [build-one-by-one] Error 2

The cause of the build error is that neither "obj-y" nor "obj-" is defined in board/synopsys/arcangel4/Makefile.
In kbuild, empty makefiles are not allowed.

The same sort of build errors have happened before this. Commit 2aa43f70 resolved the build error by adding "obj- := __dummy__.o",
but it was not the best solution.

If there are no source files to compile under the board directory, it is better to not descend into that directory.

Masahiro Yamada (2):
kbuild: allow empty board directories
arc: arcangel4: set board entry <none> to fix a build error

 Makefile                          |  2 +-
 board/synopsys/arcangel4/Makefile | 11 -----------
 boards.cfg                        |  4 ++--
 config.mk                         |  2 ++
 mkconfig                          |  6 ++++--
 5 files changed, 9 insertions(+), 16 deletions(-)
 delete mode 100644 board/synopsys/arcangel4/Makefile
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH 1/2 kbuild: allow empty board directories

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.

---

 Makefile  | 2 +-
 config.mk | 2 ++
 mkconfig  | 6 ++++--
 3 files changed, 7 insertions(+), 3 deletions(-)
Makefile +1 -1
index ea4a362..1e55be1 100644
@@ -634,7 +634,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))
 
config.mk +2 -0
index bb3da0d..4657577 100644
@@ -35,11 +35,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
mkconfig +4 -2
index 5f516f2..9827e4d 100755
@@ -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"
@@ -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>
Signature · 1 line
1.8.3.2
#2 lore raw

PATCH 1/2 kbuild: allow empty board directories

Quoted 6 lines · Masahiro Yamada

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?)

Quoted 8 lines

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.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140304/fd41df78/attachment.pgp>
#3 lore raw

PATCH 2/2 arc: arcangel4: set board entry <none> to fix a build error

In reply to Masahiro Yamada

There are no source files in board/synopsys/arcangel4/ directory.

---

 board/synopsys/arcangel4/Makefile | 11 -----------
 boards.cfg                        |  4 ++--
 2 files changed, 2 insertions(+), 13 deletions(-)
 delete mode 100644 board/synopsys/arcangel4/Makefile
board/synopsys/arcangel4/Makefile deleted +0 -11
deleted file mode 100644
index 575e58f..0000000
@@ -1,11 +0,0 @@
-#
-# Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
-#
-# SPDX-License-Identifier:	GPL-2.0+
-#
-
-# This board is mostly used for debugging U-Boot in simulation (ISS).
-# The only peripheral which is used on this board is a serial port which
-# requires no initialization except those in "include/configs/arcangel4.h".
-# And now there's no specific initializations for this board.
-# So this Makefile is only required for satisfaction of U-Boot build system.
boards.cfg +2 -2
index de32293..ee633b7 100644
@@ -44,9 +44,9 @@
 ###########################################################################################################
 
 Active  aarch64     armv8          -           armltd          vexpress64          vexpress_aemv8a                      vexpress_aemv8a:ARM64                                                                                                             David Feng <[email protected]>
-Active  arc         arc700         -           synopsys        -                   arcangel4                            -                                                                                                                                 Alexey Brodkin <[email protected]>
+Active  arc         arc700         -           synopsys        <none>              arcangel4                            -                                                                                                                                 Alexey Brodkin <[email protected]>
 Active  arc         arc700         -           synopsys        -                   axs101                               -                                                                                                                                 Alexey Brodkin <[email protected]>
-Active  arc         arc700         -           synopsys        arcangel4           arcangel4-be                         -                                                                                                                                 Alexey Brodkin <[email protected]>
+Active  arc         arc700         -           synopsys        <none>              arcangel4-be                         -                                                                                                                                 Alexey Brodkin <[email protected]>
 Active  arm         arm1136        -           armltd          integrator          integratorcp_cm1136                  integratorcp:CM1136                                                                                                               Linus Walleij <[email protected]>
 Active  arm         arm1136        mx31        -               -                   imx31_phycore                        -                                                                                                                                 -
 Active  arm         arm1136        mx31        davedenx        -                   qong                                 -                                                                                                                                 Wolfgang Denk <[email protected]>
Signature · 1 line
1.8.3.2
#4 lore raw

PATCH 2/2 arc: arcangel4: set board entry <none> to fix a build error

Quoted 5 lines · Masahiro Yamada

There are no source files in board/synopsys/arcangel4/ directory.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140304/61f2db44/attachment.pgp>