qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Michael Tokarev <mjt@tls.msk.ru>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC PATCH 0/4] per-object libraries
Date: Wed, 19 Jun 2013 18:58:25 +0400	[thread overview]
Message-ID: <51C1C711.1010205@msgid.tls.msk.ru> (raw)
In-Reply-To: <20130619141622.GF31475@stefanha-thinkpad.muc.redhat.com>

19.06.2013 18:16, Stefan Hajnoczi wrote:
> On Tue, Jun 18, 2013 at 09:34:00PM +0400, Michael Tokarev wrote:
>> The foo.cflags isn't really necessary, but when you specify one
>> thing one way (target-specific variable), and another thing completely
>> different way, resulting code does not look nice.  In particular, the
>> two curl definitions in block/Makefile.objs look somewhat funky if
>> curl.cflags isn't used.
> 
> Specifying per-object file or per-module LIBS/CFLAGS is great.  I wonder
> if we can do it like kbuild though:
> CFLAGS_i915_trace_points.o := -I$(src)
> 
> It only takes the object file name, not the path.  Could be a problem if
> we have files with the same name in different directories I guess.

Yes, that's exactly the problem here -- duplicate file names.  Currently
we have some duplicates -- for example:

hw/bt/core.c
hw/usb/core.c
hw/acpi/core.c
hw/i2c/core.c
hw/ide/core.c

block.c
hw/block/block.c

hw/bt/hid.c
hw/input/hid.c

and so on.  These will have to be renamed for this approach to work, and
we will end up always risking having more duplicates.

More, it is difficult to watch for them, since we have roms/ and tests/
which are _full_ of dups :)

So I'm afraid this wont work.

> But I wonder if this approach would let you drop the $(obj)filename.o
> change.  I didn't review closely enough to really understand how that
> works though :-).

Well, it works, provided we don't forget to NOT put a slash after $(obj)
(which should be easy to verify btw, make can check for that like it
already does in my changes for missing $(foo.mod) variables).

And after thinking more about it -- it does not look that bad.

Alternative it to ALWAYS specify $(obj) in all Makefile.objs so we don't
need to expand just the special variables (common-obj-y, block-obj-y
etc) and it always works without additional expansion.

Thank you for the review!

/mjt

  reply	other threads:[~2013-06-19 14:58 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-18 17:34 [Qemu-devel] [RFC PATCH 0/4] per-object libraries Michael Tokarev
2013-06-18 17:34 ` [Qemu-devel] [RFC PATCH 1/4] build-sys: strip leading ./ from $(obj) Michael Tokarev
2013-06-18 17:34 ` [Qemu-devel] [RFC PATCH 2/4] build-sys: allow object-specific libraries to be used to link executables Michael Tokarev
2013-06-18 17:34 ` [Qemu-devel] [RFC PATCH 3/4] build-sys: allow per-object foo.cflags variables Michael Tokarev
2013-06-18 17:34 ` [Qemu-devel] [RFC PATCH 4/4] build-sys: move -lcurl out of libs and specify it for curl.o Michael Tokarev
2013-06-19  0:41 ` [Qemu-devel] [RFC PATCH 0/4] per-object libraries Michael Tokarev
2013-06-19 14:16 ` Stefan Hajnoczi
2013-06-19 14:58   ` Michael Tokarev [this message]
2013-06-19 16:46   ` Paolo Bonzini
2013-06-19 16:58 ` Paolo Bonzini
2013-06-19 18:18   ` Michael Tokarev
2013-06-19 18:52     ` Paolo Bonzini
2013-06-19 19:31       ` Richard Henderson
     [not found]         ` <51C2D03E.2030505@redhat.com>
2013-06-20 10:06           ` Peter Maydell
2013-06-20 12:39             ` Paolo Bonzini
2013-06-20 12:50               ` Peter Maydell
2013-06-20 17:09           ` Richard Henderson
2013-06-19 20:00       ` Michael Tokarev
2013-06-20 10:09         ` Paolo Bonzini
2013-06-30 15:23   ` Michael Tokarev
2013-07-01 10:08     ` Paolo Bonzini
2013-07-01 10:10       ` Michael Tokarev
2013-07-01 10:18         ` Paolo Bonzini
2013-06-30 15:28 ` Andreas Färber
2013-06-30 15:36   ` Michael Tokarev
2013-06-30 15:51     ` Peter Maydell
2013-06-30 16:49       ` Michael Tokarev
2013-07-01  8:00         ` Stefan Hajnoczi
2013-06-30 15:56     ` Andreas Färber
2013-07-01 13:39     ` Paolo Bonzini
2013-07-01 14:43       ` Michael Tokarev
2013-07-01 14:46         ` Andreas Färber
2013-07-01 14:52           ` Michael Tokarev
2013-07-01 14:53           ` Paolo Bonzini
2013-07-01 15:06             ` Michael Tokarev
2013-07-01 15:20               ` Paolo Bonzini
2013-07-01 15:52                 ` Michael Tokarev

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=51C1C711.1010205@msgid.tls.msk.ru \
    --to=mjt@tls.msk.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /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).