qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH 0/4] per-object libraries


From: Michael Tokarev
Subject: Re: [Qemu-devel] [RFC PATCH 0/4] per-object libraries
Date: Wed, 19 Jun 2013 18:58:25 +0400
User-agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:17.0) Gecko/17.0 Icedove/17.0

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 via email to

[Prev in Thread] Current Thread [Next in Thread]