From patchwork Tue Jun 10 11:08:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 357857 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 31433140082 for ; Tue, 10 Jun 2014 21:09:38 +1000 (EST) Received: from localhost ([::1]:38291 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuJvs-0006x0-2G for incoming@patchwork.ozlabs.org; Tue, 10 Jun 2014 07:09:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40290) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuJui-0005f2-PI for qemu-devel@nongnu.org; Tue, 10 Jun 2014 07:08:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WuJub-0006uC-T9 for qemu-devel@nongnu.org; Tue, 10 Jun 2014 07:08:24 -0400 Received: from mail-wg0-x22d.google.com ([2a00:1450:400c:c00::22d]:37531) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuJub-0006u0-Iv for qemu-devel@nongnu.org; Tue, 10 Jun 2014 07:08:17 -0400 Received: by mail-wg0-f45.google.com with SMTP id l18so1260653wgh.4 for ; Tue, 10 Jun 2014 04:08:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=peQu95Gco2rGiYiGZMgdQl5Cc6n//+WGnfyT7uvJumk=; b=dzFh7c1iQTBH+pnNQkG83GvN3cpMVXQKBpNOrFZcVgah8m2O0j1UfS/UIpyqBRSXXk 6lJMlwASiSPOabvUlmRGgQcGUpRijWLtYgFQAmqkEFr2cVWtwKkylRDYT/ZGe4kN4Gka 9RdHOCf1z4J2oWm2pXPlu5T2ZundwrsDCJpSEd4H8YY9ZetUu3uAgjmeJH3n+Sv++eH2 p7SxfCwCo6kX6bvL0yHkgW7sgwBcFyM1+7v5K5pjMde9VZBG8Jmwo6ke09BW/bsig7HM fFtt6SoCHkpmpwoli1MnKO00cyQI5/N+krRdDmhFOr7NrPYIejXJQ8OeD4/TUPmOtOhr jiBQ== X-Received: by 10.194.92.148 with SMTP id cm20mr38716554wjb.53.1402398496857; Tue, 10 Jun 2014 04:08:16 -0700 (PDT) Received: from playground.station (net-37-117-132-7.cust.vodafonedsl.it. [37.117.132.7]) by mx.google.com with ESMTPSA id gb6sm20169018wic.6.2014.06.10.04.08.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Jun 2014 04:08:16 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 10 Jun 2014 13:08:11 +0200 Message-Id: <1402398491-19097-2-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1402398491-19097-1-git-send-email-pbonzini@redhat.com> References: <1402398491-19097-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c00::22d Cc: Fam Zheng Subject: [Qemu-devel] [PULL v2 8/8] rules.mak: Rewrite unnest-vars 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 From: Fam Zheng The macro unnest-vars is the most important, complicated but hard to track magic in QEMU's build system. Rewrite it in a (hopefully) clearer way, with more comments, to make it easier to understand and maintain. Remove DSO_CFLAGS and module-objs-m that are not used. A bonus fix of this version is, per object variables are properly protected in save-objs and load-objs, before including sub-dir Makefile.objs, just as nested variables are. So the occasional same object name from different directory levels won't step on each other's foot. Signed-off-by: Fam Zheng Signed-off-by: Paolo Bonzini --- rules.mak | 237 +++++++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 158 insertions(+), 79 deletions(-) diff --git a/rules.mak b/rules.mak index b12d312..5598d3f 100644 --- a/rules.mak +++ b/rules.mak @@ -22,9 +22,7 @@ QEMU_DGFLAGS += -MMD -MP -MT $@ -MF $(*D)/$(*F).d # Same as -I$(SRC_PATH) -I., but for the nested source/object directories QEMU_INCLUDES += -I$(