[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v16 2/9] rules.mak: allow per object cflags and
From: |
Fam Zheng |
Subject: |
Re: [Qemu-devel] [PATCH v16 2/9] rules.mak: allow per object cflags and libs |
Date: |
Thu, 16 Jan 2014 18:53:01 +0800 |
User-agent: |
Mutt/1.5.22 (2013-10-16) |
On Wed, 01/15 19:35, Peter Maydell wrote:
> On 15 January 2014 08:48, Fam Zheng <address@hidden> 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 <address@hidden>
> > Signed-off-by: Paolo Bonzini <address@hidden>
> > ---
> > 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$(<D) -I$(@D)
> >
> > +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) $(address@hidden) -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
- [Qemu-devel] [PATCH v16 0/9] Shared library module support, Fam Zheng, 2014/01/15
- [Qemu-devel] [PATCH v16 4/9] darwin: do not use -mdynamic-no-pic, Fam Zheng, 2014/01/15
- [Qemu-devel] [PATCH v16 8/9] .gitignore: ignore module related files (dll, so, mo), Fam Zheng, 2014/01/15
- [Qemu-devel] [PATCH v16 9/9] block: convert block drivers linked with libs to modules, Fam Zheng, 2014/01/15
- [Qemu-devel] [PATCH v16 7/9] Makefile: install modules with "make install", Fam Zheng, 2014/01/15
- [Qemu-devel] [PATCH v16 3/9] block: use per-object cflags and libs, Fam Zheng, 2014/01/15
- [Qemu-devel] [PATCH v16 5/9] build-sys: introduce common-obj-m and block-obj-m for DSO, Fam Zheng, 2014/01/15
- [Qemu-devel] [PATCH v16 6/9] module: implement module loading, Fam Zheng, 2014/01/15