All of lore.kernel.org
 help / color / mirror / Atom feed
* [XEN PATCH v3 00/25] Toolstack build system improvement, toward non-recursive makefiles
@ 2022-06-24 16:03 Anthony PERARD
  2022-06-24 16:03 ` [XEN PATCH v3 01/25] tools/console: have one Makefile per program/directory Anthony PERARD
                   ` (25 more replies)
  0 siblings, 26 replies; 73+ messages in thread
From: Anthony PERARD @ 2022-06-24 16:03 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Daniel P. Smith, Juergen Gross, Christian Lindig,
	Daniel De Graaf, George Dunlap, Andrew Cooper, Jan Beulich,
	David Scott, Stefano Stabellini, Tim Deegan, Wei Liu,
	Julien Grall, Elena Ufimtseva, Nick Rosbrook,
	Roger Pau Monné

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

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 (25):
  tools/console: have one Makefile per program/directory
  tools/debugger/gdbsx: Fix and cleanup makefiles
  tools/examples: cleanup Makefile
  tools/firmware/hvmloader: rework Makefile
  tools/fuzz/libelf: 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/helpers: Fix build of xen-init-dom0 with -Werror
  tools: Add -Werror by default to all tools/
  tools: Remove -Werror everywhere else

 tools/configure.ac                            |  1 +
 tools/Makefile                                |  2 +-
 tools/console/Makefile                        | 49 +----------------
 tools/console/client/Makefile                 | 37 +++++++++++++
 tools/console/daemon/Makefile                 | 45 +++++++++++++++
 tools/debugger/gdbsx/Makefile                 | 20 +++----
 tools/debugger/gdbsx/gx/Makefile              | 15 +++--
 tools/debugger/gdbsx/xg/Makefile              | 25 +++------
 tools/debugger/kdd/Makefile                   |  1 -
 tools/examples/Makefile                       | 25 ++-------
 tools/firmware/hvmloader/Makefile             | 16 +++---
 tools/flask/utils/Makefile                    | 11 ++--
 tools/fuzz/cpu-policy/Makefile                |  2 +-
 tools/fuzz/libelf/Makefile                    | 21 ++++---
 tools/fuzz/x86_instruction_emulator/Makefile  | 32 +++++------
 tools/golang/xenlight/Makefile                |  2 +-
 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                 | 16 ++----
 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/util/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                       | 21 +++----
 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                            | 31 +++++------
 tools/helpers/xen-init-dom0.c                 |  2 +
 tools/ocaml/common.make                       |  2 +-
 .gitignore                                    | 35 ------------
 config/Tools.mk.in                            |  1 +
 tools/configure                               | 26 +++++++++
 tools/console/client/.gitignore               |  1 +
 tools/console/daemon/.gitignore               |  1 +
 tools/fuzz/libelf/.gitignore                  |  2 +
 .../fuzz/x86_instruction_emulator/.gitignore  |  7 +++
 tools/libs/.gitignore                         |  2 +
 tools/xenstore/Makefile.common                |  1 -
 62 files changed, 349 insertions(+), 424 deletions(-)
 create mode 100644 tools/console/client/Makefile
 create mode 100644 tools/console/daemon/Makefile
 create mode 100644 tools/libfsimage/common.mk
 create mode 100644 tools/console/client/.gitignore
 create mode 100644 tools/console/daemon/.gitignore
 create mode 100644 tools/fuzz/libelf/.gitignore
 create mode 100644 tools/fuzz/x86_instruction_emulator/.gitignore

-- 
Anthony PERARD



^ permalink raw reply	[flat|nested] 73+ messages in thread

end of thread, other threads:[~2022-08-08 15:35 UTC | newest]

