From patchwork Sun Jun 17 14:57:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Liguori X-Patchwork-Id: 165345 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 07F50B70D0 for ; Mon, 18 Jun 2012 00:58:15 +1000 (EST) Received: from localhost ([::1]:46583 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SgGvc-00009V-Un for incoming@patchwork.ozlabs.org; Sun, 17 Jun 2012 10:58:12 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49035) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SgGvU-000095-LE for qemu-devel@nongnu.org; Sun, 17 Jun 2012 10:58:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SgGvT-0003Ct-2N for qemu-devel@nongnu.org; Sun, 17 Jun 2012 10:58:04 -0400 Received: from e35.co.us.ibm.com ([32.97.110.153]:60341) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SgGvS-0003CW-S4 for qemu-devel@nongnu.org; Sun, 17 Jun 2012 10:58:02 -0400 Received: from /spool/local by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 17 Jun 2012 08:57:56 -0600 Received: from d01dlp03.pok.ibm.com (9.56.224.17) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sun, 17 Jun 2012 08:57:55 -0600 Received: from d01relay06.pok.ibm.com (d01relay06.pok.ibm.com [9.56.227.116]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id 9C5EBC90050 for ; Sun, 17 Jun 2012 10:57:53 -0400 (EDT) Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay06.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q5HEvsCg35651832 for ; Sun, 17 Jun 2012 10:57:54 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q5HEvrdv022190 for ; Sun, 17 Jun 2012 11:57:53 -0300 Received: from titi.austin.rr.com ([9.80.11.182]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q5HEvqN4022157; Sun, 17 Jun 2012 11:57:53 -0300 From: Anthony Liguori To: qemu-devel@nongnu.org Date: Sun, 17 Jun 2012 09:57:52 -0500 Message-Id: <1339945072-10816-1-git-send-email-aliguori@us.ibm.com> X-Mailer: git-send-email 1.7.5.4 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12061714-6148-0000-0000-000006C77E7D X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 32.97.110.153 Cc: Paolo Bonzini , Anthony Liguori , Andreas Faerber Subject: [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 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) +# 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