All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCHv4 17/18] packages: refactor checks using BR_BUILDING
Date: Sun, 26 Apr 2015 17:31:58 +0200	[thread overview]
Message-ID: <20150426153158.GF4809@free.fr> (raw)
In-Reply-To: <1430041876-16436-18-git-send-email-thomas.petazzoni@free-electrons.com>

Thomas, All,

On 2015-04-26 11:51 +0200, Thomas Petazzoni spake thusly:
> Instead of manually testing MAKECMDGOALS, use the newly introduced
> BR_BUILDING variable to know if we're building or not.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
[tested with a randpackageconfig + xloader enabled without a board name
set]

Regards,
Yann E. MORIN.

> ---
>  boot/at91bootstrap/at91bootstrap.mk   |  5 +----
>  boot/at91bootstrap3/at91bootstrap3.mk |  2 +-
>  boot/barebox/barebox.mk               |  5 +----
>  boot/uboot/uboot.mk                   | 13 ++++---------
>  boot/xloader/xloader.mk               |  6 +-----
>  linux/linux.mk                        |  2 +-
>  package/sunxi-boards/sunxi-boards.mk  |  4 +---
>  7 files changed, 10 insertions(+), 27 deletions(-)
> 
> diff --git a/boot/at91bootstrap/at91bootstrap.mk b/boot/at91bootstrap/at91bootstrap.mk
> index 802e85e..f655058 100644
> --- a/boot/at91bootstrap/at91bootstrap.mk
> +++ b/boot/at91bootstrap/at91bootstrap.mk
> @@ -40,11 +40,8 @@ endef
>  
>  $(eval $(generic-package))
>  
> -ifeq ($(BR2_TARGET_AT91BOOTSTRAP),y)
> -# we NEED a board name unless we're at make source
> -ifeq ($(filter source,$(MAKECMDGOALS)),)
> +ifeq ($(BR2_TARGET_AT91BOOTSTRAP)$(BR_BUILDING),yy)
>  ifeq ($(AT91BOOTSTRAP_BOARD),)
>  $(error No AT91Bootstrap board name set. Check your BR2_TARGET_AT91BOOTSTRAP_BOARD setting)
>  endif
>  endif
> -endif
> diff --git a/boot/at91bootstrap3/at91bootstrap3.mk b/boot/at91bootstrap3/at91bootstrap3.mk
> index 3e3b78e..ff49e14 100644
> --- a/boot/at91bootstrap3/at91bootstrap3.mk
> +++ b/boot/at91bootstrap3/at91bootstrap3.mk
> @@ -43,7 +43,7 @@ AT91BOOTSTRAP3_KCONFIG_OPTS = $(AT91BOOTSTRAP3_MAKE_OPTS)
>  $(eval $(kconfig-package))
>  
>  # Checks to give errors that the user can understand
> -ifeq ($(filter source,$(MAKECMDGOALS)),)
> +ifeq ($(BR_BUILDING),y)
>  ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_DEFCONFIG),y)
>  ifeq ($(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG)),)
>  $(error No at91bootstrap3 defconfig name specified, check your BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG setting)
> diff --git a/boot/barebox/barebox.mk b/boot/barebox/barebox.mk
> index 98cb04e..54f52bb 100644
> --- a/boot/barebox/barebox.mk
> +++ b/boot/barebox/barebox.mk
> @@ -106,11 +106,8 @@ endif
>  
>  $(eval $(kconfig-package))
>  
> -ifeq ($(BR2_TARGET_BAREBOX),y)
> -# we NEED a board defconfig file unless we're at make source
> -ifeq ($(filter source,$(MAKECMDGOALS)),)
> +ifeq ($(BR2_TARGET_BAREBOX)$(BR_BUILDING),yy)
>  ifeq ($(BAREBOX_SOURCE_CONFIG),)
>  $(error No Barebox config file. Check your BR2_TARGET_BAREBOX_BOARD_DEFCONFIG or BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE settings)
>  endif
>  endif
> -endif
> diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
> index 1526177..01aaf2c 100644
> --- a/boot/uboot/uboot.mk
> +++ b/boot/uboot/uboot.mk
> @@ -164,8 +164,7 @@ define UBOOT_INSTALL_OMAP_IFT_IMAGE
>  endef
>  
>  ifeq ($(BR2_TARGET_UBOOT_OMAP_IFT),y)
> -# we NEED a config file unless we're at make source
> -ifeq ($(filter source,$(MAKECMDGOALS)),)
> +ifeq ($(BR_BUILDING),y)
>  ifeq ($(call qstrip,$(BR2_TARGET_UBOOT_OMAP_IFT_CONFIG)),)
>  $(error No gpsign config file. Check your BR2_TARGET_UBOOT_OMAP_IFT_CONFIG setting)
>  endif
> @@ -179,8 +178,7 @@ UBOOT_POST_INSTALL_IMAGES_HOOKS += UBOOT_INSTALL_OMAP_IFT_IMAGE
>  endif
>  
>  ifeq ($(BR2_TARGET_UBOOT_ENVIMAGE),y)
> -# we NEED a environment settings unless we're at make source
> -ifeq ($(filter source,$(MAKECMDGOALS)),)
> +ifeq ($(BR_BUILDING),y)
>  ifeq ($(call qstrip,$(BR2_TARGET_UBOOT_ENVIMAGE_SOURCE)),)
>  $(error Please define a source file for Uboot environment (BR2_TARGET_UBOOT_ENVIMAGE_SOURCE setting))
>  endif
> @@ -193,9 +191,7 @@ endif
>  
>  $(eval $(generic-package))
>  
> -ifeq ($(BR2_TARGET_UBOOT),y)
> -# we NEED a board name unless we're at make source
> -ifeq ($(filter source,$(MAKECMDGOALS)),)
> +ifeq ($(BR2_TARGET_UBOOT)$(BR_BUILDING),yy)
>  ifeq ($(UBOOT_BOARD_NAME),)
>  $(error No U-Boot board name set. Check your BR2_TARGET_UBOOT_BOARDNAME setting)
>  endif
> @@ -221,5 +217,4 @@ $(error No custom U-Boot repository URL specified. Check your BR2_TARGET_UBOOT_C
>  endif # qstrip BR2_TARGET_UBOOT_CUSTOM_CUSTOM_REPO_VERSION
>  endif # BR2_TARGET_UBOOT_CUSTOM_GIT || BR2_TARGET_UBOOT_CUSTOM_HG
>  
> -endif # filter source
> -endif # BR2_TARGET_UBOOT
> +endif # BR2_TARGET_UBOOT && BR_BUILDING
> diff --git a/boot/xloader/xloader.mk b/boot/xloader/xloader.mk
> index 90d5fa2..c68dc81 100644
> --- a/boot/xloader/xloader.mk
> +++ b/boot/xloader/xloader.mk
> @@ -25,12 +25,8 @@ endef
>  
>  $(eval $(generic-package))
>  
> -ifeq ($(BR2_TARGET_XLOADER),y)
> -# we NEED a board name unless we're at make source
> -ifeq ($(filter source,$(MAKECMDGOALS)),)
> +ifeq ($(BR2_TARGET_XLOADER)$(BR_BUILDING),yy)
>  ifeq ($(XLOADER_BOARD_NAME),)
>  $(error NO x-loader board name set. Check your BR2_BOOT_XLOADER_BOARDNAME setting)
>  endif
>  endif
> -
> -endif
> diff --git a/linux/linux.mk b/linux/linux.mk
> index deed073..0c348da 100644
> --- a/linux/linux.mk
> +++ b/linux/linux.mk
> @@ -354,7 +354,7 @@ $(LINUX_DIR)/.stamp_initramfs_rebuilt: $(LINUX_DIR)/.stamp_target_installed $(LI
>  linux-rebuild-with-initramfs: $(LINUX_DIR)/.stamp_initramfs_rebuilt
>  
>  # Checks to give errors that the user can understand
> -ifeq ($(filter source,$(MAKECMDGOALS)),)
> +ifeq ($(BR_BUILDING),y)
>  ifeq ($(BR2_LINUX_KERNEL_USE_DEFCONFIG),y)
>  ifeq ($(call qstrip,$(BR2_LINUX_KERNEL_DEFCONFIG)),)
>  $(error No kernel defconfig name specified, check your BR2_LINUX_KERNEL_DEFCONFIG setting)
> diff --git a/package/sunxi-boards/sunxi-boards.mk b/package/sunxi-boards/sunxi-boards.mk
> index 1a2bb4c..cacf824 100644
> --- a/package/sunxi-boards/sunxi-boards.mk
> +++ b/package/sunxi-boards/sunxi-boards.mk
> @@ -16,13 +16,11 @@ define SUNXI_BOARDS_INSTALL_IMAGES_CMDS
>  		$(BINARIES_DIR)/script.bin
>  endef
>  
> -ifeq ($(BR2_PACKAGE_SUNXI_BOARDS),y)
> +ifeq ($(BR2_PACKAGE_SUNXI_BOARDS)$(BR_BUILDING),yy)
>  # we NEED a board name
> -ifeq ($(filter source,$(MAKECMDGOALS)),)
>  ifeq ($(SUNXI_BOARDS_FEX_FILE),)
>  $(error No sunxi .fex file specified. Check your BR2_PACKAGE_SUNXI_BOARDS_FEX_FILE settings)
>  endif
>  endif
> -endif
>  
>  $(eval $(generic-package))
> -- 
> 2.1.0
> 

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

  reply	other threads:[~2015-04-26 15:31 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-26  9:50 [Buildroot] [PATCHv4 00/18] Package based 'source', 'legal-info', 'source-check' and 'external-deps' Thomas Petazzoni
2015-04-26  9:50 ` [Buildroot] [PATCHv4 01/18] fs: only add non rootfs- targets to PACKAGES Thomas Petazzoni
2015-04-26 10:16   ` Thomas Petazzoni
2015-04-26  9:51 ` [Buildroot] [PATCHv4 02/18] pkg-generic: take into account patch dependencies in source, external-deps and legal-info Thomas Petazzoni
2015-04-26 15:15   ` Yann E. MORIN
2015-04-26  9:51 ` [Buildroot] [PATCHv4 03/18] Makefile: use the package infra based external-deps Thomas Petazzoni
2015-04-26  9:51 ` [Buildroot] [PATCHv4 04/18] pkg-download: remove support for the SHOW_EXTERNAL_DEPS DL_MODE Thomas Petazzoni
2015-04-26  9:51 ` [Buildroot] [PATCHv4 05/18] Makefile: move source-check outside of noconfig_targets Thomas Petazzoni
2015-04-26  9:51 ` [Buildroot] [PATCHv4 06/18] pkg-download: extend DOWNLOAD_INNER, add a SOURCE_CHECK macro Thomas Petazzoni
2015-04-26  9:51 ` [Buildroot] [PATCHv4 07/18] pkg-generic: implement source-check targets Thomas Petazzoni
2015-04-26 15:20   ` Yann E. MORIN
2015-04-26 20:22     ` Thomas Petazzoni
2015-04-26  9:51 ` [Buildroot] [PATCHv4 08/18] Makefile: implement a package based source-check target Thomas Petazzoni
2015-04-26  9:51 ` [Buildroot] [PATCHv4 09/18] pkg-generic: remove the .stamp_rsync_sourced fake stamp file Thomas Petazzoni
2015-04-26  9:51 ` [Buildroot] [PATCHv4 10/18] pkg-generic: don't use DL_MODE in .stamp_downloaded Thomas Petazzoni
2015-04-26  9:51 ` [Buildroot] [PATCHv4 11/18] pkg-download: get rid of DL_MODE Thomas Petazzoni
2015-04-26  9:51 ` [Buildroot] [PATCHv4 12/18] pkg-download: fix indentation for SOURCE_CHECK_* macros Thomas Petazzoni
2015-04-26  9:51 ` [Buildroot] [PATCHv4 13/18] pkg-generic: introduce a <pkg>_ALL_DOWNLOADS variable and factorize code Thomas Petazzoni
2015-04-26  9:51 ` [Buildroot] [PATCHv4 14/18] Makefile: implement the 'source' target using the package infrastructure Thomas Petazzoni
2015-04-26  9:51 ` [Buildroot] [PATCHv4 15/18] Makefile: remove unneeded variables Thomas Petazzoni
2015-04-26  9:51 ` [Buildroot] [PATCHv4 16/18] Makefile: add BR_BUILDING variable Thomas Petazzoni
2015-04-26  9:51 ` [Buildroot] [PATCHv4 17/18] packages: refactor checks using BR_BUILDING Thomas Petazzoni
2015-04-26 15:31   ` Yann E. MORIN [this message]
2015-04-26  9:51 ` [Buildroot] [PATCHv4 18/18] Makefile: add a few more targets to nobuild_targets Thomas Petazzoni
2015-04-26 15:40   ` Yann E. MORIN
2015-04-26 20:23     ` Thomas Petazzoni
2015-04-26 20:23 ` [Buildroot] [PATCHv4 00/18] Package based 'source', 'legal-info', 'source-check' and 'external-deps' Thomas Petazzoni

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=20150426153158.GF4809@free.fr \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.