xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Fabio Fantoni <fabio.fantoni@m2r.biz>
Cc: Ian.Jackson@eu.citrix.com, xen-devel@lists.xensource.com,
	wei.liu2@citrix.com, Ian.Campbell@citrix.com
Subject: Re: [PATCH] tools: ovmf debug build only if tools debug is enabled
Date: Thu, 31 Oct 2013 14:34:11 +0000	[thread overview]
Message-ID: <52726A63.3060709@citrix.com> (raw)
In-Reply-To: <1383228171-5132-1-git-send-email-fabio.fantoni@m2r.biz>

On 31/10/13 14:02, Fabio Fantoni wrote:
> Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
> ---
>  tools/firmware/ovmf-makefile |   13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/tools/firmware/ovmf-makefile b/tools/firmware/ovmf-makefile
> index 073ed44..efb4fb1 100644
> --- a/tools/firmware/ovmf-makefile
> +++ b/tools/firmware/ovmf-makefile
> @@ -1,3 +1,6 @@
> +XEN_ROOT = $(CURDIR)/../../..
> +include $(XEN_ROOT)/tools/Rules.mk
> +
>  # OVMF building system is not ready yet to run in parallel.
>  # Force it to be serial in order to exploit parallelism for neighbors.
>  
> @@ -9,8 +12,14 @@ all: ovmf.bin
>  
>  .PHONY: ovmf.bin

I know this is not your bad code, but this rule creates a file called
ovmf.bin, so is very explicitly not a .PHONY rule

>  ovmf.bin:
> -	OvmfPkg/build.sh -a X64
> -	cp Build/OvmfX64/DEBUG_GCC*/FV/OVMF.fd ovmf.bin
> +	if [ "$(debug)" == y ]; then \
> +		OvmfPkg/build.sh -a X64; \
> +		cp Build/OvmfX64/DEBUG_GCC*/FV/OVMF.fd ovmf.bin; \
> +	else \
> +		OvmfPkg/build.sh -a X64 -b RELEASE; \
> +		cp Build/OvmfX64/RELEASE_GCC*/FV/OVMF.fd ovmf.bin; \
> +	fi
> +

This is rather ugly, and will add yet more spew into the logs (which is
in need of some pruning anyway).  In this case the entire if statement
will be printed, including both branches, before being executed.

The more "make" way of doing it would be something like:

ovmf.bin:
ifeq ($(debug),y)
        OvmfPkg/build.sh -a X64
        cp Build/OvmfX64/DEBUG_GCC*/FV/OVMF.fd $@
else
        OvmfPkg/build.sh -a X64 -b RELEASE
        cp Build/OvmfX64/RELEASE_GCC*/FV/OVMF.fd $@
endif

~Andrew

  parent reply	other threads:[~2013-10-31 14:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-31 14:02 [PATCH] tools: ovmf debug build only if tools debug is enabled Fabio Fantoni
2013-10-31 14:23 ` Wei Liu
2013-10-31 14:56   ` Fabio Fantoni
2013-10-31 14:34 ` Andrew Cooper [this message]
2013-10-31 14:52   ` Fabio Fantoni
2013-12-04 14:47     ` Fabio Fantoni
2013-12-04 16:23       ` Wei Liu
2013-12-05  9:00         ` Fabio Fantoni

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=52726A63.3060709@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=fabio.fantoni@m2r.biz \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /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;
as well as URLs for NNTP newsgroup(s).