Skip to contentSkip to conversation

Makefile: Fix broken build

PATCH Applied Stefan Weil 2 participants 2 messages Sep 16, 2011 – Sep 17, 2011 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: Fix broken build

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 <[email protected]>
Cc Anthony Liguori <[email protected]>
---
 Makefile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Makefile +2 -2
index 57cc399..a211158 100644
@@ -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)
Signature · 1 line
1.7.2.5
Applied
#1 lore raw

Thanks, applied.

Quoted 35 lines · Stefan Weil

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 <[email protected]>
Cc Anthony Liguori <[email protected]>

---
 Makefile |    4 ++--

 1 files changed, 2 insertions(+), 2 deletions(-)
Makefile +2 -2
index 57cc399..a211158 100644
@@ -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