All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Denys Dmytriyenko" <denis@denix.org>
To: Joshua Watt <JPEWhacker@gmail.com>
Cc: meta-arm@lists.yoctoproject.org
Subject: Re: [meta-arm][PATCH v3 1/2] trusted-firmware-a: Build out of tree
Date: Wed, 13 May 2020 13:27:48 -0400	[thread overview]
Message-ID: <20200513172748.GR11927@denix.org> (raw)
In-Reply-To: <20200513154707.33747-2-JPEWhacker@gmail.com>

On Wed, May 13, 2020 at 10:47:06AM -0500, Joshua Watt wrote:
> Use the BUILD_BASE variable to specify an out-of-tree build. Eliminates
> the need to set the TFA_BUILD_DIR.
> 
> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> ---

What are the changes between v1, v2 and v3?


>  .../trusted-firmware-a/trusted-firmware-a.inc | 32 +++++++++++--------
>  1 file changed, 18 insertions(+), 14 deletions(-)
> 
> diff --git a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc
> index e6d48e4..febd8ce 100644
> --- a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc
> +++ b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc
> @@ -15,12 +15,7 @@ TFA_PLATFORM ?= "invalid"
>  # Build for debug (set TFA_DEBUG to 1 to activate)
>  TFA_DEBUG ?= "0"
>  
> -# Sub-directory in which to build.
> -# This must be coherent with BUILD_PLAT make parameter so that deploy can find
> -# the produced binaries
> -TFA_BUILD_DIR ?= "build-${TFA_PLATFORM}"
> -# set BUILD_PLAT depending on configured BUILD_DIR
> -EXTRA_OEMAKE += "BUILD_PLAT=${TFA_BUILD_DIR}"
> +B = "${WORKDIR}/build"
>  
>  # mbed TLS support (set TFA_MBEDTLS to 1 to activate)
>  TFA_MBEDTLS ?= "0"
> @@ -68,7 +63,7 @@ do_configure[noexec] = "1"
>  DEPENDS_append = " dtc-native openssl-native"
>  
>  # Add platform parameter
> -EXTRA_OEMAKE += "PLAT=${TFA_PLATFORM}"
> +EXTRA_OEMAKE += "BUILD_BASE=${B} PLAT=${TFA_PLATFORM}"
>  
>  # Handle TFA_DEBUG parameter
>  EXTRA_OEMAKE += "${@bb.utils.contains('TFA_DEBUG', '1', ' DEBUG=${TFA_DEBUG}', '', d)}"
> @@ -85,6 +80,8 @@ EXTRA_OEMAKE += "${@bb.utils.contains('TFA_UBOOT', '1', ' BL33=${DEPLOY_DIR_IMAG
>  # TFA is forcing the host compiler and its flags in the Makefile using :=
>  # assignment for GCC and CFLAGS.
>  do_compile() {
> +    cd ${S}
> +
>      # These changes are needed to have the fiptool compiling and executing properly
>      sed -i '/^LDLIBS/ s,$, \-L${RECIPE_SYSROOT_NATIVE}${libdir},' ${S}/tools/fiptool/Makefile
>      sed -i '/^INCLUDE_PATHS/ s,$, \-I${RECIPE_SYSROOT_NATIVE}${includedir},' ${S}/tools/fiptool/Makefile
> @@ -92,8 +89,15 @@ do_compile() {
>  
>      oe_runmake ${TFA_BUILD_TARGET}
>  }
> +do_compile[cleandirs] = "${B}"
>  
>  do_install() {
> +    if ${@"true" if d.getVar('TFA_DEBUG') == '1' else "false"}; then
> +        BUILD_PLAT=${B}/${TFA_PLATFORM}/debug/
> +    else
> +        BUILD_PLAT=${B}/${TFA_PLATFORM}/release/
> +    fi
> +
>      install -d -m 755 ${D}/firmware
>      for atfbin in ${TFA_INSTALL_TARGET}; do
>          if [ "$atfbin" = "all" ]; then
> @@ -102,21 +106,21 @@ do_install() {
>              bberror "Please specify valid targets in TFA_INSTALL_TARGET or"
>              bberror "rewrite or turn off do_install"
>              exit 1
> -        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin.bin ]; then
> +        elif [ -f $BUILD_PLAT/$atfbin.bin ]; then
>              echo "Install $atfbin.bin"
> -            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin.bin \
> +            install -m 0644 $BUILD_PLAT/$atfbin.bin \
>                  ${D}/firmware/$atfbin-${TFA_PLATFORM}.bin
> -        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin.elf ]; then
> +        elif [ -f $BUILD_PLAT/$atfbin.elf ]; then
>              echo "Install $atfbin.elf"
> -            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin.elf \
> +            install -m 0644 $BUILD_PLAT/$atfbin.elf \
>                  ${D}/firmware/$atfbin-${TFA_PLATFORM}.elf
> -        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin ]; then
> +        elif [ -f $BUILD_PLAT/$atfbin ]; then
>              echo "Install $atfbin"
> -            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin \
> +            install -m 0644 $BUILD_PLAT/$atfbin \
>                  ${D}/firmware/$atfbin-${TFA_PLATFORM}
>          elif [ "$atfbin" = "dtbs" ]; then
>              echo "dtbs install, skipped"
> -        elif [ -f ${S}/tools/$atfbin/$atfbin ]; then
> +        elif [ -f ${B}/tools/$atfbin/$atfbin ]; then
>              echo "Tools $atfbin install, skipped"
>          else
>              bberror "Unsupported TFA_INSTALL_TARGET target $atfbin"
> -- 
> 2.17.1
> 

