qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse
Date: Mon, 04 Jun 2012 06:55:34 +0800	[thread overview]
Message-ID: <4FCBEB66.7090504@codemonkey.ws> (raw)
In-Reply-To: <1338726358-30681-1-git-send-email-pbonzini@redhat.com>

On 06/03/2012 08:25 PM, Paolo Bonzini wrote:
> One source of complexity in the QEMU source is that we have a very
> shallow tree for a source code of over 750,000 lines of code.  In
> fact, one third of these lines alone is in one directory, hw/.
>
> As a prerequisite to cleaning up the structure, but as a worthwhile
> step on its own, this patchset cleans up the build system so that
> separate directories have their own Makefile snippet.  As in the Linux
> kernel build system, the overall build system is generally flat (in
> the case of QEMU, with one recursive invocation per emulation target).
> Subdirectories do not include complete Makefiles, instead they only host
> the declarations for a few variables (common-obj-y, universal-obj-y,
> obj-y, etc.).  Definitions for all the directories are merged with a
> little GNU Make magic (not much, only 20 lines).
>
> Two nice side effects are:
>
> - we can match the source tree and the object tree (for example the
>    per-target device models will be in XYZ-softmmu/hw, not in
>    XYZ-softmmu; those that are compiled once will be in hw/ rather
>    than in the root).
>
> - because the resolution of nested makefiles tracks the nested
>    directory, there is no need to use VPATH to find sources in
>    the hw/ and target-*/ directory.
>
> - there is a lot less Makefile programming (conditionals, addprefix,
>    etc.), replaced by only 20 lines in rules.mak and 1 in Makefile.objs.
>
> The series is entirely bisectable, and mostly consists of boring patches.
> If the concept is accepted, I would like to get it in as soon as possible.
> I have a few other cleanups on top (I stopped once I undid the diffstat
> of this series :)), but they can be covered later.
>
> Thoughts, approvals, rejections?

Awesomness!

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>

I tried to do something similar but my make-magic isn't quite as good as yours.

If you do a v2 fixing the whitespace issues Blue pointed out, I'll apply ASAP.

Regards,

Anthony Liguori

