[XEN PATCH for-4.17 v6 0/5] Toolstack build system improvement, toward non-recursive makefiles

Anthony PERARD posted 5 patches 1 year, 3 months ago
Test gitlab-ci passed
Failed in applying to current master (apply log)
tools/console/client/Makefile     |  8 ++++--
tools/console/daemon/Makefile     | 11 ++++----
tools/helpers/Makefile            | 29 ++++++++-----------
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         | 47 ++++++++++++++++---------------
tools/libs/stat/Makefile          |  2 +-
tools/libs/store/Makefile         |  1 +
tools/libs/toolcore/Makefile      |  1 +
tools/libs/toollog/Makefile       |  1 +
tools/libs/util/Makefile          |  3 --
tools/libs/vchan/Makefile         |  3 --
tools/Rules.mk                    | 22 +++++++++------
tools/libs/libs.mk                | 11 ++++----
tools/libs/light/libxl_x86_acpi.c |  2 +-
.gitignore                        |  6 ----
22 files changed, 75 insertions(+), 84 deletions(-)
[XEN PATCH for-4.17 v6 0/5] Toolstack build system improvement, toward non-recursive makefiles
Posted by Anthony PERARD 1 year, 3 months ago
Patch series available in this git branch:
https://xenbits.xen.org/git-http/people/aperard/xen-unstable.git br.toolstack-build-system-v6

Changes in v6:
- For unstable libs, use --default-symver instead of a generated
  version-script.
- Two new patches to deal with $(xenlibs-*,) macros.
- Second patch description reworded.

Changes in v5:
- rebased on staging
- added "tools: Rework linking options for ocaml binding libraries"

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 (5):
  libs: Fix auto-generation of version-script for unstable libs
  libs/light: Rework targets prerequisites
  libs/light: Makefile cleanup
  tools: Introduce macro $(xenlibs-cflags,) and introduce $(USELIBS) in
    subdirs
  tools: Rework $(xenlibs-ldlibs, ) to provide library flags only.

 tools/console/client/Makefile     |  8 ++++--
 tools/console/daemon/Makefile     | 11 ++++----
 tools/helpers/Makefile            | 29 ++++++++-----------
 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         | 47 ++++++++++++++++---------------
 tools/libs/stat/Makefile          |  2 +-
 tools/libs/store/Makefile         |  1 +
 tools/libs/toolcore/Makefile      |  1 +
 tools/libs/toollog/Makefile       |  1 +
 tools/libs/util/Makefile          |  3 --
 tools/libs/vchan/Makefile         |  3 --
 tools/Rules.mk                    | 22 +++++++++------
 tools/libs/libs.mk                | 11 ++++----
 tools/libs/light/libxl_x86_acpi.c |  2 +-
 .gitignore                        |  6 ----
 22 files changed, 75 insertions(+), 84 deletions(-)

-- 
Anthony PERARD
Re: [XEN PATCH v6 0/5] Toolstack build system improvement, toward non-recursive makefiles
Posted by Anthony PERARD 1 year, 3 months ago
The "for-4.17" in the subject is a mistake, the series is for staging.

It is just left over from the last time I've sent the series.

Cheers,

-- 
Anthony PERARD