Thread overview: 73+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-24 16:03 [XEN PATCH v3 00/25] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
2022-06-24 16:03 ` [XEN PATCH v3 01/25] tools/console: have one Makefile per program/directory Anthony PERARD
2022-07-08 15:08   ` Luca Fancellu
2022-06-24 16:03 ` [XEN PATCH v3 02/25] tools/debugger/gdbsx: Fix and cleanup makefiles Anthony PERARD
2022-07-08 15:23   ` Luca Fancellu
2022-06-24 16:04 ` [XEN PATCH v3 03/25] tools/examples: cleanup Makefile Anthony PERARD
2022-07-08 15:31   ` Luca Fancellu
2022-06-24 16:04 ` [XEN PATCH v3 04/25] tools/firmware/hvmloader: rework Makefile Anthony PERARD
2022-07-08 15:39   ` Luca Fancellu
2022-07-11 13:38     ` Anthony PERARD
2022-07-11 13:40       ` Luca Fancellu
2022-07-11 13:41     ` Jan Beulich
2022-07-11 13:52   ` Jan Beulich
2022-07-11 17:01     ` Anthony PERARD
2022-06-24 16:04 ` [XEN PATCH v3 05/25] tools/fuzz/libelf: rework makefile Anthony PERARD
2022-07-11 11:23   ` Luca Fancellu
2022-06-24 16:04 ` [XEN PATCH v3 06/25] tools/fuzz/x86_instruction_emulator: " Anthony PERARD
2022-07-11 13:16   ` Luca Fancellu
2022-07-11 14:08   ` Jan Beulich
2022-08-02 17:09     ` Anthony PERARD
2022-08-03  5:56       ` Jan Beulich
2022-08-03 10:15         ` Anthony PERARD
2022-06-24 16:04 ` [XEN PATCH v3 07/25] tools/hotplug: cleanup Makefiles Anthony PERARD
2022-07-22 11:02   ` Luca Fancellu
2022-06-24 16:04 ` [XEN PATCH v3 08/25] tools/libfsimage: Cleanup makefiles Anthony PERARD
2022-07-22 12:07   ` Luca Fancellu
2022-06-24 16:04 ` [XEN PATCH v3 09/25] tools/xenpaging: Rework makefile Anthony PERARD
2022-07-22 12:17   ` Luca Fancellu
2022-06-24 16:04 ` [XEN PATCH v3 10/25] tools/xentop: rework makefile Anthony PERARD
2022-07-22 13:13   ` Luca Fancellu
2022-06-24 16:04 ` [XEN PATCH v3 11/25] tools/xentrace: rework Makefile Anthony PERARD
2022-07-22 13:30   ` Luca Fancellu
2022-08-08 15:35     ` Anthony PERARD
2022-06-24 16:04 ` [XEN PATCH v3 12/25] .gitignore: Cleanup ignores of tools/libs/*/{headers.chk,*.pc} Anthony PERARD
2022-06-29 10:15   ` Juergen Gross
2022-07-05 13:17   ` Bertrand Marquis
2022-06-24 16:04 ` [XEN PATCH v3 13/25] tools/libs/util: cleanup Makefile Anthony PERARD
2022-06-29 10:18   ` Juergen Gross
2022-07-05 13:20   ` Bertrand Marquis
2022-06-24 16:04 ` [XEN PATCH v3 14/25] tools/flask/utils: list build targets in $(TARGETS) Anthony PERARD
2022-07-12  1:30   ` Henry Wang
2022-06-24 16:04 ` [XEN PATCH v3 15/25] libs/libs.mk: Rename $(LIB) to $(TARGETS) Anthony PERARD
2022-06-29 10:19   ` Juergen Gross
2022-07-05 13:21   ` Bertrand Marquis
2022-06-24 16:04 ` [XEN PATCH v3 16/25] libs/libs.mk: Remove the need for $(PKG_CONFIG_INST) Anthony PERARD
2022-06-29 10:22   ` Juergen Gross
2022-07-05 13:27   ` Bertrand Marquis
2022-06-24 16:04 ` [XEN PATCH v3 17/25] libs/libs.mk: Rework target headers.chk dependencies Anthony PERARD
2022-06-29 10:23   ` Juergen Gross
2022-07-05 13:29   ` Bertrand Marquis
2022-06-24 16:04 ` [XEN PATCH v3 18/25] tools: Introduce $(xenlibs-rpath,..) to replace $(SHDEPS_lib*) Anthony PERARD
2022-06-29 10:26   ` Juergen Gross
2022-06-24 16:04 ` [XEN PATCH v3 19/25] tools: Introduce $(xenlibs-ldlibs, ) macro Anthony PERARD
2022-06-29 10:29   ` Juergen Gross
2022-06-24 16:04 ` [XEN PATCH v3 20/25] tools: Introduce $(xenlibs-ldflags, " Anthony PERARD
2022-07-12  1:40   ` Henry Wang
2022-06-24 16:04 ` [XEN PATCH v3 21/25] tools/helper: Cleanup Makefile Anthony PERARD
2022-07-22 14:06   ` Luca Fancellu
2022-06-24 16:04 ` [XEN PATCH v3 22/25] tools/console: Use $(xenlibs-ldlibs,) Anthony PERARD
2022-07-22 14:15   ` Luca Fancellu
2022-06-24 16:04 ` [XEN PATCH v3 23/25] tools/helpers: Fix build of xen-init-dom0 with -Werror Anthony PERARD
2022-07-12  1:31   ` Henry Wang
2022-06-24 16:04 ` [XEN PATCH v3 24/25] tools: Add -Werror by default to all tools/ Anthony PERARD
2022-07-22 14:31   ` Luca Fancellu
2022-06-24 16:04 ` [XEN PATCH v3 25/25] tools: Remove -Werror everywhere else Anthony PERARD
2022-06-29  8:59   ` Luca Fancellu
2022-06-29 17:22     ` Stefano Stabellini
2022-06-30  7:33       ` Bertrand Marquis
2022-06-30 21:03         ` Stefano Stabellini
2022-07-01 13:26           ` Bertrand Marquis
2022-07-01 17:47             ` Stefano Stabellini
2022-06-29 10:31   ` Juergen Gross
2022-06-27  7:25 ` [XEN PATCH v3 00/25] Toolstack build system improvement, toward non-recursive makefiles Christian Lindig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.