From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52336) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SgPtN-0000ZF-Ph for qemu-devel@nongnu.org; Sun, 17 Jun 2012 20:32:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SgPtL-0007B1-8v for qemu-devel@nongnu.org; Sun, 17 Jun 2012 20:32:29 -0400 Received: from cantor2.suse.de ([195.135.220.15]:57679 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SgPtK-0007Aq-Ve for qemu-devel@nongnu.org; Sun, 17 Jun 2012 20:32:27 -0400 Message-ID: <4FDE7711.201@suse.de> Date: Mon, 18 Jun 2012 02:32:17 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1339977692-3196-1-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1339977692-3196-1-git-send-email-aliguori@us.ibm.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] make: automatically include dependencies in recursive subdir rules (v2) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Paolo Bonzini , qemu-devel@nongnu.org, Jan Kiszka Am 18.06.2012 02:01, 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... >=20 > Signed-off-by: Anthony Liguori > --- > v1 -> v2 > - Remove unnecessary includes (Andreas) > - Add a sub makefile for hw/kvm (Andreas) > --- > Makefile | 4 ++-- > Makefile.dis | 2 +- > Makefile.target | 2 +- > Makefile.user | 2 +- > hw/i386/Makefile.objs | 2 +- > hw/kvm/Makefile.objs | 1 + > rules.mak | 1 + > 7 files changed, 8 insertions(+), 6 deletions(-) > create mode 100644 hw/kvm/Makefile.objs >=20 > diff --git a/Makefile b/Makefile > index cce45fb..593bd9b 100644 > --- a/Makefile > +++ b/Makefile > @@ -405,5 +405,5 @@ tar: > Makefile: $(GENERATED_HEADERS) > =20 > # Include automatically generated dependency files > --include $(wildcard *.d audio/*.d slirp/*.d block/*.d net/*.d ui/*.d q= api/*.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/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 *~ > =20 > # Include automatically generated dependency files > --include $(wildcard *.d */*.d) > +-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 +=3D config-target.h > Makefile: $(GENERATED_HEADERS) > =20 > # 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 > =20 > # Include automatically generated dependency files > --include $(wildcard *.d */*.d) > +-include $(wildcard *.d) > diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs > index d43f1df..eb171b7 100644 > --- a/hw/i386/Makefile.objs > +++ b/hw/i386/Makefile.objs > @@ -7,7 +7,7 @@ obj-y +=3D debugcon.o multiboot.o > obj-y +=3D pc_piix.o > obj-y +=3D pc_sysfw.o > obj-$(CONFIG_XEN) +=3D xen_platform.o xen_apic.o > -obj-$(CONFIG_KVM) +=3D kvm/clock.o kvm/apic.o kvm/i8259.o kvm/ioapic.o= kvm/i8254.o > +obj-y +=3D kvm/ This will work technically but I still feel this is wrong semantically. The pre-Paolo and current way is picking specific files from the hw/kvm/ directory. Your change above implies that in hw/kvm/ only x86 files can live, which I dislike. As suggested before, I would prefer if x86-only files were moved to an x86-specific location - the place for that existing since Paolo's refactoring would be hw/i386/. CC'ing Jan. That would match Paolo's reply in the unicore32 thread on future file placement. Alternatives would be hw/i386/kvm/ or hw/kvm/i386/; we're talking about a handful of files only though, so I don't think they require a new subdirectory. Andreas > obj-$(CONFIG_SPICE) +=3D qxl.o qxl-logger.o qxl-render.o > =20 > obj-y :=3D $(addprefix ../,$(obj-y)) > diff --git a/hw/kvm/Makefile.objs b/hw/kvm/Makefile.objs > new file mode 100644 > index 0000000..226497a > --- /dev/null > +++ b/hw/kvm/Makefile.objs > @@ -0,0 +1 @@ > +obj-$(CONFIG_KVM) +=3D clock.o apic.o i8259.o ioapic.o i8254.o > diff --git a/rules.mak b/rules.mak > index 4bc5e52..60f3e96 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 :=3D $(obj)/$1) > $(eval include $(SRC_PATH)/$1/Makefile.objs) > +$(eval -include $(wildcard $1/*.d)) > $(eval obj :=3D $(patsubst %/$1,%,$(obj))) > $(foreach var,$(nested-vars),$(call pop-var,$(var),$1/)) > endef --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg