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

[XEN PATCH v4 00/32] Toolstack build system improvement, toward non-recursive makefiles


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Thu, 11 Aug 2022 17:48:13 +0100
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Anthony PERARD <anthony.perard@xxxxxxxxxx>, Nick Rosbrook <rosbrookn@xxxxxxxxx>, Elena Ufimtseva <elena.ufimtseva@xxxxxxxxxx>, "Andrew Cooper" <andrew.cooper3@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, David Scott <dave@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Christian Lindig <christian.lindig@xxxxxxxxxx>, "Wei Liu" <wl@xxxxxxx>, Tim Deegan <tim@xxxxxxx>, "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 11 Aug 2022 16:49:10 +0000
  • Ironport-data: A9a23:9v+mx68icNaWz2tKd6XrDrUDFH6TJUtcMsCJ2f8bNWPcYEJGY0x3m GAbXjqCO6uINGX3ftwkbN6ypBsD7ZHVm9FiGwtu/388E34SpcT7XtnIdU2Y0wF+jyHgoOCLy +1EN7Es+ehtFie0Si+Fa+Sn9z8kvU2xbuKUIPbePSxsThNTRi4kiBZy88Y0mYctitWia++3k YqaT/b3ZRn0gFaYDkpOs/jZ8EM25ayo0N8llgdWic5j7Qe2e0Y9VPrzFYnpR1PkT49dGPKNR uqr5NlVKUuAon/Bovv8+lrKWhViroz6ZGBiuVIPM0SWuTBQpzRa70oOHKF0hXG7Kdm+t4sZJ N1l7fRcQOqyV0HGsLx1vxJwS0mSMUD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RekIh+bfKlXbakrDH4VmtJ uIHZIQNDSJNykZsfrH
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Patch series available in this git branch:
https://xenbits.xen.org/git-http/people/aperard/xen-unstable.git 
br.toolstack-build-system-v4

Changes in v4:
- several new patches
- some changes to other patches listed in their changelogs

Changes in v3:
- rebased
- several new patches, starting with 13/25 "tools/libs/util: cleanup Makefile"
- introducing macros to deal with linking with in-tree xen libraries
- Add -Werror to CFLAGS for all builds in tools/

Changes in v2:
- one new patch
- other changes described in patch notes

Hi everyone,

I've been looking at reworking the build system we have for the "tools/", and
transforming it to something that suit it better. There are a lot of
dependencies between different sub-directories so it would be nice if GNU make
could actually handle them. This is possible with "non-recursive makefiles".

With non-recursive makefiles, make will have to load/include all the makefiles
and thus will have complete overview of all the dependencies. This will allow
make to build the necessary targets in other directory, and we won't need to
build sub-directories one by one.

To help with this transformation, I've chosen to go with a recent project
called "subdirmk". It help to deal with the fact that all makefiles will share
the same namespace, it is hooked into autoconf, we can easily run `make` from
any subdirectory. Together "autoconf" and "subdirmk" will also help to get
closer to be able to do out-of-tree build of the tools, but I'm mainly looking
to have non-recursive makefile.

Link to the project:
    https://www.chiark.greenend.org.uk/ucgi/~ian/git/subdirmk.git/

But before getting to the main course, I've got quite a few cleanup and some
changes to the makefiles. I start the patch series with patches that remove old
left over stuff, then start reworking makefiles. They are some common changes 
like
removing the "build" targets in many places as "all" would be the more common
way to spell it and "all" is the default target anyway. They are other changes
related to the conversion to "subdirmk", I start to use the variable $(TARGETS)
in several makefiles, this variable will have a special meaning in subdirmk
which will build those target by default.

As for the conversion to non-recursive makefile, with subdirmk, I have this WIP
branch, it contains some changes that I'm trying out, some notes, and the
conversion, one Makefile per commit. Cleanup are still needed, some makefile
not converted yet, but it's otherwise mostly done.

    https://xenbits.xen.org/git-http/people/aperard/xen-unstable.git 
br.toolstack-build-system-v1-wip-extra

With that branch, you could tried something like:
    ./configure; cd tools/xl; make
and `xl` should be built as well as all the xen library needed.
Also, things like `make clean` or rebuild should be faster in the all tools/
directory.

Cheers,

Anthony PERARD (32):
  tools/debugger/gdbsx: Fix and cleanup makefiles
  tools/firmware/hvmloader: rework Makefile
  tools/fuzz/x86_instruction_emulator: rework makefile
  tools/hotplug: cleanup Makefiles
  tools/libfsimage: Cleanup makefiles
  tools/xenpaging: Rework makefile
  tools/xentop: rework makefile
  tools/xentrace: rework Makefile
  .gitignore: Cleanup ignores of tools/libs/*/{headers.chk,*.pc}
  tools/libs/util: cleanup Makefile
  tools/flask/utils: list build targets in $(TARGETS)
  libs/libs.mk: Rename $(LIB) to $(TARGETS)
  libs/libs.mk: Remove the need for $(PKG_CONFIG_INST)
  libs/libs.mk: Rework target headers.chk dependencies
  tools: Introduce $(xenlibs-rpath,..) to replace $(SHDEPS_lib*)
  tools: Introduce $(xenlibs-ldlibs, ) macro
  tools: Introduce $(xenlibs-ldflags, ) macro
  tools/helper: Cleanup Makefile
  tools/console: Use $(xenlibs-ldlibs,)
  tools: Add -Werror by default to all tools/
  tools: Remove -Werror everywhere else
  tools/hotplug: Generate "hotplugpath.sh" with configure
  libs/light/gentypes.py: allow to generate headers in subdirectory
  git-checkout.sh: handle running git-checkout from a different
    directory
  libs: Avoid exposing -Wl,--version-script to other built library
  libs: Fix auto-generation of version-script for unstable libs
  tools/include: Rework Makefile
  libs/light: Rework acpi table build targets
  libs/light: Rework generation of include/_libxl_*.h
  libs/light: Rework targets prerequisites
  libs/light: Makefile cleanup
  tools/golang/xenlight: Rework gengotypes.py and generation of *.gen.go

 tools/configure.ac                            |  2 +
 tools/Makefile                                |  2 +-
 tools/console/client/Makefile                 |  4 +-
 tools/console/daemon/Makefile                 |  7 +-
 tools/debugger/gdbsx/Makefile                 | 20 +++---
 tools/debugger/gdbsx/gx/Makefile              | 15 ++--
 tools/debugger/gdbsx/xg/Makefile              | 25 ++-----
 tools/debugger/kdd/Makefile                   |  1 -
 tools/firmware/hvmloader/Makefile             | 19 +++--
 tools/flask/utils/Makefile                    | 11 ++-
 tools/fuzz/cpu-policy/Makefile                |  2 +-
 tools/fuzz/x86_instruction_emulator/Makefile  | 35 +++++----
 tools/golang/xenlight/Makefile                |  8 ++-
 tools/helpers/Makefile                        | 23 +++---
 tools/hotplug/FreeBSD/Makefile                | 11 +--
 tools/hotplug/Linux/Makefile                  | 16 ++---
 tools/hotplug/Linux/systemd/Makefile          | 16 ++---
 tools/hotplug/NetBSD/Makefile                 |  9 +--
 tools/hotplug/common/Makefile                 | 20 ++----
 tools/include/Makefile                        | 28 ++++----
 tools/libfsimage/common/Makefile              | 11 +--
 tools/libfsimage/ext2fs-lib/Makefile          |  9 ---
 tools/libfsimage/ext2fs/Makefile              |  9 ---
 tools/libfsimage/fat/Makefile                 |  9 ---
 tools/libfsimage/iso9660/Makefile             | 11 ---
 tools/libfsimage/reiserfs/Makefile            |  9 ---
 tools/libfsimage/ufs/Makefile                 |  9 ---
 tools/libfsimage/xfs/Makefile                 |  9 ---
 tools/libfsimage/zfs/Makefile                 |  9 ---
 tools/libs/call/Makefile                      |  1 +
 tools/libs/ctrl/Makefile                      |  3 -
 tools/libs/devicemodel/Makefile               |  1 +
 tools/libs/evtchn/Makefile                    |  1 +
 tools/libs/foreignmemory/Makefile             |  1 +
 tools/libs/gnttab/Makefile                    |  1 +
 tools/libs/guest/Makefile                     |  3 -
 tools/libs/hypfs/Makefile                     |  1 +
 tools/libs/light/Makefile                     | 72 +++++++++++--------
 tools/libs/stat/Makefile                      |  2 +-
 tools/libs/store/Makefile                     |  1 +
 tools/libs/toolcore/Makefile                  |  1 +
 tools/libs/toollog/Makefile                   |  1 +
 tools/libs/util/Makefile                      |  6 +-
 tools/libs/vchan/Makefile                     |  3 -
 tools/misc/Makefile                           |  1 -
 tools/tests/cpu-policy/Makefile               |  2 +-
 tools/tests/depriv/Makefile                   |  2 +-
 tools/tests/resource/Makefile                 |  1 -
 tools/tests/tsx/Makefile                      |  1 -
 tools/tests/xenstore/Makefile                 |  1 -
 tools/xcutils/Makefile                        |  2 -
 tools/xenmon/Makefile                         |  1 -
 tools/xenpaging/Makefile                      | 25 ++++---
 tools/xenpmd/Makefile                         |  1 -
 tools/xentop/Makefile                         | 23 +++---
 tools/xentrace/Makefile                       | 29 +++-----
 tools/xl/Makefile                             |  2 +-
 tools/Rules.mk                                | 55 ++++++++++----
 tools/debugger/gdbsx/Rules.mk                 |  2 +-
 tools/firmware/Rules.mk                       |  2 -
 tools/libfsimage/Rules.mk                     | 26 +++----
 tools/libfsimage/common.mk                    | 11 +++
 tools/libs/libs.mk                            | 48 +++++++------
 tools/libs/light/libxl_x86_acpi.c             |  2 +-
 tools/ocaml/common.make                       |  2 +-
 .gitignore                                    | 38 ----------
 config/Tools.mk.in                            |  1 +
 scripts/git-checkout.sh                       |  4 +-
 tools/configure                               | 29 +++++++-
 .../fuzz/x86_instruction_emulator/.gitignore  |  7 ++
 tools/golang/xenlight/gengotypes.py           | 10 ++-
 tools/hotplug/common/hotplugpath.sh.in        | 16 +++++
 tools/libs/.gitignore                         |  2 +
 tools/libs/light/gentypes.py                  |  9 ++-
 tools/xenstore/Makefile.common                |  1 -
 75 files changed, 371 insertions(+), 442 deletions(-)
 create mode 100644 tools/libfsimage/common.mk
 create mode 100644 tools/fuzz/x86_instruction_emulator/.gitignore
 create mode 100644 tools/hotplug/common/hotplugpath.sh.in

-- 
Anthony PERARD




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.