From patchwork Sat Feb 9 18:59:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Blue Swirl X-Patchwork-Id: 219428 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2B6902C0089 for ; Sun, 10 Feb 2013 06:16:20 +1100 (EST) Received: from localhost ([::1]:34090 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4Fmy-00035y-TH for incoming@patchwork.ozlabs.org; Sat, 09 Feb 2013 14:08:40 -0500 Received: from eggs.gnu.org ([208.118.235.92]:39189) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4FmZ-00034d-GA for qemu-devel@nongnu.org; Sat, 09 Feb 2013 14:08:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U4Fer-0001ea-Hr for qemu-devel@nongnu.org; Sat, 09 Feb 2013 14:00:41 -0500 Received: from mail-lb0-f171.google.com ([209.85.217.171]:43026) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4Feq-0001VJ-U4 for qemu-devel@nongnu.org; Sat, 09 Feb 2013 14:00:17 -0500 Received: by mail-lb0-f171.google.com with SMTP id gg13so3794794lbb.30 for ; Sat, 09 Feb 2013 11:00:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=g2RhW3wjxAsauZEmM8LVwH0/SJcKHldF4rXirexQ2XM=; b=OuUqQDIJl9nLa8BacvnziC8uOnchfjP5EHn4OqT+tMYmLiuUmLt6+BtW5NpgaUm36z p34NuNMb4gYQM/Ef5m/Gux7POv6jed5pWYP1Wfqb6Hzi4kzYNT8Qaz8IouEeqWvuMIqU hQtKcxoqcOU/igOZiNUbGkOMOyAseRD7B3PO7t7NAWsv1I0vl4lJvyZqmyR4Q0WbwVpo BAXpqED6C6UPiEmnLA/nMyBrZrEvKJMjZL3Sp8rKnlz9pLRLq4xHMOF1lni4nH7TL9Kx dsGK5KZbpd0aRHnZ1/xnQBGtczxmVoJtt4QFxtXltXLLnQbL8R48bBBaUmyBKmhDuXOz quCg== X-Received: by 10.112.101.34 with SMTP id fd2mr2995051lbb.100.1360436406284; Sat, 09 Feb 2013 11:00:06 -0800 (PST) Received: from localhost.localdomain ([2001:5c0:1115:ba00:edb6:7a04:4e42:52c0]) by mx.google.com with ESMTPS id mq7sm1400556lab.1.2013.02.09.11.00.02 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 09 Feb 2013 11:00:05 -0800 (PST) From: Blue Swirl To: openbios@openbios.org Date: Sat, 9 Feb 2013 18:59:59 +0000 Message-Id: <7ab841ebb4c7c5f6881d41c8ebe02fd6ded871b8.1360436392.git.blauwirbel@gmail.com> X-Mailer: git-send-email 1.7.2.5 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.217.171 Cc: blauwirbel@gmail.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH] build: support disjoint build 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 Support building in any directory, not just in-tree build. Use VPATH for non-Forth files. Forth compiler does not support explicit paths, so drop source path prefixes added by XML and rely on directories passed with -I flag. Signed-off-by: Blue Swirl --- .gitignore | 1 + Makefile | 3 +- Makefile.target | 5 +++- config/scripts/switch-arch | 47 +++++++++++++++++++++++++------------------ config/xml/dictionary.xsl | 3 +- config/xml/object.xsl | 1 - 6 files changed, 35 insertions(+), 25 deletions(-) diff --git a/.gitignore b/.gitignore index e6b5c59..38e6dd8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ obj-* .stgit-* +config-host.mak diff --git a/Makefile b/Makefile index 74e462c..3526b75 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,4 @@ -ODIRS=$(wildcard obj-*) -TARGETS=$(subst obj-,,$(ODIRS)) +include config-host.mak all: requirements info build diff --git a/Makefile.target b/Makefile.target index 934b95a..913fb13 100644 --- a/Makefile.target +++ b/Makefile.target @@ -6,7 +6,6 @@ include config.mak ODIR := . -SRCDIR := .. HOSTCC := gcc HOSTCFLAGS+= -O2 -g -DFCOMPILER -DBOOTSTRAP $(CROSSCFLAGS) @@ -38,6 +37,10 @@ AS_FLAGS+= -g quiet-command = $(if $(V),$1,$(if $(2),@echo $2 && $1, @$1)) +VPATH_SUFFIXES = %.c %.h %.S %.fs +set-vpath = $(if $1,$(foreach PATTERN,$(VPATH_SUFFIXES),$(eval vpath $(PATTERN) $1))) +$(call set-vpath, $(SRCDIR)) + # # pre rules # diff --git a/config/scripts/switch-arch b/config/scripts/switch-arch index a9c911b..b91af7c 100755 --- a/config/scripts/switch-arch +++ b/config/scripts/switch-arch @@ -117,21 +117,18 @@ config_set_boolean() echo "