Skip to content

Toolstack build system improvement, toward non-recursive makefiles

Anthony PERARD xen-devel 6 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest5 patches 9 repliesIn review
  2. v517 patches 21 repliesSuperseded
  3. v432 patches 15 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v325 patches47 repliesSuperseded
v229 patches10 repliesSuperseded
v157 patches57 repliesSuperseded

Changes in v6 from the cover letter

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

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5libs: Fix auto-generation of version-script for unstable libs.gitignore tools/libs/call/Makefile tools/libs/ctrl/Makefile +14 more+14 -261 reply
2/5libs/light: Rework targets prerequisitestools/libs/light/Makefile+16 -123 replies
3/5libs/light: Makefile cleanuptools/libs/light/Makefile tools/libs/light/libxl_x86_acpi.c+8 -101 reply
4/5tools: Introduce macro $(xenlibs-cflags,) and introduce $(USELIBS) in subdirstools/Rules.mk tools/console/client/Makefile tools/console/daemon/Makefile +1 more+23 -260 replies
5/5tools: Rework $(xenlibs-ldlibs, ) to provide library flags only.tools/Rules.mk tools/console/client/Makefile tools/console/daemon/Makefile +3 more+14 -103 replies
5/5tools: Rework $(xenlibs-ldlibs, ) to provide library flags only.tools/Rules.mk tools/console/client/Makefile tools/console/daemon/Makefile +3 more+14 -100 replies

Reviews trailers per patch

5 of 6 patches have a Reviewed-by or Acked-by.

PatchAndrew CooperJuergen Gross
1/5A-b
2/5R-b
3/5R-b
4/5
5/5R-b R-b
5/5R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

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

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(-)
Signature · 1 line
Anthony PERARD