[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] tools: ovmf debug build only if tools debug is enabled



Il 31/10/2013 15:52, Fabio Fantoni ha scritto:
Il 31/10/2013 15:34, Andrew Cooper ha scritto:
On 31/10/13 14:02, Fabio Fantoni wrote:
Signed-off-by: Fabio Fantoni <fabio.fantoni@xxxxxxx>
---
  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

I already tried with this method before, but it seems that the conditional part of the makefile doesn't work inside a target. Later I changed it with the current patch (following "tools/Makefile") tested and working.
Do I need to set +x before the "if" to not print that?

I not found a working parameter to disable the print of instructions to execute, is it really needed?
If yes, how should I do it?

Thanks for any reply.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.