From patchwork Sun Jun 17 15:33:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 165346 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 58371B7136 for ; Mon, 18 Jun 2012 01:34:22 +1000 (EST) Received: from localhost ([::1]:56968 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SgHUZ-0007QK-HL for incoming@patchwork.ozlabs.org; Sun, 17 Jun 2012 11:34:19 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35798) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SgHUS-0007Q9-H8 for qemu-devel@nongnu.org; Sun, 17 Jun 2012 11:34:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SgHUQ-0002HZ-LQ for qemu-devel@nongnu.org; Sun, 17 Jun 2012 11:34:12 -0400 Received: from cantor2.suse.de ([195.135.220.15]:60034 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SgHUQ-0002HK-CU for qemu-devel@nongnu.org; Sun, 17 Jun 2012 11:34:10 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 0F094A4D3A; Sun, 17 Jun 2012 17:34:08 +0200 (CEST) Message-ID: <4FDDF8E6.6050606@suse.de> Date: Sun, 17 Jun 2012 17:33:58 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= Organization: SUSE LINUX Products GmbH User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120421 Thunderbird/12.0 MIME-Version: 1.0 To: Anthony Liguori References: <1339945072-10816-1-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1339945072-10816-1-git-send-email-aliguori@us.ibm.com> X-Enigmail-Version: 1.5pre X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.15 Cc: Blue Swirl , Paolo Bonzini , qemu-devel@nongnu.org Subject: Re: [Qemu-devel] [PATCH] make: automatically include dependencies in recursive subdir rules 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 Am 17.06.2012 16:57, schrieb Anthony Liguori: > I think I understand enough of what's going on in these rules to ensure this is > right. But I could certainly use a second or third opinion... > > Signed-off-by: Anthony Liguori > --- > Makefile | 4 ++-- > rules.mak | 1 + > 2 files changed, 3 insertions(+), 2 deletions(-) > > diff --git a/Makefile b/Makefile > index cce45fb..593bd9b 100644 > --- a/Makefile > +++ b/Makefile > @@ -405,5 +405,5 @@ tar: > Makefile: $(GENERATED_HEADERS) > > # Include automatically generated dependency files > --include $(wildcard *.d audio/*.d slirp/*.d block/*.d net/*.d ui/*.d qapi/*.d) > --include $(wildcard qga/*.d hw/*.d hw/usb/*.d qom/*.d) This was based on my QOM Makefile patch and doesn't apply to master. If I understand this patch correctly, we could further apply this diff on top: /-F > +# All subdir dependencies come automatically from our recursive subdir rules > +-include $(wildcard *.d) > diff --git a/rules.mak b/rules.mak > index 4bc5e52..8c5ef95 100644 > --- a/rules.mak > +++ b/rules.mak > @@ -94,6 +94,7 @@ define unnest-dir > $(foreach var,$(nested-vars),$(call push-var,$(var),$1/)) > $(eval obj := $(obj)/$1) > $(eval include $(SRC_PATH)/$1/Makefile.objs) > +$(eval -include $(wildcard $(SRC_PATH)/$1/*.d)) > $(eval obj := $(patsubst %/$1,%,$(obj))) > $(foreach var,$(nested-vars),$(call pop-var,$(var),$1/)) > endef diff --git a/Makefile.dis b/Makefile.dis index 3e1fcaf..09060f0 100644 --- a/Makefile.dis +++ b/Makefile.dis @@ -20,4 +20,4 @@ clean: rm -f *.o *.d *.a *~ # Include automatically generated dependency files --include $(wildcard *.d */*.d) +-include $(wildcard *.d) diff --git a/Makefile.hw b/Makefile.hw index 2bcbaff..3e794e1 100644 --- a/Makefile.hw +++ b/Makefile.hw @@ -23,4 +23,4 @@ clean: rm -f $(addsuffix /*.d, $(dir $(sort $(hw-obj-y)))) # Include automatically generated dependency files --include $(patsubst %.o, %.d, $(hw-obj-y)) +-include $(wildcard *.d) diff --git a/Makefile.target b/Makefile.target index 2907aad..550d889 100644 --- a/Makefile.target +++ b/Makefile.target @@ -216,4 +216,4 @@ GENERATED_HEADERS += config-target.h Makefile: $(GENERATED_HEADERS) # Include automatically generated dependency files --include $(wildcard *.d */*.d) +-include $(wildcard *.d) diff --git a/Makefile.user b/Makefile.user index b717820..0ffefe8 100644 --- a/Makefile.user +++ b/Makefile.user @@ -23,4 +23,4 @@ clean: done # Include automatically generated dependency files --include $(wildcard *.d */*.d) +-include $(wildcard *.d)