From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36219) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3kZb-0003dy-OR for qemu-devel@nongnu.org; Thu, 16 Jan 2014 05:53:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W3kZV-0008HC-PT for qemu-devel@nongnu.org; Thu, 16 Jan 2014 05:53:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:24295) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3kZV-0008H7-Fq for qemu-devel@nongnu.org; Thu, 16 Jan 2014 05:53:13 -0500 Date: Thu, 16 Jan 2014 18:53:01 +0800 From: Fam Zheng Message-ID: <20140116105301.GA32533@T430.nay.redhat.com> References: <1389775713-996-1-git-send-email-famz@redhat.com> <1389775713-996-3-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v16 2/9] rules.mak: allow per object cflags and libs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Kevin Wolf , Stefan Hajnoczi , Michael Tokarev , QEMU Developers , Alex Bligh , Paolo Bonzini , Miroslav Rezanina , =?iso-8859-1?Q?Llu=EDs?= Vilanova , Richard Henderson On Wed, 01/15 19:35, Peter Maydell wrote: > On 15 January 2014 08:48, Fam Zheng wrote: > > Adds extract-libs in LINK to expand any "per object libs", the syntax to define > > such a libs options is like: > > > > foo.o-libs := $(CURL_LIBS) > > > > in block/Makefile.objs. > > > > Similarly, > > > > foo.o-cflags := $(FOO_CFLAGS) > > > > is also supported. > > > > "foo.o" must be listed in a nested var (e.g. common-obj-y) to make the > > option variables effective. > > > > Signed-off-by: Fam Zheng > > Signed-off-by: Paolo Bonzini > > --- > > rules.mak | 19 ++++++++++++++++--- > > 1 file changed, 16 insertions(+), 3 deletions(-) > > > > diff --git a/rules.mak b/rules.mak > > index 7d27602..9398268 100644 > > --- a/rules.mak > > +++ b/rules.mak > > @@ -21,15 +21,17 @@ 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$( > > > +extract-libs = $(strip $(foreach o,$1,$($o-libs))) > > + > > %.o: %.c > > - $(call quiet-command,$(CC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," CC $(TARGET_DIR)$@") > > + $(call quiet-command,$(CC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) $($@-cflags) -c -o $@ $<," CC $(TARGET_DIR)$@") > > Shouldn't this change also be made in the rules for compiling > .cpp and .m files (which also use CFLAGS and could benefit > from per-object flags) ? > > (For instance it would be nice if I could compile the libvixl > C++ sources with a different set of flags.) > Sounds reasonable. As I've already sent v17 without this change, I'll remember to add this in later revisions or follow-up patches. Fam