>
> Paolo
>
>
> Paolo Bonzini (24):
>    remove trace-nested-y
>    do not sprinkle around GENERATED_HEADERS dependencies
>    add rules for nesting
>    move *-user/ objects to nested Makefile
>    move obj-TARGET-y variables to nested Makefile
>    move libobj-y variable to nested Makefile
>    move other target-*/ objects to nested Makefiles
>    move rules for nesting to Makefile.objs
>    use nested Makefile rules for qom/ objects
>    move block/ objects to nested Makefile
>    move net/ objects to nested Makefile
>    move fsdev/ objects to nested Makefile
>    move ui/ objects to nested Makefile
>    move audio/ objects to nested Makefile
>    move slirp/ objects to nested Makefile
>    move qapi/ objects to nested Makefile
>    move qga/ objects to nested Makefile
>    move target-independent hw/ objects to nested Makefiles
>    convert libhw to nested Makefiles
>    move per-target hw/ objects to nested Makefiles
>    move device tree to per-target Makefile
>    libcacard Makefile cleanups
>    limit usage of vpath
>    compile oslib-obj-y once
>
>   Makefile                                     |   30 ++-
>   Makefile.hw                                  |    7 +-
>   Makefile.objs                                |  316 ++++---------------------
>   Makefile.target                              |  325 ++++----------------------
>   audio/Makefile                               |   15 ++
>   block/Makefile                               |   11 +
>   bsd-user/Makefile                            |    3 +
>   configure                                    |   70 +++---
>   fsdev/Makefile                               |    6 +
>   hw/9pfs/Makefile                             |    9 +
>   hw/Makefile                                  |  162 +++++++++++++
>   hw/alpha/Makefile                            |    4 +
>   hw/arm/Makefile                              |   40 ++++
>   hw/cris/Makefile                             |   13 ++
>   hw/i386/Makefile                             |   13 ++
>   hw/ide/Makefile                              |   10 +
>   hw/lm32/Makefile                             |   23 ++
>   hw/m68k/Makefile                             |    4 +
>   hw/microblaze/Makefile                       |   14 ++
>   hw/mips/Makefile                             |    6 +
>   hw/ppc/Makefile                              |   32 +++
>   hw/s390x/Makefile                            |    3 +
>   hw/sh4/Makefile                              |    5 +
>   hw/sparc/Makefile                            |    8 +
>   hw/sparc64/Makefile                          |    4 +
>   hw/usb/Makefile                              |   13 ++
>   hw/xtensa/Makefile                           |    5 +
>   libcacard/Makefile                           |   17 +-
>   linux-user/Makefile                          |    7 +
>   linux-user/arm/nwfpe/Makefile                |    3 +
>   net/Makefile                                 |   13 ++
>   qapi/Makefile                                |    3 +
>   qga/Makefile                                 |    4 +
>   qom/Makefile                                 |    6 +-
>   rules.mak                                    |   21 ++
>   slirp/Makefile                               |    4 +
>   target-alpha/Makefile                        |    3 +
>   target-arm/Makefile                          |    4 +
>   arm-semi.c =>  target-arm/arm-semi.c          |    0
>   target-cris/Makefile                         |    2 +
>   target-i386/Makefile                         |    6 +
>   ioport-user.c =>  target-i386/ioport-user.c   |    0
>   target-lm32/Makefile                         |    2 +
>   target-m68k/Makefile                         |    3 +
>   m68k-semi.c =>  target-m68k/m68k-semi.c       |    0
>   target-microblaze/Makefile                   |    2 +
>   target-mips/Makefile                         |    2 +
>   target-ppc/Makefile                          |    3 +
>   target-s390x/Makefile                        |    3 +
>   target-sh4/Makefile                          |    2 +
>   target-sparc/Makefile                        |    6 +
>   target-unicore32/Makefile                    |    2 +
>   target-xtensa/Makefile                       |    6 +
>   xtensa-semi.c =>  target-xtensa/xtensa-semi.c |    0
>   tests/Makefile                               |    1 -
>   ui/Makefile                                  |   18 ++
>   56 files changed, 674 insertions(+), 620 deletions(-)
>   create mode 100644 audio/Makefile
>   create mode 100644 block/Makefile
>   create mode 100644 bsd-user/Makefile
>   create mode 100644 fsdev/Makefile
>   create mode 100644 hw/9pfs/Makefile
>   create mode 100644 hw/Makefile
>   create mode 100644 hw/alpha/Makefile
>   create mode 100644 hw/arm/Makefile
>   create mode 100644 hw/cris/Makefile
>   create mode 100644 hw/i386/Makefile
>   create mode 100644 hw/ide/Makefile
>   create mode 100644 hw/lm32/Makefile
>   create mode 100644 hw/m68k/Makefile
>   create mode 100644 hw/microblaze/Makefile
>   create mode 100644 hw/mips/Makefile
>   create mode 100644 hw/ppc/Makefile
>   create mode 100644 hw/s390x/Makefile
>   create mode 100644 hw/sh4/Makefile
>   create mode 100644 hw/sparc/Makefile
>   create mode 100644 hw/sparc64/Makefile
>   create mode 100644 hw/usb/Makefile
>   create mode 100644 hw/xtensa/Makefile
>   create mode 100644 linux-user/Makefile
>   create mode 100644 linux-user/arm/nwfpe/Makefile
>   create mode 100644 net/Makefile
>   create mode 100644 qapi/Makefile
>   create mode 100644 qga/Makefile
>   create mode 100644 slirp/Makefile
>   create mode 100644 target-alpha/Makefile
>   create mode 100644 target-arm/Makefile
>   rename arm-semi.c =>  target-arm/arm-semi.c (100%)
>   create mode 100644 target-cris/Makefile
>   create mode 100644 target-i386/Makefile
>   rename ioport-user.c =>  target-i386/ioport-user.c (100%)
>   create mode 100644 target-lm32/Makefile
>   create mode 100644 target-m68k/Makefile
>   rename m68k-semi.c =>  target-m68k/m68k-semi.c (100%)
>   create mode 100644 target-microblaze/Makefile
>   create mode 100644 target-mips/Makefile
>   create mode 100644 target-ppc/Makefile
>   create mode 100644 target-s390x/Makefile
>   create mode 100644 target-sh4/Makefile
>   create mode 100644 target-sparc/Makefile
>   create mode 100644 target-unicore32/Makefile
>   create mode 100644 target-xtensa/Makefile
>   rename xtensa-semi.c =>  target-xtensa/xtensa-semi.c (100%)
>   create mode 100644 ui/Makefile
>

  parent reply	other threads:[~2012-06-03 22:55 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-03 12:25 [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 01/24] remove trace-nested-y Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 02/24] do not sprinkle around GENERATED_HEADERS dependencies Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 03/24] add rules for nesting Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 04/24] move *-user/ objects to nested Makefile Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 05/24] move obj-TARGET-y variables " Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 06/24] move libobj-y variable " Paolo Bonzini
2012-06-03 13:42   ` Blue Swirl
2012-06-03 17:32     ` Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 07/24] move other target-*/ objects to nested Makefiles Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 08/24] move rules for nesting to Makefile.objs Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 09/24] use nested Makefile rules for qom/ objects Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 10/24] move block/ objects to nested Makefile Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 11/24] move net/ " Paolo Bonzini
2012-06-03 13:44   ` Blue Swirl
2012-06-03 12:25 ` [Qemu-devel] [PATCH 12/24] move fsdev/ " Paolo Bonzini
2012-06-03 13:32   ` Blue Swirl
2012-06-03 12:25 ` [Qemu-devel] [PATCH 13/24] move ui/ " Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 14/24] move audio/ " Paolo Bonzini
2012-06-03 13:33   ` Blue Swirl
2012-06-03 12:25 ` [Qemu-devel] [PATCH 15/24] move slirp/ " Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 16/24] move qapi/ " Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 17/24] move qga/ " Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 18/24] move target-independent hw/ objects to nested Makefiles Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 19/24] convert libhw " Paolo Bonzini
2012-06-04 18:08   ` Andreas Färber
2012-06-05  6:30     ` Gerd Hoffmann
2012-06-03 12:25 ` [Qemu-devel] [PATCH 20/24] move per-target hw/ objects " Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 21/24] move device tree to per-target Makefile Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 22/24] libcacard Makefile cleanups Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 23/24] limit usage of vpath Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 24/24] compile oslib-obj-y once Paolo Bonzini
2012-06-03 13:31 ` [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Blue Swirl
2012-06-03 17:34   ` Paolo Bonzini
2012-06-03 22:40 ` Andreas Färber
2012-06-03 22:57   ` Anthony Liguori
2012-06-04  6:36     ` Paolo Bonzini
2012-06-04 18:52       ` Lluís Vilanova
2012-06-04 18:58         ` Eric Blake
2012-06-05 14:05           ` Paolo Bonzini
2012-06-03 22:55 ` Anthony Liguori [this message]
2012-06-04 16:02 ` Lluís Vilanova

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=4FCBEB66.7090504@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).