qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Fam Zheng <famz@redhat.com>
Cc: "Kevin Wolf" <kwolf@redhat.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Michael Tokarev" <mjt@tls.msk.ru>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"Alex Bligh" <alex@alex.org.uk>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Miroslav Rezanina" <mrezanin@redhat.com>,
	"Lluís Vilanova" <vilanova@ac.upc.edu>,
	"Richard Henderson" <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH v16 2/9] rules.mak: allow per object cflags and libs
Date: Wed, 15 Jan 2014 19:35:12 +0000	[thread overview]
Message-ID: <CAFEAcA-KAmy3=6ouQU2KWNJHrc==X2x3615UsSf__WRzhrpzqw@mail.gmail.com> (raw)
In-Reply-To: <1389775713-996-3-git-send-email-famz@redhat.com>

On 15 January 2014 08:48, Fam Zheng <famz@redhat.com> 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 <famz@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  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) $($@-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.)

thanks
-- PMM

  reply	other threads:[~2014-01-15 19:35 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-15  8:48 [Qemu-devel] [PATCH v16 0/9] Shared library module support Fam Zheng
2014-01-15  8:48 ` [Qemu-devel] [PATCH v16 1/9] rules.mak: fix $(obj) to a real relative path Fam Zheng
2014-01-15  8:48 ` [Qemu-devel] [PATCH v16 2/9] rules.mak: allow per object cflags and libs Fam Zheng
2014-01-15 19:35   ` Peter Maydell [this message]
2014-01-16 10:53     ` Fam Zheng
2014-01-16 11:04   ` Peter Maydell
2014-01-16 12:40     ` Fam Zheng
2014-01-16 12:43       ` Paolo Bonzini
2014-01-15  8:48 ` [Qemu-devel] [PATCH v16 3/9] block: use per-object " Fam Zheng
2014-01-15  8:48 ` [Qemu-devel] [PATCH v16 4/9] darwin: do not use -mdynamic-no-pic Fam Zheng
2014-01-15  8:48 ` [Qemu-devel] [PATCH v16 5/9] build-sys: introduce common-obj-m and block-obj-m for DSO Fam Zheng
2014-01-15  8:48 ` [Qemu-devel] [PATCH v16 6/9] module: implement module loading Fam Zheng
2014-01-15 11:53   ` Peter Maydell
2014-01-15 11:56     ` Paolo Bonzini
2014-01-15 12:03       ` Peter Maydell
2014-01-15 12:05         ` Paolo Bonzini
2014-01-15 12:11           ` Peter Maydell
2014-01-15 12:17             ` Paolo Bonzini
2014-01-15 12:09         ` Alex Bligh
2014-01-15 12:10           ` Paolo Bonzini
2014-01-15 12:18             ` Alex Bligh
2014-01-15 12:30               ` Paolo Bonzini
2014-01-16  1:11                 ` Fam Zheng
2014-01-15 12:34     ` Fam Zheng
2014-01-15 12:38       ` Paolo Bonzini
2014-01-15  8:48 ` [Qemu-devel] [PATCH v16 7/9] Makefile: install modules with "make install" Fam Zheng
2014-01-15  8:48 ` [Qemu-devel] [PATCH v16 8/9] .gitignore: ignore module related files (dll, so, mo) Fam Zheng
2014-01-15  8:48 ` [Qemu-devel] [PATCH v16 9/9] block: convert block drivers linked with libs to modules Fam Zheng
2014-01-15 13:11 ` [Qemu-devel] [PATCH v16 0/9] Shared library module support Peter Maydell
2014-01-15 14:11   ` Paolo Bonzini
2014-01-15 14:20     ` Peter Maydell
2014-01-15 14:36       ` Paolo Bonzini
2014-01-15 14:40         ` Peter Maydell
2014-01-15 14:51           ` Paolo Bonzini
2014-01-15 15:29             ` Peter Maydell
2014-01-15 15:40               ` Peter Maydell
2014-01-15 16:14                 ` Paolo Bonzini
2014-01-16  1:16           ` Fam Zheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFEAcA-KAmy3=6ouQU2KWNJHrc==X2x3615UsSf__WRzhrpzqw@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=alex@alex.org.uk \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mjt@tls.msk.ru \
    --cc=mrezanin@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=stefanha@redhat.com \
    --cc=vilanova@ac.upc.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).