diff mbox

Makefile: Fix broken build

Message ID 1316202643-29867-1-git-send-email-weil@mail.berlios.de
State Accepted
Headers show

Commit Message

Stefan Weil Sept. 16, 2011, 7:50 p.m. UTC
make -C mybuilddir no longer works (regression caused by commit)
388d475815c23901010a25c845eb078d47ee0740.

PWD is the directory of the caller (not mybuilddir),
so BUILD_DIR is set to the wrong value.

GNU make sets CURDIR to the correct value.
Use this macro instead of PWD.

Cc: Lluís Vilanova <vilanova@ac.upc.edu>
Cc: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
 Makefile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Comments

Blue Swirl Sept. 17, 2011, 6:48 p.m. UTC | #1
Thanks, applied.

On Fri, Sep 16, 2011 at 7:50 PM, Stefan Weil <weil@mail.berlios.de> wrote:
> make -C mybuilddir no longer works (regression caused by commit)
> 388d475815c23901010a25c845eb078d47ee0740.
>
> PWD is the directory of the caller (not mybuilddir),
> so BUILD_DIR is set to the wrong value.
>
> GNU make sets CURDIR to the correct value.
> Use this macro instead of PWD.
>
> Cc: Lluís Vilanova <vilanova@ac.upc.edu>
> Cc: Anthony Liguori <aliguori@us.ibm.com>
> Signed-off-by: Stefan Weil <weil@mail.berlios.de>
> ---
>  Makefile |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 57cc399..a211158 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1,7 +1,7 @@
>  # Makefile for QEMU.
>
> -# Always point to the root of the build tree
> -BUILD_DIR=$(PWD)
> +# Always point to the root of the build tree (needs GNU make).
> +BUILD_DIR=$(CURDIR)
>
>  GENERATED_HEADERS = config-host.h trace.h qemu-options.def
>  ifeq ($(TRACE_BACKEND),dtrace)
> --
> 1.7.2.5
>
>
>
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 57cc399..a211158 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@ 
 # Makefile for QEMU.
 
-# Always point to the root of the build tree
-BUILD_DIR=$(PWD)
+# Always point to the root of the build tree (needs GNU make).
+BUILD_DIR=$(CURDIR)
 
 GENERATED_HEADERS = config-host.h trace.h qemu-options.def
 ifeq ($(TRACE_BACKEND),dtrace)