From mboxrd@z Thu Jan 1 00:00:00 1970 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 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 From: Anthony Liguori Date: Sun, 17 Jun 2012 09:57:52 -0500 Message-Id: <1339945072-10816-1-git-send-email-aliguori@us.ibm.com> Subject: [Qemu-devel] [PATCH] make: automatically include dependencies in recursive subdir rules List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Anthony Liguori , Andreas Faerber 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 -- 1.7.5.4