U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.m@jp.panasonic.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] kbuild: allow empty board directories
Date: Mon,  3 Mar 2014 19:03:17 +0900	[thread overview]
Message-ID: <1393840998-27018-2-git-send-email-yamada.m@jp.panasonic.com> (raw)
In-Reply-To: <1393840998-27018-1-git-send-email-yamada.m@jp.panasonic.com>

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 <yamada.m@jp.panasonic.com>
---

 Makefile  | 2 +-
 config.mk | 2 ++
 mkconfig  | 6 ++++--
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index ea4a362..1e55be1 100644
--- a/Makefile
+++ b/Makefile
@@ -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))
 
diff --git a/config.mk b/config.mk
index bb3da0d..4657577 100644
--- a/config.mk
+++ b/config.mk
@@ -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
diff --git a/mkconfig b/mkconfig
index 5f516f2..9827e4d 100755
--- a/mkconfig
+++ b/mkconfig
@@ -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>
-- 
1.8.3.2

  reply	other threads:[~2014-03-03 10:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-03 10:03 [U-Boot] [PATCH 0/2] Allow empty board dir and fix build error of arcangel4 boards Masahiro Yamada
2014-03-03 10:03 ` Masahiro Yamada [this message]
2014-03-04 19:19   ` [U-Boot] [U-Boot,1/2] kbuild: allow empty board directories Tom Rini
2014-03-03 10:03 ` [U-Boot] [PATCH 2/2] arc: arcangel4: set board entry <none> to fix a build error Masahiro Yamada
2014-03-04 19:19   ` [U-Boot] [U-Boot, " Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1393840998-27018-2-git-send-email-yamada.m@jp.panasonic.com \
    --to=yamada.m@jp.panasonic.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox