From patchwork Wed Nov 30 13:03:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 128504 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D6B661007D1 for ; Thu, 1 Dec 2011 00:03:10 +1100 (EST) Received: from localhost ([::1]:42056 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVjoW-0005VE-BQ for incoming@patchwork.ozlabs.org; Wed, 30 Nov 2011 08:03:04 -0500 Received: from eggs.gnu.org ([140.186.70.92]:33725) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVjoL-0005UZ-Mr for qemu-devel@nongnu.org; Wed, 30 Nov 2011 08:02:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RVjoK-00071p-7d for qemu-devel@nongnu.org; Wed, 30 Nov 2011 08:02:53 -0500 Received: from smtp.eu.citrix.com ([62.200.22.115]:34267) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVjoD-00070W-Aq; Wed, 30 Nov 2011 08:02:45 -0500 X-IronPort-AV: E=Sophos;i="4.69,596,1315180800"; d="scan'208";a="9206561" Received: from lonpmailmx01.citrite.net ([10.30.203.162]) by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5; 30 Nov 2011 13:02:43 +0000 Received: from kaball.uk.xensource.com (10.80.2.59) by LONPMAILMX01.citrite.net (10.30.203.162) with Microsoft SMTP Server id 8.3.213.0; Wed, 30 Nov 2011 13:02:43 +0000 Date: Wed, 30 Nov 2011 13:03:39 +0000 From: Stefano Stabellini X-X-Sender: sstabellini@kaball-desktop To: Stefan Hajnoczi In-Reply-To: Message-ID: References: <4ED3F1C3.4060601@weilnetz.de> <1322606869-25865-1-git-send-email-mdroth@linux.vnet.ibm.com> <1322606869-25865-2-git-send-email-mdroth@linux.vnet.ibm.com> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-ID: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 62.200.22.115 Cc: "qemu-trivial@nongnu.org" , "sw@weilnetz.de" , Stefano Stabellini , Michael Roth , "qemu-devel@nongnu.org" Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH 2/2] Makefile: use full path for qapi-generated directory X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org On Wed, 30 Nov 2011, Stefan Hajnoczi wrote: > On Tue, Nov 29, 2011 at 10:47 PM, Michael Roth > wrote: > > Generally $(BUILD_DIR) == $(CURDIR), but that isn't necessarilly the > > case, so use $(BUILD_DIR)/qapi-generated for generated files to > > avoid potentionally sticking generating files in odd places outside > > the build's include paths. > > --- > > � Makefile | �  � 2 +- > > � 1 files changed, 1 insertions(+), 1 deletions(-) > > Reviewed-by: Stefan Hajnoczi > > Not applied to trivial tree yet. I want to let Stefano, Stefan Weil, > or Anthony take a look too since we were all discussing these changes > yesterday. While I think that the change is correct (certainly better than the original patch), unfortunately still doesn't solve the problem entirely. Steps to repro, assuming "qemu" is the source tree and "temp" is the empty build directory: - cd qemu; ./configure; make - cd ../temp; ./configure --source-path=../qemu; make Result: Makefile:9: config-devices.mak: No such file or directory In order to fix the issue, we need to make sure that config-devices.mak is relative to $(BUILD_DIR) in the Makefile. Signed-off-by: Stefano Stabellini diff --git a/Makefile b/Makefile index 301c75e..b9f8de7 100644 --- a/Makefile +++ b/Makefile @@ -43,15 +43,15 @@ DOCS= endif SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory) BUILD_DIR=$(BUILD_DIR) -SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS)) -SUBDIR_DEVICES_MAK_DEP=$(patsubst %, %/config-devices.mak.d, $(TARGET_DIRS)) +SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(BUILD_DIR)/$(TARGET_DIRS)) +SUBDIR_DEVICES_MAK_DEP=$(patsubst %, %/config-devices.mak.d, $(BUILD_DIR)/$(TARGET_DIRS)) config-all-devices.mak: $(SUBDIR_DEVICES_MAK) $(call quiet-command,cat $(SUBDIR_DEVICES_MAK) | grep =y | sort -u > $@," GEN $@") -include $(SUBDIR_DEVICES_MAK_DEP) -%/config-devices.mak: default-configs/%.mak +$(BUILD_DIR)/%/config-devices.mak: default-configs/%.mak $(call quiet-command,$(SHELL) $(SRC_PATH)/scripts/make_device_config.sh $@ $<, " GEN $@") @if test -f $@; then \ if cmp -s $@.old $@; then \