> 


  parent reply	other threads:[~2020-05-13 17:27 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-11 14:26 [meta-arm][PATCH 0/3] TF-A improvements Joshua Watt
2020-05-11 14:26 ` [meta-arm][PATCH 1/3] trusted-firmware-a: Build out of tree Joshua Watt
2020-05-11 17:53   ` Denys Dmytriyenko
2020-05-11 14:26 ` [meta-arm][PATCH 2/3] trusted-firmware-a: Install .elf file from subdirectory Joshua Watt
2020-05-11 17:45   ` Denys Dmytriyenko
2020-05-11 14:26 ` [meta-arm][PATCH 3/3] trusted-firmware-a: Add recipe for version 2.3 Joshua Watt
2020-05-11 17:41   ` Denys Dmytriyenko
2020-05-12  0:24   ` Jon Mason
2020-05-12  0:28     ` Denys Dmytriyenko
2020-05-12 21:12 ` [meta-arm][PATCH v2 0/2] TF-A Improvements Joshua Watt
2020-05-12 21:12   ` [meta-arm][PATCH v2 1/2] trusted-firmware-a: Build out of tree Joshua Watt
2020-05-12 21:22     ` Ross Burton
2020-05-13  6:36       ` Diego Sueiro
2020-05-13 13:41         ` Ross Burton
2020-05-13  6:22     ` Diego Sueiro
2020-05-12 21:12   ` [meta-arm][PATCH v2 2/2] trusted-firmware-a: Install .elf file from subdirectory Joshua Watt
2020-05-13 17:31     ` Denys Dmytriyenko
2020-05-13 15:47 ` [meta-arm][PATCH v3 0/2] TF-A Improvement Joshua Watt
2020-05-13 15:47   ` [meta-arm][PATCH v3 1/2] trusted-firmware-a: Build out of tree Joshua Watt
2020-05-13 16:19     ` Diego Sueiro
2020-05-13 17:27     ` Denys Dmytriyenko [this message]
2020-05-13 17:57       ` Joshua Watt
     [not found]     ` <160EA693C79E8869.18093@lists.yoctoproject.org>
2020-05-13 17:37       ` Denys Dmytriyenko
2020-05-13 21:49         ` Jon Mason
2020-05-13 15:47   ` [meta-arm][PATCH v3 2/2] trusted-firmware-a: Install .elf file from subdirectory Joshua Watt
2020-05-13 16:19     ` Diego Sueiro
2020-05-13 17:33     ` Denys Dmytriyenko
2020-05-13 17:54       ` Joshua Watt
2020-05-13 21:50         ` Jon Mason

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=20200513172748.GR11927@denix.org \
    --to=denis@denix.org \
    --cc=JPEWhacker@gmail.com \
    --cc=meta-arm@lists.yoctoproject.org \
    /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.