From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34992) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZOKdX-0004gB-K6 for qemu-devel@nongnu.org; Sun, 09 Aug 2015 03:03:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZOKdU-0005cW-E6 for qemu-devel@nongnu.org; Sun, 09 Aug 2015 03:03:15 -0400 Received: from mail-pa0-x230.google.com ([2607:f8b0:400e:c03::230]:35006) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZOKdU-0005Zx-73 for qemu-devel@nongnu.org; Sun, 09 Aug 2015 03:03:12 -0400 Received: by pacgr6 with SMTP id gr6so4380645pac.2 for ; Sun, 09 Aug 2015 00:03:10 -0700 (PDT) From: Michael Marineau Date: Sun, 9 Aug 2015 00:02:55 -0700 Message-Id: <1439103775-11836-1-git-send-email-michael.marineau@coreos.com> Subject: [Qemu-devel] [PATCH] Makefile.target: include top level build dir in vpath List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Michael Marineau Using ccache with CCACHE_BASEDIR set to $(SRC_PATH) or a parent will rewrite all absolute paths to relative paths. This interacts poorly with QEMU's two-level build directory scheme. For example, lets say BUILD_DIR=$(SRC_PATH)/build so build/blockdev.d will contain: blockdev.o: ../blockdev.c ../include/sysemu/block-backend.h \ Now the target build under build/x86_64-softmmu or similar will depend on ../blockdev.o which in turn will get make to source ../blockdev.d to check its dependencies. Since make always considers paths relative to the current working directory rather than the makefile the path appeared in the relative path to ../blockdev.c is useless. This change simply adds the top level build directory to vpath so paths relative to the source directory, top build directory, and target build directory all work just fine. --- Makefile.target | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.target b/Makefile.target index 3e7aafd..dc32294 100644 --- a/Makefile.target +++ b/Makefile.target @@ -7,7 +7,7 @@ include config-target.mak include config-devices.mak include $(SRC_PATH)/rules.mak -$(call set-vpath, $(SRC_PATH)) +$(call set-vpath, $(SRC_PATH):$(BUILD_DIR)) ifdef CONFIG_LINUX QEMU_CFLAGS += -I../linux-headers endif -- 2.4.6