All of lore.kernel.org
 help / color / mirror / Atom feed
* [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles
@ 2021-12-06 17:01 Anthony PERARD
  2021-12-06 17:01 ` [XEN PATCH 01/57] .gitignore: Non existing toolcore/include files Anthony PERARD
                   ` (56 more replies)
  0 siblings, 57 replies; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:01 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, David Scott, Ian Jackson,
	Jan Beulich, Christian Lindig, Daniel P. Smith,
	Stefano Stabellini, Samuel Thibault, Daniel De Graaf,
	Andrew Cooper, Elena Ufimtseva, Juergen Gross, George Dunlap,
	Roger Pau Monné,
	Julien Grall, Wei Liu

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

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.

stubdom has some changes also as it won't be able to use tools/ Makefiles
as-is anymore.

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 (57):
  .gitignore: Non existing toolcore/include files.
  tools/configure.ac: Remove left over system_aio
  tools/Rules.mk: Remove $(CFLAGS.opic) from %.opic: %.S
  libs: Remove _paths.h from libs ctrl and util.
  libs: Remove -Iinclude from CFLAGS
  libs/libs.mk: Remove generic variable that already exist
  libs/guest: Drop spurious include in Makefile
  libs/light: Remove non-existing CFLAGS_libxl.o var
  libs/light: Remove -I.
  libs/stat: Remove duplicated CFLAGS from deps
  libs/store: Remove PKG_CONFIG_REMOVE
  tools: remove some unneeded subdir-distclean-* targets
  tools/firmware/hvmloader: remove "subdirs-*" prerequisite
  tools/flask/utils: remove unused variables/targets from Makefile
  tools/libacpi: cleanup Makefile, don't check for iasl binary
  tools/ocaml: Remove generation of _paths.h
  tools/xl: Remove unnecessary -I. from CFLAGS
  tools: Use config.h from autoconf instead of "buildmakevars2header"
  tools/configure.ac: Create ZLIB_LIBS and ZLIB_CFLAGS
  tools/Rules.mk: introduce FORCE target
  tools/include/xen-foreign: avoid to rely on default .SUFFIXES
  tools/console: have one Makefile per program/directory
  tools/debugger: Allow make to recurse into debugger/
  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/helper: Cleanup Makefile
  tools/hotplug: cleanup Makefiles
  tools/libfsimage: Cleanup makefiles
  tools/misc: rework Makefile
  tools/vchan: Collect targets in TARGETS
  tools/xcutils: rework Makefile
  tools/xenpaging: Rework makefile
  tools/xenstore: Cleanup makefile
  tools/xentop: rework makefile
  tools/xenstrace: rework Makefile
  libs: Remove both "libs" and "build" target
  libs: rename LDUSELIBS to LDLIBS and use it instead of APPEND_LDFLAGS
  libs: Remove need for *installlocal targets
  libs,tools/include: Clean "clean" targets
  libs: Rename $(SRCS-y) to $(OBJS-y)
  libs/guest: rename ELF_OBJS to LIBELF_OBJS
  libs/guest: rework CFLAGS
  libs/store: use of -iquote instead of -I
  libs/stat: Fix and rework python-bindings build
  libs/stat: Fix and rework perl-binding build
  libs/toolcore: don't install xentoolcore_internal.h anymore
  tools/Rules.mk: Cleanup %.pc rules
  .gitignore: Cleanup ignores of tools/libs/*/{headers.chk,*.pc}
  stubdom: only build libxen*.a from tools/libs/
  stubdom: introduce xenlibs.mk
  tools/libs: create Makefile.common to be used by stubdom build system
  tools/xenstore: introduce Makefile.common to be used by stubdom
  stubdom: build xenstore*-stubdom using new Makefile.common
  stubdom: xenlibs linkfarm, ignore non-regular files

 tools/configure.ac                           |  20 +-
 Config.mk                                    |   9 -
 stubdom/xenlibs.mk                           |  13 ++
 tools/Rules.mk                               |   9 +-
 tools/libfsimage/Rules.mk                    |  26 +--
 tools/libfsimage/common.mk                   |  11 +
 tools/libs/libs.mk                           |  36 +--
 .gitignore                                   |  44 +---
 config/Tools.mk.in                           |   3 +-
 configure                                    |  45 ++++
 docs/configure                               |  45 ++++
 m4/paths.m4                                  |   9 +
 stubdom/Makefile                             |  26 ++-
 tools/Makefile                               |  32 +--
 tools/config.h.in                            |  27 +++
 tools/configure                              |  67 +++++-
 tools/console/Makefile                       |  57 +----
 tools/console/client/Makefile                |  39 ++++
 tools/console/client/main.c                  |   1 -
 tools/console/daemon/Makefile                |  50 +++++
 tools/console/daemon/main.c                  |   1 -
 tools/debugger/Makefile                      |   8 +
 tools/debugger/gdbsx/Makefile                |  20 +-
 tools/debugger/gdbsx/gx/Makefile             |  15 +-
 tools/debugger/gdbsx/xg/Makefile             |  25 +--
 tools/examples/Makefile                      |  21 +-
 tools/firmware/Makefile                      |   3 -
 tools/firmware/hvmloader/Makefile            |  18 +-
 tools/flask/utils/Makefile                   |  16 +-
 tools/fuzz/libelf/Makefile                   |  21 +-
 tools/fuzz/x86_instruction_emulator/Makefile |  32 ++-
 tools/helpers/Makefile                       |  31 +--
 tools/helpers/init-xenstore-domain.c         |   1 -
 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/include/Makefile                       |   1 +
 tools/include/xen-foreign/Makefile           |   9 +-
 tools/libacpi/Makefile                       |  17 +-
 tools/libacpi/README                         |   6 -
 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                     |   7 +-
 tools/libs/call/Makefile.common              |   6 +
 tools/libs/ctrl/Makefile                     |  55 +----
 tools/libs/ctrl/Makefile.common              |  44 ++++
 tools/libs/ctrl/xc_private.h                 |   2 -
 tools/libs/devicemodel/Makefile              |   7 +-
 tools/libs/devicemodel/Makefile.common       |   6 +
 tools/libs/evtchn/Makefile                   |   7 +-
 tools/libs/evtchn/Makefile.common            |   6 +
 tools/libs/foreignmemory/Makefile            |   7 +-
 tools/libs/foreignmemory/Makefile.common     |   6 +
 tools/libs/gnttab/Makefile                   |   9 +-
 tools/libs/gnttab/Makefile.common            |   8 +
 tools/libs/guest/Makefile                    | 109 +--------
 tools/libs/guest/Makefile.common             |  84 +++++++
 tools/libs/guest/xg_dom_core.c               |   1 -
 tools/libs/guest/xg_offline_page.c           |   2 +-
 tools/libs/hypfs/Makefile                    |   4 +-
 tools/libs/light/Makefile                    | 222 +++++++++----------
 tools/libs/light/libxl_dom.c                 |   2 -
 tools/libs/light/libxl_internal.h            |   1 -
 tools/libs/light/libxl_utils.c               |   1 -
 tools/libs/stat/Makefile                     |  70 +++---
 tools/libs/stat/bindings/swig/perl/.empty    |   1 -
 tools/libs/stat/bindings/swig/python/.empty  |   1 -
 tools/libs/stat/xenstat_qmp.c                |   1 -
 tools/libs/store/Makefile                    |  20 +-
 tools/libs/toolcore/Makefile                 |  10 +-
 tools/libs/toolcore/Makefile.common          |   9 +
 tools/libs/toollog/Makefile                  |   3 +-
 tools/libs/toollog/Makefile.common           |   2 +
 tools/libs/util/Makefile                     |  27 +--
 tools/libs/vchan/Makefile                    |   9 +-
 tools/misc/Makefile                          |  16 +-
 tools/ocaml/xenstored/Makefile               |   7 -
 tools/ocaml/xenstored/systemd_stubs.c        |   2 -
 tools/vchan/Makefile                         |   6 +-
 tools/xcutils/Makefile                       |  15 +-
 tools/xenpaging/Makefile                     |  24 +-
 tools/xenstore/Makefile                      |  83 +++----
 tools/xenstore/Makefile.common               |  34 +++
 tools/xentop/Makefile                        |  19 +-
 tools/xentrace/Makefile                      |  11 +-
 tools/xl/Makefile                            |   9 +-
 tools/xl/xl.h                                |   1 -
 96 files changed, 953 insertions(+), 990 deletions(-)
 create mode 100644 stubdom/xenlibs.mk
 create mode 100644 tools/libfsimage/common.mk
 create mode 100644 tools/console/client/Makefile
 create mode 100644 tools/console/daemon/Makefile
 create mode 100644 tools/debugger/Makefile
 create mode 100644 tools/libs/call/Makefile.common
 create mode 100644 tools/libs/ctrl/Makefile.common
 create mode 100644 tools/libs/devicemodel/Makefile.common
 create mode 100644 tools/libs/evtchn/Makefile.common
 create mode 100644 tools/libs/foreignmemory/Makefile.common
 create mode 100644 tools/libs/gnttab/Makefile.common
 create mode 100644 tools/libs/guest/Makefile.common
 delete mode 100644 tools/libs/stat/bindings/swig/perl/.empty
 delete mode 100644 tools/libs/stat/bindings/swig/python/.empty
 create mode 100644 tools/libs/toolcore/Makefile.common
 create mode 100644 tools/libs/toollog/Makefile.common
 create mode 100644 tools/xenstore/Makefile.common

-- 
Anthony PERARD



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

* [XEN PATCH 01/57] .gitignore: Non existing toolcore/include files.
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
@ 2021-12-06 17:01 ` Anthony PERARD
  2021-12-06 17:01 ` [XEN PATCH 02/57] tools/configure.ac: Remove left over system_aio Anthony PERARD
                   ` (55 subsequent siblings)
  56 siblings, 0 replies; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:01 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Andrew Cooper, George Dunlap,
	Ian Jackson, Jan Beulich, Julien Grall, Stefano Stabellini,
	Wei Liu

4664034cdc (tools/libs: move official headers to common directory)
forgot one .gitignore update.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 .gitignore | 1 -
 1 file changed, 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index 9513506dd9..cad5aacd8d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -384,7 +384,6 @@ tools/include/xen-foreign/arm64.h
 .git
 tools/misc/xen-hptool
 tools/misc/xen-mfndump
-tools/libs/toolcore/include/_*.h
 tools/firmware/etherboot/eb-roms.h
 tools/firmware/etherboot/gpxe-git-snapshot.tar.gz
 tools/misc/xenhypfs
-- 
Anthony PERARD



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

* [XEN PATCH 02/57] tools/configure.ac: Remove left over system_aio
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
  2021-12-06 17:01 ` [XEN PATCH 01/57] .gitignore: Non existing toolcore/include files Anthony PERARD
@ 2021-12-06 17:01 ` Anthony PERARD
  2021-12-06 17:01 ` [XEN PATCH 03/57] tools/Rules.mk: Remove $(CFLAGS.opic) from %.opic: %.S Anthony PERARD
                   ` (54 subsequent siblings)
  56 siblings, 0 replies; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:01 UTC (permalink / raw)
  To: xen-devel; +Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu

system_aio isn't set since 3d4678108a (tools: remove in tree libaio).

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/configure.ac | 1 -
 tools/configure    | 2 --
 2 files changed, 3 deletions(-)

diff --git a/tools/configure.ac b/tools/configure.ac
index 3ac62626a5..5a4fb9022d 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -402,7 +402,6 @@ AC_CHECK_LIB([lzo2], [lzo1x_decompress], [zlib="$zlib -DHAVE_LZO1X -llzo2"])
 PKG_CHECK_MODULES([libzstd], [libzstd],
     [zlib="$zlib -DHAVE_ZSTD $libzstd_CFLAGS $libzstd_LIBS"], [true])
 AC_SUBST(zlib)
-AC_SUBST(system_aio)
 AX_CHECK_EXTFS
 AX_CHECK_PTHREAD
 AX_CHECK_PTYFUNCS
diff --git a/tools/configure b/tools/configure
index 21e3a83795..8e4a59c2cb 100755
--- a/tools/configure
+++ b/tools/configure
@@ -641,7 +641,6 @@ PTHREAD_LIBS
 PTHREAD_LDFLAGS
 PTHREAD_CFLAGS
 EXTFS_LIBS
-system_aio
 zlib
 libzstd_LIBS
 libzstd_CFLAGS
@@ -8772,7 +8771,6 @@ $as_echo "yes" >&6; }
 fi
 
 
-
 ac_fn_c_check_header_mongrel "$LINENO" "ext2fs/ext2fs.h" "ac_cv_header_ext2fs_ext2fs_h" "$ac_includes_default"
 if test "x$ac_cv_header_ext2fs_ext2fs_h" = xyes; then :
 
-- 
Anthony PERARD



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

* [XEN PATCH 03/57] tools/Rules.mk: Remove $(CFLAGS.opic) from %.opic: %.S
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
  2021-12-06 17:01 ` [XEN PATCH 01/57] .gitignore: Non existing toolcore/include files Anthony PERARD
  2021-12-06 17:01 ` [XEN PATCH 02/57] tools/configure.ac: Remove left over system_aio Anthony PERARD
@ 2021-12-06 17:01 ` Anthony PERARD
  2021-12-06 17:01 ` [XEN PATCH 04/57] libs: Remove _paths.h from libs ctrl and util Anthony PERARD
                   ` (53 subsequent siblings)
  56 siblings, 0 replies; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:01 UTC (permalink / raw)
  To: xen-devel; +Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu

$(CFLAGS.opic) isn't set anywere, never was, just remove it.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/Rules.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/Rules.mk b/tools/Rules.mk
index b022da3336..4e9b4ee17f 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -155,7 +155,7 @@ INSTALL_PYTHON_PROG = \
 %.o: %.S
 	$(CC) $(CFLAGS) $(CFLAGS_$*.o) -c $< -o $@ $(APPEND_CFLAGS)
 %.opic: %.S
-	$(CC) $(CPPFLAGS) -DPIC $(CFLAGS) $(CFLAGS.opic) -fPIC -c -o $@ $< $(APPEND_CFLAGS)
+	$(CC) $(CPPFLAGS) -DPIC $(CFLAGS) -fPIC -c -o $@ $< $(APPEND_CFLAGS)
 
 subdirs-all subdirs-clean subdirs-install subdirs-distclean subdirs-uninstall: .phony
 	@set -e; for subdir in $(SUBDIRS) $(SUBDIRS-y); do \
-- 
Anthony PERARD



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

* [XEN PATCH 04/57] libs: Remove _paths.h from libs ctrl and util.
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (2 preceding siblings ...)
  2021-12-06 17:01 ` [XEN PATCH 03/57] tools/Rules.mk: Remove $(CFLAGS.opic) from %.opic: %.S Anthony PERARD
@ 2021-12-06 17:01 ` Anthony PERARD
  2021-12-07  7:43   ` Juergen Gross
  2021-12-06 17:01 ` [XEN PATCH 05/57] libs: Remove -Iinclude from CFLAGS Anthony PERARD
                   ` (52 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:01 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Andrew Cooper, George Dunlap,
	Ian Jackson, Jan Beulich, Julien Grall, Stefano Stabellini,
	Wei Liu, Juergen Gross

libxenutil doesn't include _paths.h so no need to generate it.

libxenctrl doesn't use macros from _paths.h so can be removed.
Fix libxenguest to include _paths.h properly instead of relying on
xc_private.h

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 .gitignore                    | 2 --
 tools/libs/ctrl/Makefile      | 5 -----
 tools/libs/ctrl/xc_private.h  | 2 --
 tools/libs/guest/Makefile     | 2 +-
 tools/libs/guest/xg_suspend.c | 1 +
 tools/libs/util/Makefile      | 6 +-----
 6 files changed, 3 insertions(+), 15 deletions(-)

diff --git a/.gitignore b/.gitignore
index cad5aacd8d..111eb03b86 100644
--- a/.gitignore
+++ b/.gitignore
@@ -117,7 +117,6 @@ tools/libs/hypfs/headers.chk
 tools/libs/hypfs/xenhypfs.pc
 tools/libs/call/headers.chk
 tools/libs/call/xencall.pc
-tools/libs/ctrl/_*.[ch]
 tools/libs/ctrl/libxenctrl.map
 tools/libs/ctrl/xencontrol.pc
 tools/libs/foreignmemory/headers.chk
@@ -157,7 +156,6 @@ tools/libs/store/utils.h
 tools/libs/store/xenstore.pc
 tools/libs/store/xs_lib.c
 tools/libs/util/*.pc
-tools/libs/util/_paths.h
 tools/libs/util/libxlu_cfg_y.output
 tools/libs/util/libxenutil.map
 tools/libs/vchan/headers.chk
diff --git a/tools/libs/ctrl/Makefile b/tools/libs/ctrl/Makefile
index 519246b0d6..5d866b8d04 100644
--- a/tools/libs/ctrl/Makefile
+++ b/tools/libs/ctrl/Makefile
@@ -54,11 +54,6 @@ NO_HEADERS_CHK := y
 
 include $(XEN_ROOT)/tools/libs/libs.mk
 
-genpath-target = $(call buildmakevars2header,_paths.h)
-$(eval $(genpath-target))
-
-$(LIB_OBJS) $(PIC_OBJS): _paths.h
-
 -include $(DEPS_INCLUDE)
 
 clean: cleanlocal
diff --git a/tools/libs/ctrl/xc_private.h b/tools/libs/ctrl/xc_private.h
index 2e483590e6..824d3cfc21 100644
--- a/tools/libs/ctrl/xc_private.h
+++ b/tools/libs/ctrl/xc_private.h
@@ -29,8 +29,6 @@
 #include <limits.h>
 #include <sys/ioctl.h>
 
-#include "_paths.h"
-
 #define XC_WANT_COMPAT_MAP_FOREIGN_API
 #define XC_INTERNAL_COMPAT_MAP_FOREIGN_API
 #include "xenctrl.h"
diff --git a/tools/libs/guest/Makefile b/tools/libs/guest/Makefile
index 2ce92d247e..b49e5059f2 100644
--- a/tools/libs/guest/Makefile
+++ b/tools/libs/guest/Makefile
@@ -111,7 +111,7 @@ libxenguest.so.$(MAJOR).$(MINOR): APPEND_LDFLAGS += $(COMPRESSION_LIBS) -lz
 genpath-target = $(call buildmakevars2header,_paths.h)
 $(eval $(genpath-target))
 
-xc_private.h: _paths.h
+$(LIB_OBJS) $(PIC_OBJS): _paths.h
 
 -include $(DEPS_INCLUDE)
 
diff --git a/tools/libs/guest/xg_suspend.c b/tools/libs/guest/xg_suspend.c
index 0ce6364963..128353029c 100644
--- a/tools/libs/guest/xg_suspend.c
+++ b/tools/libs/guest/xg_suspend.c
@@ -19,6 +19,7 @@
 #include <xenevtchn.h>
 
 #include "xc_private.h"
+#include "_paths.h"
 #include "xenguest.h"
 
 #define SUSPEND_LOCK_FILE    XEN_RUN_DIR "/suspend-evtchn-%d.lock"
diff --git a/tools/libs/util/Makefile b/tools/libs/util/Makefile
index f5f9e89fee..87425d862a 100644
--- a/tools/libs/util/Makefile
+++ b/tools/libs/util/Makefile
@@ -39,7 +39,7 @@ NO_HEADERS_CHK := y
 
 include $(XEN_ROOT)/tools/libs/libs.mk
 
-$(LIB_OBJS) $(PIC_OBJS): $(AUTOINCS) _paths.h
+$(LIB_OBJS) $(PIC_OBJS): $(AUTOINCS)
 
 %.c %.h:: %.y
 	@rm -f $*.[ch]
@@ -49,14 +49,10 @@ $(LIB_OBJS) $(PIC_OBJS): $(AUTOINCS) _paths.h
 	@rm -f $*.[ch]
 	$(FLEX) --header-file=$*.h --outfile=$*.c $<
 
-genpath-target = $(call buildmakevars2header,_paths.h)
-$(eval $(genpath-target))
-
 -include $(DEPS_INCLUDE)
 
 clean: cleanlocal
 
 .PHONY: cleanlocal
 cleanlocal:
-	$(RM) -f _*.h
 	$(RM) -f libxlutil.map
-- 
Anthony PERARD



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

* [XEN PATCH 05/57] libs: Remove -Iinclude from CFLAGS
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (3 preceding siblings ...)
  2021-12-06 17:01 ` [XEN PATCH 04/57] libs: Remove _paths.h from libs ctrl and util Anthony PERARD
@ 2021-12-06 17:01 ` Anthony PERARD
  2021-12-07  7:44   ` Juergen Gross
  2021-12-06 17:01 ` [XEN PATCH 06/57] libs/libs.mk: Remove generic variable that already exist Anthony PERARD
                   ` (51 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:01 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu, Juergen Gross

They are no more directory libs/*/include.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libs/libs.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk
index ebdb2a4782..830bdc851f 100644
--- a/tools/libs/libs.mk
+++ b/tools/libs/libs.mk
@@ -12,7 +12,7 @@ MINOR ?= 0
 SHLIB_LDFLAGS += -Wl,--version-script=libxen$(LIBNAME).map
 
 CFLAGS   += -Werror -Wmissing-prototypes
-CFLAGS   += -I./include $(CFLAGS_xeninclude)
+CFLAGS   += $(CFLAGS_xeninclude)
 CFLAGS   += $(foreach lib, $(USELIBS_$(LIBNAME)), $(CFLAGS_libxen$(lib)))
 
 LDUSELIBS = $(foreach lib, $(USELIBS_$(LIBNAME)), $(LDLIBS_libxen$(lib)))
-- 
Anthony PERARD



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

* [XEN PATCH 06/57] libs/libs.mk: Remove generic variable that already exist
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (4 preceding siblings ...)
  2021-12-06 17:01 ` [XEN PATCH 05/57] libs: Remove -Iinclude from CFLAGS Anthony PERARD
@ 2021-12-06 17:01 ` Anthony PERARD
  2021-12-07  7:46   ` Juergen Gross
  2021-12-06 17:01 ` [XEN PATCH 07/57] libs/guest: Drop spurious include in Makefile Anthony PERARD
                   ` (50 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:01 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu, Juergen Gross

comma, empty, space are already defined in "Config.mk".

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libs/libs.mk | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk
index 830bdc851f..dfbbef4080 100644
--- a/tools/libs/libs.mk
+++ b/tools/libs/libs.mk
@@ -26,9 +26,6 @@ ifneq ($(nosharedlibs),y)
 LIB += lib$(LIB_FILE_NAME).so
 endif
 
-comma:= ,
-empty:=
-space:= $(empty) $(empty)
 PKG_CONFIG ?= $(LIB_FILE_NAME).pc
 PKG_CONFIG_NAME ?= Xen$(LIBNAME)
 PKG_CONFIG_DESC ?= The $(PKG_CONFIG_NAME) library for Xen hypervisor
-- 
Anthony PERARD



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

* [XEN PATCH 07/57] libs/guest: Drop spurious include in Makefile
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (5 preceding siblings ...)
  2021-12-06 17:01 ` [XEN PATCH 06/57] libs/libs.mk: Remove generic variable that already exist Anthony PERARD
@ 2021-12-06 17:01 ` Anthony PERARD
  2021-12-07  7:48   ` Juergen Gross
  2021-12-06 17:01 ` [XEN PATCH 08/57] libs/light: Remove non-existing CFLAGS_libxl.o var Anthony PERARD
                   ` (49 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:01 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu, Juergen Gross

This include hasn't been useful since e567964a54 (tools: drop ia64
support).

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libs/guest/Makefile | 2 --
 1 file changed, 2 deletions(-)

diff --git a/tools/libs/guest/Makefile b/tools/libs/guest/Makefile
index b49e5059f2..c6d882e239 100644
--- a/tools/libs/guest/Makefile
+++ b/tools/libs/guest/Makefile
@@ -71,8 +71,6 @@ SRCS-y                 += xg_dom_decompress_unsafe_xz.c
 SRCS-y                 += xg_dom_decompress_unsafe_zstd.c
 endif
 
--include $(XEN_TARGET_ARCH)/Makefile
-
 CFLAGS   += -Werror -Wmissing-prototypes
 CFLAGS   += -I. -I./include $(CFLAGS_xeninclude)
 CFLAGS   += -D__XEN_TOOLS__
-- 
Anthony PERARD



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

* [XEN PATCH 08/57] libs/light: Remove non-existing CFLAGS_libxl.o var
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (6 preceding siblings ...)
  2021-12-06 17:01 ` [XEN PATCH 07/57] libs/guest: Drop spurious include in Makefile Anthony PERARD
@ 2021-12-06 17:01 ` Anthony PERARD
  2021-12-07  7:49   ` Juergen Gross
  2021-12-06 17:01 ` [XEN PATCH 09/57] libs/light: Remove -I Anthony PERARD
                   ` (48 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:01 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu, Juergen Gross

This var was originally $(CFLAGS_$*.o), and probably was copied from
the generic %.o:%.c rules.

Nothing sets CFLAGS_libxl.o, so remove it.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libs/light/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile
index 194bc5f268..975413ade8 100644
--- a/tools/libs/light/Makefile
+++ b/tools/libs/light/Makefile
@@ -200,7 +200,7 @@ libxl.api-ok: check-libxl-api-rules _libxl.api-for-check
 	touch $@
 
 _libxl.api-for-check: $(XEN_INCLUDE)/libxl.h $(AUTOINCS)
-	$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_libxl.o) -c -E $< $(APPEND_CFLAGS) \
+	$(CC) $(CPPFLAGS) $(CFLAGS) -c -E $< $(APPEND_CFLAGS) \
 		-DLIBXL_EXTERNAL_CALLERS_ONLY=LIBXL_EXTERNAL_CALLERS_ONLY \
 		>$@.new
 	mv -f $@.new $@
-- 
Anthony PERARD



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

* [XEN PATCH 09/57] libs/light: Remove -I.
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (7 preceding siblings ...)
  2021-12-06 17:01 ` [XEN PATCH 08/57] libs/light: Remove non-existing CFLAGS_libxl.o var Anthony PERARD
@ 2021-12-06 17:01 ` Anthony PERARD
  2021-12-07  7:59   ` Juergen Gross
  2021-12-06 17:01 ` [XEN PATCH 10/57] libs/stat: Remove duplicated CFLAGS from deps Anthony PERARD
                   ` (47 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:01 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu, Juergen Gross

There is no need to include current directory.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libs/light/Makefile | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile
index 975413ade8..bfd58226ce 100644
--- a/tools/libs/light/Makefile
+++ b/tools/libs/light/Makefile
@@ -44,7 +44,6 @@ SRCS-$(CONFIG_X86) += $(ACPI_OBJS:.o=.c)
 
 CFLAGS += -Wno-format-zero-length -Wmissing-declarations \
 	-Wno-declaration-after-statement -Wformat-nonliteral
-CFLAGS += -I.
 
 CFLAGS-$(CONFIG_X86) += -DCONFIG_PCI_SUPP_LEGACY_IRQ
 
-- 
Anthony PERARD



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

* [XEN PATCH 10/57] libs/stat: Remove duplicated CFLAGS from deps
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (8 preceding siblings ...)
  2021-12-06 17:01 ` [XEN PATCH 09/57] libs/light: Remove -I Anthony PERARD
@ 2021-12-06 17:01 ` Anthony PERARD
  2021-12-07  8:01   ` Juergen Gross
  2021-12-06 17:01 ` [XEN PATCH 11/57] libs/store: Remove PKG_CONFIG_REMOVE Anthony PERARD
                   ` (46 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:01 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu, Juergen Gross

Those CFLAGS_* are already added in libs.mk via USELIBS_stat.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libs/stat/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/stat/Makefile b/tools/libs/stat/Makefile
index c99508ae6b..911a2de8ec 100644
--- a/tools/libs/stat/Makefile
+++ b/tools/libs/stat/Makefile
@@ -15,7 +15,7 @@
 XEN_ROOT=$(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(CFLAGS_xeninclude) -include $(XEN_ROOT)/tools/config.h
+CFLAGS += -include $(XEN_ROOT)/tools/config.h
 
 SRCS-y += xenstat.c
 SRCS-y += xenstat_qmp.c
-- 
Anthony PERARD



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

* [XEN PATCH 11/57] libs/store: Remove PKG_CONFIG_REMOVE
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (9 preceding siblings ...)
  2021-12-06 17:01 ` [XEN PATCH 10/57] libs/stat: Remove duplicated CFLAGS from deps Anthony PERARD
@ 2021-12-06 17:01 ` Anthony PERARD
  2021-12-07  8:05   ` Juergen Gross
  2021-12-06 17:01 ` [XEN PATCH 12/57] tools: remove some unneeded subdir-distclean-* targets Anthony PERARD
                   ` (45 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:01 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu, Juergen Gross

PKG_CONFIG_REMOVE doesn't do anything anymore. Commit dd33fd2e81
(tools: split libxenstore into new tools/libs/store directory) had
reintroduced it without saying why.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libs/store/Makefile | 2 --
 1 file changed, 2 deletions(-)

diff --git a/tools/libs/store/Makefile b/tools/libs/store/Makefile
index 43b018aa8c..c208dbb48a 100644
--- a/tools/libs/store/Makefile
+++ b/tools/libs/store/Makefile
@@ -27,8 +27,6 @@ CFLAGS += -I $(XEN_ROOT)/tools/xenstore
 xs.opic: CFLAGS += -DUSE_PTHREAD
 ifeq ($(CONFIG_Linux),y)
 xs.opic: CFLAGS += -DUSE_DLSYM
-else
-PKG_CONFIG_REMOVE += -ldl
 endif
 
 -include $(DEPS_INCLUDE)
-- 
Anthony PERARD



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

* [XEN PATCH 12/57] tools: remove some unneeded subdir-distclean-* targets
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (10 preceding siblings ...)
  2021-12-06 17:01 ` [XEN PATCH 11/57] libs/store: Remove PKG_CONFIG_REMOVE Anthony PERARD
@ 2021-12-06 17:01 ` Anthony PERARD
  2021-12-06 17:01 ` [XEN PATCH 13/57] tools/firmware/hvmloader: remove "subdirs-*" prerequisite Anthony PERARD
                   ` (44 subsequent siblings)
  56 siblings, 0 replies; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:01 UTC (permalink / raw)
  To: xen-devel; +Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu

Those two are already covered by subdir-distclean-% target in
Rules.mk.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/Makefile          | 3 ---
 tools/firmware/Makefile | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index 757a560be0..8936b754c8 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -296,9 +296,6 @@ subdir-uninstall-debugger/kdd: .phony
 subdir-all-debugger/kdd: .phony
 	$(MAKE) -C debugger/kdd all
 
-subdir-distclean-firmware: .phony
-	$(MAKE) -C firmware distclean
-
 subtree-force-update:
 ifeq ($(CONFIG_QEMU_XEN),y)
 	$(MAKE) qemu-xen-dir-force-update
diff --git a/tools/firmware/Makefile b/tools/firmware/Makefile
index 1f27117794..345037b93b 100644
--- a/tools/firmware/Makefile
+++ b/tools/firmware/Makefile
@@ -85,9 +85,6 @@ clean: subdirs-clean
 .PHONY: distclean
 distclean: subdirs-distclean
 
-subdir-distclean-etherboot: .phony
-	$(MAKE) -C etherboot distclean
-
 subdir-distclean-ovmf-dir: .phony
 	rm -rf ovmf-dir ovmf-dir-remote
 
-- 
Anthony PERARD



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

* [XEN PATCH 13/57] tools/firmware/hvmloader: remove "subdirs-*" prerequisite
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (11 preceding siblings ...)
  2021-12-06 17:01 ` [XEN PATCH 12/57] tools: remove some unneeded subdir-distclean-* targets Anthony PERARD
@ 2021-12-06 17:01 ` Anthony PERARD
  2021-12-06 17:01 ` [XEN PATCH 14/57] tools/flask/utils: remove unused variables/targets from Makefile Anthony PERARD
                   ` (43 subsequent siblings)
  56 siblings, 0 replies; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:01 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Jan Beulich, Andrew Cooper,
	Roger Pau Monné,
	Wei Liu, Ian Jackson

hvmloader's last subdir have been removed in 73b72736e6 ("acpi: Move
ACPI code to tools/libacpi"), so there is no need to use "subdirs-*"
target anymore.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/firmware/hvmloader/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/firmware/hvmloader/Makefile b/tools/firmware/hvmloader/Makefile
index e980ce7c5f..b754220839 100644
--- a/tools/firmware/hvmloader/Makefile
+++ b/tools/firmware/hvmloader/Makefile
@@ -60,7 +60,7 @@ ROMS += $(ROMBIOS_ROM) $(STDVGA_ROM) $(CIRRUSVGA_ROM)
 endif
 
 .PHONY: all
-all: acpi subdirs-all
+all: acpi
 	$(MAKE) hvmloader
 
 .PHONY: acpi
@@ -104,7 +104,7 @@ endif
 	mv $@.new $@
 
 .PHONY: clean
-clean: subdirs-clean
+clean:
 	rm -f roms.inc roms.inc.new acpi.h
 	rm -f hvmloader hvmloader.tmp *.o $(DEPS_RM)
 	$(MAKE) -C $(ACPI_PATH)  ACPI_BUILD_DIR=$(CURDIR) clean
-- 
Anthony PERARD



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

* [XEN PATCH 14/57] tools/flask/utils: remove unused variables/targets from Makefile
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (12 preceding siblings ...)
  2021-12-06 17:01 ` [XEN PATCH 13/57] tools/firmware/hvmloader: remove "subdirs-*" prerequisite Anthony PERARD
@ 2021-12-06 17:01 ` Anthony PERARD
  2021-12-16 12:35   ` Daniel P. Smith
  2021-12-16 12:36   ` Andrew Cooper
  2021-12-06 17:01 ` [XEN PATCH 15/57] tools/libacpi: cleanup Makefile, don't check for iasl binary Anthony PERARD
                   ` (42 subsequent siblings)
  56 siblings, 2 replies; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:01 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Daniel De Graaf, Daniel P. Smith,
	Ian Jackson, Wei Liu

They are no *.opic or *.so in this subdir, so no need to clean them.

The TEST* variables doesn't seems to be used anywhere, and they weren't
used by xen.git when introduced.
Both CLIENTS_* variables aren't used.
Both target "print-dir" and "print-end" only exist in this directory
and are probably not used anywhere.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/flask/utils/Makefile | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/tools/flask/utils/Makefile b/tools/flask/utils/Makefile
index ae87102144..5449f05b13 100644
--- a/tools/flask/utils/Makefile
+++ b/tools/flask/utils/Makefile
@@ -4,13 +4,7 @@ include $(XEN_ROOT)/tools/Rules.mk
 CFLAGS += -Werror
 CFLAGS += $(CFLAGS_libxenctrl)
 
-TESTDIR  = testsuite/tmp
-TESTFLAGS= -DTESTING
-TESTENV  = XENSTORED_ROOTDIR=$(TESTDIR) XENSTORED_RUNDIR=$(TESTDIR)
-
 CLIENTS := flask-loadpolicy flask-setenforce flask-getenforce flask-label-pci flask-get-bool flask-set-bool
-CLIENTS_SRCS := $(patsubst flask-%,%.c,$(CLIENTS))
-CLIENTS_OBJS := $(patsubst flask-%,%.o,$(CLIENTS))
 
 .PHONY: all
 all: $(CLIENTS)
@@ -35,21 +29,13 @@ flask-set-bool: set-bool.o
 
 .PHONY: clean
 clean: 
-	rm -f *.o *.opic *.so
+	rm -f *.o
 	rm -f $(CLIENTS)
 	$(RM) $(DEPS_RM)
 
 .PHONY: distclean
 distclean: clean
 
-.PHONY: print-dir
-print-dir:
-	@echo -n tools/flask/utils: 
-
-.PHONY: print-end
-print-end:
-	@echo
-
 .PHONY: install
 install: all
 	$(INSTALL_DIR) $(DESTDIR)$(sbindir)
-- 
Anthony PERARD



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

* [XEN PATCH 15/57] tools/libacpi: cleanup Makefile, don't check for iasl binary
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (13 preceding siblings ...)
  2021-12-06 17:01 ` [XEN PATCH 14/57] tools/flask/utils: remove unused variables/targets from Makefile Anthony PERARD
@ 2021-12-06 17:01 ` Anthony PERARD
  2021-12-16 11:47   ` Andrew Cooper
  2021-12-06 17:01 ` [XEN PATCH 16/57] tools/ocaml: Remove generation of _paths.h Anthony PERARD
                   ` (41 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:01 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Jan Beulich, Ian Jackson, Wei Liu

iasl is been check for presence by ./configure, so this Makefile
doesn't have to do it. Also start to use $(IASL) that ./configure
generate.

iasl hasn't been download by our build system for a while and the
dependency on iasl is in the main xen.git README.

Make use of $< in one rule instead of spelling the %.asl file again.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libacpi/Makefile | 17 ++++-------------
 tools/libacpi/README   |  6 ------
 2 files changed, 4 insertions(+), 19 deletions(-)

diff --git a/tools/libacpi/Makefile b/tools/libacpi/Makefile
index 2448687dbb..60860eaa00 100644
--- a/tools/libacpi/Makefile
+++ b/tools/libacpi/Makefile
@@ -38,11 +38,10 @@ MKDSDT_CFLAGS-$(CONFIG_X86) = -DCONFIG_X86
 # complete $(ACPI_BUILD_DIR) as path, even if it has '.' symbols.
 TMP_SUFFIX	= tmp
 
-vpath iasl $(PATH)
 all: $(C_SRC) $(H_SRC)
 
-$(H_SRC): $(ACPI_BUILD_DIR)/%.h: %.asl iasl
-	iasl -vs -p $(ACPI_BUILD_DIR)/$*.$(TMP_SUFFIX) -tc $<
+$(H_SRC): $(ACPI_BUILD_DIR)/%.h: %.asl
+	$(IASL) -vs -p $(ACPI_BUILD_DIR)/$*.$(TMP_SUFFIX) -tc $<
 	sed -e 's/AmlCode/$*/g' -e 's/_aml_code//g' $(ACPI_BUILD_DIR)/$*.hex >$@
 	rm -f $(addprefix $(ACPI_BUILD_DIR)/, $*.aml $*.hex)
  
@@ -74,21 +73,13 @@ $(ACPI_BUILD_DIR)/dsdt_anycpu_arm.asl: $(MK_DSDT)
 	$(MK_DSDT) --debug=$(debug) >> $@.$(TMP_SUFFIX)
 	mv -f $@.$(TMP_SUFFIX) $@
 
-$(C_SRC): $(ACPI_BUILD_DIR)/%.c: iasl $(ACPI_BUILD_DIR)/%.asl
-	iasl -vs -p $(ACPI_BUILD_DIR)/$*.$(TMP_SUFFIX) -tc $(ACPI_BUILD_DIR)/$*.asl
+$(C_SRC): $(ACPI_BUILD_DIR)/%.c: $(ACPI_BUILD_DIR)/%.asl
+	$(IASL) -vs -p $(ACPI_BUILD_DIR)/$*.$(TMP_SUFFIX) -tc $<
 	sed -e 's/AmlCode/$*/g' -e 's/_aml_code//g' $(ACPI_BUILD_DIR)/$*.hex > $@.$(TMP_SUFFIX)
 	echo "int $*_len=sizeof($*);" >> $@.$(TMP_SUFFIX)
 	mv -f $@.$(TMP_SUFFIX) $@
 	rm -f $(addprefix $(ACPI_BUILD_DIR)/, $*.aml $*.hex)
 
-iasl:
-	@echo
-	@echo "ACPI ASL compiler (iasl) is needed"
-	@echo "Download and install Intel ACPI CA from"
-	@echo "http://acpica.org/downloads/"
-	@echo 
-	@exit 1
-
 clean:
 	rm -f $(C_SRC) $(H_SRC) $(MK_DSDT) $(C_SRC:=.$(TMP_SUFFIX))
 	rm -f $(patsubst %.c,%.hex,$(C_SRC)) $(patsubst %.c,%.aml,$(C_SRC)) $(patsubst %.c,%.asl,$(C_SRC))
diff --git a/tools/libacpi/README b/tools/libacpi/README
index 2b9d6e188c..4ab5ed2de7 100644
--- a/tools/libacpi/README
+++ b/tools/libacpi/README
@@ -24,9 +24,3 @@ In case that the acpi_dsdt.asl need to be updated, please
 Follow the instruction:
 
 # make acpi_dsdt.c
-
-Note:
-DSDT compiler "iasl" is needed. By default, it will be downloaded 
-using wget in Makefile. if it failed, please download manually from 
-http://developer.intel.com/technology/iapc/acpi/downloads.htm. 
-then compile and install iasl
-- 
Anthony PERARD



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

* [XEN PATCH 16/57] tools/ocaml: Remove generation of _paths.h
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (14 preceding siblings ...)
  2021-12-06 17:01 ` [XEN PATCH 15/57] tools/libacpi: cleanup Makefile, don't check for iasl binary Anthony PERARD
@ 2021-12-06 17:01 ` Anthony PERARD
  2021-12-16 14:09   ` Andrew Cooper
  2021-12-06 17:02 ` [XEN PATCH 17/57] tools/xl: Remove unnecessary -I. from CFLAGS Anthony PERARD
                   ` (40 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:01 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Andrew Cooper, George Dunlap,
	Ian Jackson, Jan Beulich, Julien Grall, Stefano Stabellini,
	Wei Liu, Christian Lindig, David Scott

_paths.h isn't useful anymore in systemd_stubs.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 .gitignore                            | 1 -
 tools/ocaml/xenstored/Makefile        | 7 -------
 tools/ocaml/xenstored/systemd_stubs.c | 2 --
 3 files changed, 10 deletions(-)

diff --git a/.gitignore b/.gitignore
index 111eb03b86..b42264e209 100644
--- a/.gitignore
+++ b/.gitignore
@@ -409,7 +409,6 @@ tools/ocaml/libs/xentoollog/xentoollog.ml
 tools/ocaml/libs/xentoollog/xentoollog.mli
 tools/ocaml/libs/xs/paths.ml
 tools/ocaml/libs/xc/xenctrl_abi_check.h
-tools/ocaml/xenstored/_paths.h
 tools/ocaml/xenstored/oxenstored
 tools/ocaml/xenstored/oxenstored.conf
 tools/ocaml/xenstored/paths.ml
diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile
index 89ec3ec76a..0b5711b507 100644
--- a/tools/ocaml/xenstored/Makefile
+++ b/tools/ocaml/xenstored/Makefile
@@ -30,8 +30,6 @@ systemd_OBJS = systemd
 systemd_C_OBJS = systemd_stubs
 OCAML_LIBRARY += systemd
 
-$(foreach obj,$(systemd_C_OBJS),$(obj).o): _paths.h
-
 LIBS_systemd += $(LDFLAGS-y)
 
 OBJS = paths \
@@ -100,8 +98,3 @@ genpath-target = $(call buildmakevars2module,paths.ml)
 $(eval $(genpath-target))
 
 GENERATED_FILES += paths.ml
-
-genpath-target = $(call buildmakevars2header,_paths.h)
-$(eval $(genpath-target))
-
-GENERATE_FILES += _paths.h
diff --git a/tools/ocaml/xenstored/systemd_stubs.c b/tools/ocaml/xenstored/systemd_stubs.c
index 31a1a5d384..f4c875075a 100644
--- a/tools/ocaml/xenstored/systemd_stubs.c
+++ b/tools/ocaml/xenstored/systemd_stubs.c
@@ -27,8 +27,6 @@
 
 #include <systemd/sd-daemon.h>
 
-#include "_paths.h"
-
 CAMLprim value ocaml_sd_notify_ready(value ignore)
 {
 	CAMLparam1(ignore);
-- 
Anthony PERARD



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

* [XEN PATCH 17/57] tools/xl: Remove unnecessary -I. from CFLAGS
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (15 preceding siblings ...)
  2021-12-06 17:01 ` [XEN PATCH 16/57] tools/ocaml: Remove generation of _paths.h Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-06 17:02 ` [XEN PATCH 18/57] tools: Use config.h from autoconf instead of "buildmakevars2header" Anthony PERARD
                   ` (39 subsequent siblings)
  56 siblings, 0 replies; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel; +Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu

GCC will search the directory where the source file is for
quote-includes.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/xl/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/xl/Makefile b/tools/xl/Makefile
index 656b21c7da..2e129f00e1 100644
--- a/tools/xl/Makefile
+++ b/tools/xl/Makefile
@@ -7,7 +7,7 @@ include $(XEN_ROOT)/tools/Rules.mk
 
 CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations \
 	-Wno-declaration-after-statement -Wformat-nonliteral
-CFLAGS += -I. -fPIC
+CFLAGS += -fPIC
 
 CFLAGS += $(PTHREAD_CFLAGS)
 LDFLAGS += $(PTHREAD_LDFLAGS)
-- 
Anthony PERARD



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

* [XEN PATCH 18/57] tools: Use config.h from autoconf instead of "buildmakevars2header"
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (16 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 17/57] tools/xl: Remove unnecessary -I. from CFLAGS Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-07 10:08   ` Juergen Gross
  2021-12-06 17:02 ` [XEN PATCH 19/57] tools/configure.ac: Create ZLIB_LIBS and ZLIB_CFLAGS Anthony PERARD
                   ` (38 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Andrew Cooper, George Dunlap,
	Ian Jackson, Jan Beulich, Julien Grall, Stefano Stabellini,
	Wei Liu, Juergen Gross

This avoid the need to generate the _paths.h header when the
information is from autoconf anyway.

They are no more users of the "buildmakevars2header" macro, so it can
be removed from "Config.mk".

Also removed the extra "-f" flag where "$(RM)" is used (xl/Makefile).

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 Config.mk                            |  9 ------
 tools/libs/libs.mk                   |  1 -
 .gitignore                           |  6 ----
 configure                            | 45 ++++++++++++++++++++++++++++
 docs/configure                       | 45 ++++++++++++++++++++++++++++
 m4/paths.m4                          |  9 ++++++
 tools/config.h.in                    | 27 +++++++++++++++++
 tools/configure                      | 45 ++++++++++++++++++++++++++++
 tools/console/Makefile               | 12 ++------
 tools/console/client/main.c          |  1 -
 tools/console/daemon/main.c          |  1 -
 tools/helpers/Makefile               |  8 ++---
 tools/helpers/init-xenstore-domain.c |  1 -
 tools/libs/guest/Makefile            |  5 ----
 tools/libs/guest/xg_dom_core.c       |  1 -
 tools/libs/guest/xg_suspend.c        |  1 -
 tools/libs/light/Makefile            |  8 ++---
 tools/libs/light/libxl_dom.c         |  2 --
 tools/libs/light/libxl_internal.h    |  1 -
 tools/libs/light/libxl_utils.c       |  1 -
 tools/libs/stat/Makefile             |  7 +----
 tools/libs/stat/xenstat_qmp.c        |  1 -
 tools/xl/Makefile                    |  7 +----
 tools/xl/xl.h                        |  1 -
 24 files changed, 179 insertions(+), 66 deletions(-)

diff --git a/Config.mk b/Config.mk
index 6587c7d626..1c1998a5a8 100644
--- a/Config.mk
+++ b/Config.mk
@@ -167,15 +167,6 @@ define buildmakevars2file-closure
 	$(call move-if-changed,$(1).tmp,$(1))
 endef
 
-buildmakevars2header = $(eval $(call buildmakevars2header-closure,$(1)))
-define buildmakevars2header-closure
-    $(1): .phony
-	rm -f $(1).tmp; \
-	$(foreach var, $(BUILD_MAKE_VARS), \
-	          echo "#define $(var) \"$($(var))\"" >>$(1).tmp;) \
-	$(call move-if-changed,$(1).tmp,$(1))
-endef
-
 CFLAGS += -fno-strict-aliasing
 
 CFLAGS += -std=gnu99
diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk
index dfbbef4080..5c2f16dda4 100644
--- a/tools/libs/libs.mk
+++ b/tools/libs/libs.mk
@@ -132,7 +132,6 @@ clean:
 	rm -f lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR) lib$(LIB_FILE_NAME).so.$(MAJOR)
 	rm -f headers.chk headers.lst
 	rm -f $(PKG_CONFIG)
-	rm -f _paths.h
 
 .PHONY: distclean
 distclean: clean
diff --git a/.gitignore b/.gitignore
index b42264e209..b39b996718 100644
--- a/.gitignore
+++ b/.gitignore
@@ -123,7 +123,6 @@ tools/libs/foreignmemory/headers.chk
 tools/libs/foreignmemory/xenforeignmemory.pc
 tools/libs/devicemodel/headers.chk
 tools/libs/devicemodel/xendevicemodel.pc
-tools/libs/guest/_*.[ch]
 tools/libs/guest/libxenguest.map
 tools/libs/guest/xenguest.pc
 tools/libs/guest/xc_bitops.h
@@ -146,7 +145,6 @@ tools/libs/light/test_timedereg
 tools/libs/light/test_fdderegrace
 tools/libs/light/tmp.*
 tools/libs/light/xenlight.pc
-tools/libs/stat/_paths.h
 tools/libs/stat/headers.chk
 tools/libs/stat/libxenstat.map
 tools/libs/stat/xenstat.pc
@@ -163,8 +161,6 @@ tools/libs/vchan/libxenvchan.map
 tools/libs/vchan/xenvchan.pc
 tools/console/xenconsole
 tools/console/xenconsoled
-tools/console/client/_paths.h
-tools/console/daemon/_paths.h
 tools/debugger/gdb/gdb-6.2.1-linux-i386-xen/*
 tools/debugger/gdb/gdb-6.2.1/*
 tools/debugger/gdb/gdb-6.2.1.tar.bz2
@@ -207,7 +203,6 @@ tools/fuzz/x86_instruction_emulator/afl-harness-cov
 tools/fuzz/x86_instruction_emulator/wrappers.c
 tools/fuzz/x86_instruction_emulator/x86_emulate
 tools/fuzz/x86_instruction_emulator/x86-emulate.[ch]
-tools/helpers/_paths.h
 tools/helpers/init-xenstore-domain
 tools/helpers/xen-init-dom0
 tools/hotplug/common/hotplugpath.sh
@@ -422,7 +417,6 @@ tools/firmware/etherboot/ipxe.tar.gz
 tools/firmware/etherboot/ipxe/
 tools/python/xen/lowlevel/xl/_pyxl_types.c
 tools/python/xen/lowlevel/xl/_pyxl_types.h
-tools/xl/_paths.h
 tools/xl/xl
 
 docs/txt/misc/*.txt
diff --git a/configure b/configure
index 502273b263..bb7f27ddad 100755
--- a/configure
+++ b/configure
@@ -1946,6 +1946,11 @@ CONFIG_DIR=$sysconfdir
 XEN_CONFIG_DIR=$CONFIG_DIR/xen
 
 
+cat >>confdefs.h <<_ACEOF
+#define XEN_CONFIG_DIR "$XEN_CONFIG_DIR"
+_ACEOF
+
+
 
 # Check whether --with-initddir was given.
 if test "${with_initddir+set}" = set; then :
@@ -1998,6 +2003,11 @@ fi
 XEN_SCRIPT_DIR=$xen_scriptdir_path
 
 
+cat >>confdefs.h <<_ACEOF
+#define XEN_SCRIPT_DIR "$XEN_SCRIPT_DIR"
+_ACEOF
+
+
 
 # Check whether --with-xen-dumpdir was given.
 if test "${with_xen_dumpdir+set}" = set; then :
@@ -2038,6 +2048,11 @@ LIBEXEC=`eval echo $libexecdir/$libexec_subdir`
 
 LIBEXEC_BIN=${LIBEXEC}/bin
 
+
+cat >>confdefs.h <<_ACEOF
+#define LIBEXEC_BIN "$LIBEXEC_BIN"
+_ACEOF
+
 LIBEXEC_LIB=${LIBEXEC}/lib
 
 LIBEXEC_INC=${LIBEXEC}/include
@@ -2045,12 +2060,27 @@ LIBEXEC_INC=${LIBEXEC}/include
 XENFIRMWAREDIR=${LIBEXEC}/boot
 
 
+cat >>confdefs.h <<_ACEOF
+#define XENFIRMWAREDIR "$XENFIRMWAREDIR"
+_ACEOF
+
+
 XEN_RUN_DIR=$rundir_path/xen
 
 
+cat >>confdefs.h <<_ACEOF
+#define XEN_RUN_DIR "$XEN_RUN_DIR"
+_ACEOF
+
+
 XEN_LOG_DIR=$localstatedir/log/xen
 
 
+cat >>confdefs.h <<_ACEOF
+#define XEN_LOG_DIR "$XEN_LOG_DIR"
+_ACEOF
+
+
 XEN_LIB_STORED=$localstatedir/lib/xenstored
 
 
@@ -2060,6 +2090,11 @@ XEN_RUN_STORED=$rundir_path/xenstored
 XEN_LIB_DIR=$localstatedir/lib/xen
 
 
+cat >>confdefs.h <<_ACEOF
+#define XEN_LIB_DIR "$XEN_LIB_DIR"
+_ACEOF
+
+
 SHAREDIR=$prefix/share
 
 
@@ -2073,12 +2108,22 @@ case "$host_os" in
 esac
 
 
+cat >>confdefs.h <<_ACEOF
+#define XEN_LOCK_DIR "$XEN_LOCK_DIR"
+_ACEOF
+
+
 XEN_PAGING_DIR=$localstatedir/lib/xen/xenpaging
 
 
 XEN_DUMP_DIR=$xen_dumpdir_path
 
 
+cat >>confdefs.h <<_ACEOF
+#define XEN_DUMP_DIR "$XEN_DUMP_DIR"
+_ACEOF
+
+
 DEBUG_DIR=$debugdir_path
 
 
diff --git a/docs/configure b/docs/configure
index f93d086e9a..d4fced9858 100755
--- a/docs/configure
+++ b/docs/configure
@@ -1849,6 +1849,11 @@ CONFIG_DIR=$sysconfdir
 XEN_CONFIG_DIR=$CONFIG_DIR/xen
 
 
+cat >>confdefs.h <<_ACEOF
+#define XEN_CONFIG_DIR "$XEN_CONFIG_DIR"
+_ACEOF
+
+
 
 # Check whether --with-initddir was given.
 if test "${with_initddir+set}" = set; then :
@@ -1901,6 +1906,11 @@ fi
 XEN_SCRIPT_DIR=$xen_scriptdir_path
 
 
+cat >>confdefs.h <<_ACEOF
+#define XEN_SCRIPT_DIR "$XEN_SCRIPT_DIR"
+_ACEOF
+
+
 
 # Check whether --with-xen-dumpdir was given.
 if test "${with_xen_dumpdir+set}" = set; then :
@@ -1941,6 +1951,11 @@ LIBEXEC=`eval echo $libexecdir/$libexec_subdir`
 
 LIBEXEC_BIN=${LIBEXEC}/bin
 
+
+cat >>confdefs.h <<_ACEOF
+#define LIBEXEC_BIN "$LIBEXEC_BIN"
+_ACEOF
+
 LIBEXEC_LIB=${LIBEXEC}/lib
 
 LIBEXEC_INC=${LIBEXEC}/include
@@ -1948,12 +1963,27 @@ LIBEXEC_INC=${LIBEXEC}/include
 XENFIRMWAREDIR=${LIBEXEC}/boot
 
 
+cat >>confdefs.h <<_ACEOF
+#define XENFIRMWAREDIR "$XENFIRMWAREDIR"
+_ACEOF
+
+
 XEN_RUN_DIR=$rundir_path/xen
 
 
+cat >>confdefs.h <<_ACEOF
+#define XEN_RUN_DIR "$XEN_RUN_DIR"
+_ACEOF
+
+
 XEN_LOG_DIR=$localstatedir/log/xen
 
 
+cat >>confdefs.h <<_ACEOF
+#define XEN_LOG_DIR "$XEN_LOG_DIR"
+_ACEOF
+
+
 XEN_LIB_STORED=$localstatedir/lib/xenstored
 
 
@@ -1963,6 +1993,11 @@ XEN_RUN_STORED=$rundir_path/xenstored
 XEN_LIB_DIR=$localstatedir/lib/xen
 
 
+cat >>confdefs.h <<_ACEOF
+#define XEN_LIB_DIR "$XEN_LIB_DIR"
+_ACEOF
+
+
 SHAREDIR=$prefix/share
 
 
@@ -1976,12 +2011,22 @@ case "$host_os" in
 esac
 
 
+cat >>confdefs.h <<_ACEOF
+#define XEN_LOCK_DIR "$XEN_LOCK_DIR"
+_ACEOF
+
+
 XEN_PAGING_DIR=$localstatedir/lib/xen/xenpaging
 
 
 XEN_DUMP_DIR=$xen_dumpdir_path
 
 
+cat >>confdefs.h <<_ACEOF
+#define XEN_DUMP_DIR "$XEN_DUMP_DIR"
+_ACEOF
+
+
 DEBUG_DIR=$debugdir_path
 
 
diff --git a/m4/paths.m4 b/m4/paths.m4
index 7be314a3e2..826faada45 100644
--- a/m4/paths.m4
+++ b/m4/paths.m4
@@ -39,6 +39,7 @@ AC_SUBST(CONFIG_DIR)
 
 XEN_CONFIG_DIR=$CONFIG_DIR/xen
 AC_SUBST(XEN_CONFIG_DIR)
+AC_DEFINE_UNQUOTED([XEN_CONFIG_DIR], ["$XEN_CONFIG_DIR"], [Xen's config dir])
 
 AC_ARG_WITH([initddir],
     AS_HELP_STRING([--with-initddir=DIR],
@@ -83,6 +84,7 @@ AC_ARG_WITH([xen-scriptdir],
     [xen_scriptdir_path=$XEN_CONFIG_DIR/scripts])
 XEN_SCRIPT_DIR=$xen_scriptdir_path
 AC_SUBST(XEN_SCRIPT_DIR)
+AC_DEFINE_UNQUOTED([XEN_SCRIPT_DIR], ["$XEN_SCRIPT_DIR"], [Xen's script dir])
 
 AC_ARG_WITH([xen-dumpdir],
     AS_HELP_STRING([--with-xen-dumpdir=DIR],
@@ -117,18 +119,22 @@ AC_SUBST(LIBEXEC)
 dnl These variables will be substituted in various .in files
 LIBEXEC_BIN=${LIBEXEC}/bin
 AC_SUBST(LIBEXEC_BIN)
+AC_DEFINE_UNQUOTED([LIBEXEC_BIN], ["$LIBEXEC_BIN"], [Xen's libexec path])
 LIBEXEC_LIB=${LIBEXEC}/lib
 AC_SUBST(LIBEXEC_LIB)
 LIBEXEC_INC=${LIBEXEC}/include
 AC_SUBST(LIBEXEC_INC)
 XENFIRMWAREDIR=${LIBEXEC}/boot
 AC_SUBST(XENFIRMWAREDIR)
+AC_DEFINE_UNQUOTED([XENFIRMWAREDIR], ["$XENFIRMWAREDIR"], [Xen's firmware dir])
 
 XEN_RUN_DIR=$rundir_path/xen
 AC_SUBST(XEN_RUN_DIR)
+AC_DEFINE_UNQUOTED([XEN_RUN_DIR], ["$XEN_RUN_DIR"], [Xen's runstate path])
 
 XEN_LOG_DIR=$localstatedir/log/xen
 AC_SUBST(XEN_LOG_DIR)
+AC_DEFINE_UNQUOTED([XEN_LOG_DIR], ["$XEN_LOG_DIR"], [Xen's log dir])
 
 XEN_LIB_STORED=$localstatedir/lib/xenstored
 AC_SUBST(XEN_LIB_STORED)
@@ -138,6 +144,7 @@ AC_SUBST(XEN_RUN_STORED)
 
 XEN_LIB_DIR=$localstatedir/lib/xen
 AC_SUBST(XEN_LIB_DIR)
+AC_DEFINE_UNQUOTED([XEN_LIB_DIR], ["$XEN_LIB_DIR"], [Xen's lib dir])
 
 SHAREDIR=$prefix/share
 AC_SUBST(SHAREDIR)
@@ -151,12 +158,14 @@ case "$host_os" in
 *) XEN_LOCK_DIR=$localstatedir/lock ;;
 esac
 AC_SUBST(XEN_LOCK_DIR)
+AC_DEFINE_UNQUOTED([XEN_LOCK_DIR], ["$XEN_LOCK_DIR"], [Xen's lock dir])
 
 XEN_PAGING_DIR=$localstatedir/lib/xen/xenpaging
 AC_SUBST(XEN_PAGING_DIR)
 
 XEN_DUMP_DIR=$xen_dumpdir_path
 AC_SUBST(XEN_DUMP_DIR)
+AC_DEFINE_UNQUOTED([XEN_DUMP_DIR], ["$XEN_DUMP_DIR"], [Xen's dump directory])
 
 DEBUG_DIR=$debugdir_path
 AC_SUBST(DEBUG_DIR)
diff --git a/tools/config.h.in b/tools/config.h.in
index 52e01b2c84..9563d3acb6 100644
--- a/tools/config.h.in
+++ b/tools/config.h.in
@@ -96,6 +96,9 @@
 /* IPXE path */
 #undef IPXE_PATH
 
+/* Xen's libexec path */
+#undef LIBEXEC_BIN
+
 /* OVMF path */
 #undef OVMF_PATH
 
@@ -129,6 +132,30 @@
 /* QMP proxy path */
 #undef STUBDOM_QMP_PROXY_PATH
 
+/* Xen's firmware dir */
+#undef XENFIRMWAREDIR
+
+/* Xen's config dir */
+#undef XEN_CONFIG_DIR
+
+/* Xen's dump directory */
+#undef XEN_DUMP_DIR
+
+/* Xen's lib dir */
+#undef XEN_LIB_DIR
+
+/* Xen's lock dir */
+#undef XEN_LOCK_DIR
+
+/* Xen's log dir */
+#undef XEN_LOG_DIR
+
+/* Xen's runstate path */
+#undef XEN_RUN_DIR
+
+/* Xen's script dir */
+#undef XEN_SCRIPT_DIR
+
 /* Enable large inode numbers on Mac OS X 10.5.  */
 #ifndef _DARWIN_USE_64_BIT_INODE
 # define _DARWIN_USE_64_BIT_INODE 1
diff --git a/tools/configure b/tools/configure
index 8e4a59c2cb..829753b5dd 100755
--- a/tools/configure
+++ b/tools/configure
@@ -3926,6 +3926,11 @@ CONFIG_DIR=$sysconfdir
 XEN_CONFIG_DIR=$CONFIG_DIR/xen
 
 
+cat >>confdefs.h <<_ACEOF
+#define XEN_CONFIG_DIR "$XEN_CONFIG_DIR"
+_ACEOF
+
+
 
 # Check whether --with-initddir was given.
 if test "${with_initddir+set}" = set; then :
@@ -3978,6 +3983,11 @@ fi
 XEN_SCRIPT_DIR=$xen_scriptdir_path
 
 
+cat >>confdefs.h <<_ACEOF
+#define XEN_SCRIPT_DIR "$XEN_SCRIPT_DIR"
+_ACEOF
+
+
 
 # Check whether --with-xen-dumpdir was given.
 if test "${with_xen_dumpdir+set}" = set; then :
@@ -4018,6 +4028,11 @@ LIBEXEC=`eval echo $libexecdir/$libexec_subdir`
 
 LIBEXEC_BIN=${LIBEXEC}/bin
 
+
+cat >>confdefs.h <<_ACEOF
+#define LIBEXEC_BIN "$LIBEXEC_BIN"
+_ACEOF
+
 LIBEXEC_LIB=${LIBEXEC}/lib
 
 LIBEXEC_INC=${LIBEXEC}/include
@@ -4025,12 +4040,27 @@ LIBEXEC_INC=${LIBEXEC}/include
 XENFIRMWAREDIR=${LIBEXEC}/boot
 
 
+cat >>confdefs.h <<_ACEOF
+#define XENFIRMWAREDIR "$XENFIRMWAREDIR"
+_ACEOF
+
+
 XEN_RUN_DIR=$rundir_path/xen
 
 
+cat >>confdefs.h <<_ACEOF
+#define XEN_RUN_DIR "$XEN_RUN_DIR"
+_ACEOF
+
+
 XEN_LOG_DIR=$localstatedir/log/xen
 
 
+cat >>confdefs.h <<_ACEOF
+#define XEN_LOG_DIR "$XEN_LOG_DIR"
+_ACEOF
+
+
 XEN_LIB_STORED=$localstatedir/lib/xenstored
 
 
@@ -4040,6 +4070,11 @@ XEN_RUN_STORED=$rundir_path/xenstored
 XEN_LIB_DIR=$localstatedir/lib/xen
 
 
+cat >>confdefs.h <<_ACEOF
+#define XEN_LIB_DIR "$XEN_LIB_DIR"
+_ACEOF
+
+
 SHAREDIR=$prefix/share
 
 
@@ -4053,12 +4088,22 @@ case "$host_os" in
 esac
 
 
+cat >>confdefs.h <<_ACEOF
+#define XEN_LOCK_DIR "$XEN_LOCK_DIR"
+_ACEOF
+
+
 XEN_PAGING_DIR=$localstatedir/lib/xen/xenpaging
 
 
 XEN_DUMP_DIR=$xen_dumpdir_path
 
 
+cat >>confdefs.h <<_ACEOF
+#define XEN_DUMP_DIR "$XEN_DUMP_DIR"
+_ACEOF
+
+
 DEBUG_DIR=$debugdir_path
 
 
diff --git a/tools/console/Makefile b/tools/console/Makefile
index 3f4cddab03..207c04c9cd 100644
--- a/tools/console/Makefile
+++ b/tools/console/Makefile
@@ -22,27 +22,19 @@ all: $(BIN)
 clean:
 	$(RM) *.a *.so *.o *.rpm $(BIN) $(DEPS_RM)
 	$(RM) client/*.o daemon/*.o
-	$(RM) client/_paths.h
-	$(RM) daemon/_paths.h
 
 .PHONY: distclean
 distclean: clean
 
-daemon/main.o: daemon/_paths.h
+daemon/main.o: CFLAGS += -include $(XEN_ROOT)/tools/config.h
 daemon/io.o: CFLAGS += $(CFLAGS_libxenevtchn) $(CFLAGS_libxengnttab) $(CFLAGS_libxenforeignmemory) $(CONSOLE_CFLAGS-y)
 xenconsoled: $(patsubst %.c,%.o,$(wildcard daemon/*.c))
 	$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS) $(LDLIBS_libxenevtchn) $(LDLIBS_libxengnttab) $(LDLIBS_libxenforeignmemory) $(LDLIBS_xenconsoled) $(APPEND_LDFLAGS)
 
-client/main.o: client/_paths.h
+client/main.o: CFLAGS += -include $(XEN_ROOT)/tools/config.h
 xenconsole: $(patsubst %.c,%.o,$(wildcard client/*.c))
 	$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS) $(LDLIBS_xenconsole) $(APPEND_LDFLAGS)
 
-genpath-target = $(call buildmakevars2header,client/_paths.h)
-$(eval $(genpath-target))
-
-genpath-target = $(call buildmakevars2header,daemon/_paths.h)
-$(eval $(genpath-target))
-
 .PHONY: install
 install: $(BIN)
 	$(INSTALL_DIR) $(DESTDIR)/$(sbindir)
diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index 80157be421..ada6728caa 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -41,7 +41,6 @@
 
 #include <xenstore.h>
 #include "xenctrl.h"
-#include "_paths.h"
 
 #define ESCAPE_CHARACTER 0x1d
 
diff --git a/tools/console/daemon/main.c b/tools/console/daemon/main.c
index 30124a1c19..aac7233a48 100644
--- a/tools/console/daemon/main.c
+++ b/tools/console/daemon/main.c
@@ -31,7 +31,6 @@
 
 #include "utils.h"
 #include "io.h"
-#include "_paths.h"
 
 int log_reload = 0;
 int log_guest = 0;
diff --git a/tools/helpers/Makefile b/tools/helpers/Makefile
index 1bcc97ea8a..7f6c422440 100644
--- a/tools/helpers/Makefile
+++ b/tools/helpers/Makefile
@@ -24,6 +24,7 @@ $(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += $(CFLAGS_libxenguest)
 $(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += $(CFLAGS_libxenctrl)
 $(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += $(CFLAGS_libxenstore)
 $(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += $(CFLAGS_libxenlight)
+$(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += -include $(XEN_ROOT)/tools/config.h
 
 .PHONY: all
 all: $(PROGS)
@@ -31,8 +32,6 @@ all: $(PROGS)
 xen-init-dom0: $(XEN_INIT_DOM0_OBJS)
 	$(CC) $(LDFLAGS) -o $@ $(XEN_INIT_DOM0_OBJS) $(LDLIBS_libxenctrl) $(LDLIBS_libxentoollog) $(LDLIBS_libxenstore) $(LDLIBS_libxenlight) $(APPEND_LDFLAGS)
 
-$(INIT_XENSTORE_DOMAIN_OBJS): _paths.h
-
 init-xenstore-domain: $(INIT_XENSTORE_DOMAIN_OBJS)
 	$(CC) $(LDFLAGS) -o $@ $(INIT_XENSTORE_DOMAIN_OBJS) $(LDLIBS_libxentoollog) $(LDLIBS_libxenstore) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenlight) $(APPEND_LDFLAGS)
 
@@ -47,9 +46,6 @@ uninstall:
 
 .PHONY: clean
 clean:
-	$(RM) -f *.o $(PROGS) $(DEPS_RM) _paths.h
+	$(RM) -f *.o $(PROGS) $(DEPS_RM)
 
 distclean: clean
-
-genpath-target = $(call buildmakevars2header,_paths.h)
-$(eval $(genpath-target))
diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xenstore-domain.c
index b205a79ee6..dba4292803 100644
--- a/tools/helpers/init-xenstore-domain.c
+++ b/tools/helpers/init-xenstore-domain.c
@@ -16,7 +16,6 @@
 #include <xen/io/xenbus.h>
 
 #include "init-dom-json.h"
-#include "_paths.h"
 
 #define LAPIC_BASE_ADDRESS  0xfee00000UL
 #define MB(x)               ((uint64_t)x << 20)
diff --git a/tools/libs/guest/Makefile b/tools/libs/guest/Makefile
index c6d882e239..8f5f3acd21 100644
--- a/tools/libs/guest/Makefile
+++ b/tools/libs/guest/Makefile
@@ -106,11 +106,6 @@ include $(XEN_ROOT)/tools/libs/libs.mk
 libxenguest.so.$(MAJOR).$(MINOR): COMPRESSION_LIBS = $(filter -l%,$(zlib-options))
 libxenguest.so.$(MAJOR).$(MINOR): APPEND_LDFLAGS += $(COMPRESSION_LIBS) -lz
 
-genpath-target = $(call buildmakevars2header,_paths.h)
-$(eval $(genpath-target))
-
-$(LIB_OBJS) $(PIC_OBJS): _paths.h
-
 -include $(DEPS_INCLUDE)
 
 .PHONY: cleanlocal
diff --git a/tools/libs/guest/xg_dom_core.c b/tools/libs/guest/xg_dom_core.c
index 2e4c1330ea..c17cf9f712 100644
--- a/tools/libs/guest/xg_dom_core.c
+++ b/tools/libs/guest/xg_dom_core.c
@@ -33,7 +33,6 @@
 
 #define XG_NEED_UNALIGNED
 #include "xg_private.h"
-#include "_paths.h"
 
 /* ------------------------------------------------------------------------ */
 /* debugging                                                                */
diff --git a/tools/libs/guest/xg_suspend.c b/tools/libs/guest/xg_suspend.c
index 128353029c..0ce6364963 100644
--- a/tools/libs/guest/xg_suspend.c
+++ b/tools/libs/guest/xg_suspend.c
@@ -19,7 +19,6 @@
 #include <xenevtchn.h>
 
 #include "xc_private.h"
-#include "_paths.h"
 #include "xenguest.h"
 
 #define SUSPEND_LOCK_FILE    XEN_RUN_DIR "/suspend-evtchn-%d.lock"
diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile
index bfd58226ce..fb5a9ca87e 100644
--- a/tools/libs/light/Makefile
+++ b/tools/libs/light/Makefile
@@ -153,7 +153,7 @@ LIBXL_TEST_OBJS += $(foreach t, $(LIBXL_TESTS_INSIDE),libxl_test_$t.opic)
 TEST_PROG_OBJS += $(foreach t, $(LIBXL_TESTS_PROGS),test_$t.o) test_common.o
 TEST_PROGS += $(foreach t, $(LIBXL_TESTS_PROGS),test_$t)
 
-AUTOINCS = $(XEN_INCLUDE)/_libxl_list.h _paths.h _libxl_save_msgs_callout.h _libxl_save_msgs_helper.h
+AUTOINCS = $(XEN_INCLUDE)/_libxl_list.h _libxl_save_msgs_callout.h _libxl_save_msgs_helper.h
 AUTOSRCS = _libxl_save_msgs_callout.c _libxl_save_msgs_helper.c
 
 CLIENTS = testidl libxl-save-helper
@@ -191,9 +191,6 @@ build: $(CLIENTS) $(TEST_PROGS) $(AUTOSRCS) $(AUTOINCS)
 
 $(LIB_OBJS) $(PIC_OBJS) $(SAVE_HELPER_OBJS) $(LIBXL_TEST_OBJS) $(TEST_PROG_OBJS): $(AUTOINCS) libxl.api-ok
 
-genpath-target = $(call buildmakevars2header,_paths.h)
-$(eval $(genpath-target))
-
 libxl.api-ok: check-libxl-api-rules _libxl.api-for-check
 	$(PERL) $^
 	touch $@
@@ -216,9 +213,8 @@ _libxl_save_msgs_helper.h _libxl_save_msgs_callout.h: \
 
 $(XEN_INCLUDE)/libxl.h: $(XEN_INCLUDE)/_libxl_types.h $(XEN_INCLUDE)/_libxl_list.h
 $(XEN_INCLUDE)/libxl_json.h: $(XEN_INCLUDE)/_libxl_types_json.h
-libxl_internal.h: _libxl_types_internal.h _libxl_types_private.h _libxl_types_internal_private.h _paths.h
+libxl_internal.h: _libxl_types_internal.h _libxl_types_private.h _libxl_types_internal_private.h
 libxl_internal_json.h: _libxl_types_internal_json.h
-xl.h: _paths.h
 
 $(LIB_OBJS) $(PIC_OBJS) $(LIBXL_TEST_OBJS) $(TEST_PROG_OBJS) $(SAVE_HELPER_OBJS): $(XEN_INCLUDE)/libxl.h
 $(LIB_OBJS) $(PIC_OBJS) $(LIBXL_TEST_OBJS): libxl_internal.h
diff --git a/tools/libs/light/libxl_dom.c b/tools/libs/light/libxl_dom.c
index fe9f760f71..c28867f87b 100644
--- a/tools/libs/light/libxl_dom.c
+++ b/tools/libs/light/libxl_dom.c
@@ -24,8 +24,6 @@
 #include <xen/hvm/hvm_xs_strings.h>
 #include <xen/hvm/e820.h>
 
-#include "_paths.h"
-
 //#define DEBUG 1
 
 libxl_domain_type libxl__domain_type(libxl__gc *gc, uint32_t domid)
diff --git a/tools/libs/light/libxl_internal.h b/tools/libs/light/libxl_internal.h
index 0b4671318c..37d5c27756 100644
--- a/tools/libs/light/libxl_internal.h
+++ b/tools/libs/light/libxl_internal.h
@@ -73,7 +73,6 @@
 #endif
 
 #include "libxl.h"
-#include "_paths.h"
 #include "_libxl_save_msgs_callout.h"
 
 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
diff --git a/tools/libs/light/libxl_utils.c b/tools/libs/light/libxl_utils.c
index 4699c4a0a3..b91c2cafa2 100644
--- a/tools/libs/light/libxl_utils.c
+++ b/tools/libs/light/libxl_utils.c
@@ -18,7 +18,6 @@
 #include <ctype.h>
 
 #include "libxl_internal.h"
-#include "_paths.h"
 
 #ifndef LIBXL_HAVE_NONCONST_LIBXL_BASENAME_RETURN_VALUE
 const
diff --git a/tools/libs/stat/Makefile b/tools/libs/stat/Makefile
index 911a2de8ec..01417b5334 100644
--- a/tools/libs/stat/Makefile
+++ b/tools/libs/stat/Makefile
@@ -30,8 +30,6 @@ APPEND_LDFLAGS += $(LDLIBS-y)
 
 include $(XEN_ROOT)/tools/libs/libs.mk
 
-$(LIB_OBJS) $(PIC_OBJS): _paths.h
-
 PYLIB=bindings/swig/python/_xenstat.so
 PYMOD=bindings/swig/python/xenstat.py
 PYSRC=bindings/swig/python/_xenstat.c
@@ -121,10 +119,7 @@ clean: cleanlocal
 
 .PHONY: cleanlocal
 cleanlocal:
-	rm -f $(BINDINGS) $(BINDINGSRC) $(DEPS_RM) _paths.h
+	rm -f $(BINDINGS) $(BINDINGSRC) $(DEPS_RM)
 	rm -f libxenstat.map
 
 -include $(DEPS_INCLUDE)
-
-genpath-target = $(call buildmakevars2header,_paths.h)
-$(eval $(genpath-target))
diff --git a/tools/libs/stat/xenstat_qmp.c b/tools/libs/stat/xenstat_qmp.c
index 2205a04131..9909b9727e 100644
--- a/tools/libs/stat/xenstat_qmp.c
+++ b/tools/libs/stat/xenstat_qmp.c
@@ -23,7 +23,6 @@
 #include <xenctrl.h>
 
 #include "xenstat_priv.h"
-#include "_paths.h"
 
 #ifdef HAVE_YAJL_YAJL_VERSION_H
 #  include <yajl/yajl_version.h>
diff --git a/tools/xl/Makefile b/tools/xl/Makefile
index 2e129f00e1..b7f439121a 100644
--- a/tools/xl/Makefile
+++ b/tools/xl/Makefile
@@ -29,11 +29,6 @@ $(XL_OBJS): CFLAGS += $(CFLAGS_libxentoollog)
 $(XL_OBJS): CFLAGS += $(CFLAGS_XL)
 $(XL_OBJS): CFLAGS += -include $(XEN_ROOT)/tools/config.h # libxl_json.h needs it.
 
-genpath-target = $(call buildmakevars2header,_paths.h)
-$(eval $(genpath-target))
-
-$(XL_OBJS): _paths.h
-
 .PHONY: all
 all: xl
 
@@ -54,7 +49,7 @@ uninstall:
 
 .PHONY: clean
 clean:
-	$(RM) -f *.o xl _paths.h $(DEPS_RM)
+	$(RM) *.o xl $(DEPS_RM)
 
 distclean: clean
 
diff --git a/tools/xl/xl.h b/tools/xl/xl.h
index cf12c79a9b..c5c4bedbdd 100644
--- a/tools/xl/xl.h
+++ b/tools/xl/xl.h
@@ -17,7 +17,6 @@
 
 #include <assert.h>
 
-#include "_paths.h"
 #include <xentoollog.h>
 
 struct cmd_spec {
-- 
Anthony PERARD



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

* [XEN PATCH 19/57] tools/configure.ac: Create ZLIB_LIBS and ZLIB_CFLAGS
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (17 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 18/57] tools: Use config.h from autoconf instead of "buildmakevars2header" Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-07 10:20   ` Juergen Gross
  2021-12-16 17:16   ` Andrew Cooper
  2021-12-06 17:02 ` [XEN PATCH 20/57] tools/Rules.mk: introduce FORCE target Anthony PERARD
                   ` (37 subsequent siblings)
  56 siblings, 2 replies; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu, Juergen Gross

Use both ZLIB_CFLAGS and ZLIB_LIBS instead of cherry-picking flags
from a single "ZLIB" variable.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/configure.ac        | 19 ++++++++++++++-----
 config/Tools.mk.in        |  3 ++-
 tools/configure           | 22 ++++++++++++++--------
 tools/libs/guest/Makefile | 12 +++++-------
 4 files changed, 35 insertions(+), 21 deletions(-)

diff --git a/tools/configure.ac b/tools/configure.ac
index 5a4fb9022d..56afe7930d 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -391,17 +391,26 @@ AX_CHECK_FETCHER
 
 # Checks for libraries.
 AC_CHECK_HEADER([bzlib.h], [
-AC_CHECK_LIB([bz2], [BZ2_bzDecompressInit], [zlib="$zlib -DHAVE_BZLIB -lbz2"])
+    AC_CHECK_LIB([bz2], [BZ2_bzDecompressInit],
+        [ZLIB_CFLAGS="$ZLIB_CFLAGS -DHAVE_BZLIB"
+         ZLIB_LIBS="$ZLIB_LIBS -lbz2"])
 ])
 AC_CHECK_HEADER([lzma.h], [
-AC_CHECK_LIB([lzma], [lzma_stream_decoder], [zlib="$zlib -DHAVE_LZMA -llzma"])
+    AC_CHECK_LIB([lzma], [lzma_stream_decoder],
+        [ZLIB_CFLAGS="$ZLIB_CFLAGS -DHAVE_LZMA"
+         ZLIB_LIBS="$ZLIB_LIBS -llzma"])
 ])
 AC_CHECK_HEADER([lzo/lzo1x.h], [
-AC_CHECK_LIB([lzo2], [lzo1x_decompress], [zlib="$zlib -DHAVE_LZO1X -llzo2"])
+    AC_CHECK_LIB([lzo2], [lzo1x_decompress],
+        [ZLIB_CFLAGS="$ZLIB_CFLAGS -DHAVE_LZO1X"
+         ZLIB_LIBS="$ZLIB_LIBS -llzo2"])
 ])
 PKG_CHECK_MODULES([libzstd], [libzstd],
-    [zlib="$zlib -DHAVE_ZSTD $libzstd_CFLAGS $libzstd_LIBS"], [true])
-AC_SUBST(zlib)
+    [ZLIB_CFLAGS="$ZLIB_CFLAGS -DHAVE_ZSTD $libzstd_CFLAGS"
+     ZLIB_LIBS="$ZLIB_LIBS $libzstd_LIBS"],
+    [true])
+AC_SUBST([ZLIB_CFLAGS])
+AC_SUBST([ZLIB_LIBS])
 AX_CHECK_EXTFS
 AX_CHECK_PTHREAD
 AX_CHECK_PTYFUNCS
diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index 934d899967..6c1a0a676f 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -66,7 +66,8 @@ CONFIG_9PFS         := @ninepfs@
 LINUX_BACKEND_MODULES := @LINUX_BACKEND_MODULES@
 
 #System options
-ZLIB                := @zlib@
+ZLIB_CFLAGS         := @ZLIB_CFLAGS@
+ZLIB_LIBS           := @ZLIB_LIBS@
 CONFIG_LIBICONV     := @libiconv@
 EXTFS_LIBS          := @EXTFS_LIBS@
 CURSES_LIBS         := @CURSES_LIBS@
diff --git a/tools/configure b/tools/configure
index 829753b5dd..a052c186a5 100755
--- a/tools/configure
+++ b/tools/configure
@@ -641,7 +641,8 @@ PTHREAD_LIBS
 PTHREAD_LDFLAGS
 PTHREAD_CFLAGS
 EXTFS_LIBS
-zlib
+ZLIB_LIBS
+ZLIB_CFLAGS
 libzstd_LIBS
 libzstd_CFLAGS
 FETCHER
@@ -8605,7 +8606,7 @@ fi
 ac_fn_c_check_header_mongrel "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default"
 if test "x$ac_cv_header_bzlib_h" = xyes; then :
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzDecompressInit in -lbz2" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzDecompressInit in -lbz2" >&5
 $as_echo_n "checking for BZ2_bzDecompressInit in -lbz2... " >&6; }
 if ${ac_cv_lib_bz2_BZ2_bzDecompressInit+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -8642,7 +8643,8 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bz2_BZ2_bzDecompressInit" >&5
 $as_echo "$ac_cv_lib_bz2_BZ2_bzDecompressInit" >&6; }
 if test "x$ac_cv_lib_bz2_BZ2_bzDecompressInit" = xyes; then :
-  zlib="$zlib -DHAVE_BZLIB -lbz2"
+  ZLIB_CFLAGS="$ZLIB_CFLAGS -DHAVE_BZLIB"
+         ZLIB_LIBS="$ZLIB_LIBS -lbz2"
 fi
 
 
@@ -8652,7 +8654,7 @@ fi
 ac_fn_c_check_header_mongrel "$LINENO" "lzma.h" "ac_cv_header_lzma_h" "$ac_includes_default"
 if test "x$ac_cv_header_lzma_h" = xyes; then :
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzma_stream_decoder in -llzma" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzma_stream_decoder in -llzma" >&5
 $as_echo_n "checking for lzma_stream_decoder in -llzma... " >&6; }
 if ${ac_cv_lib_lzma_lzma_stream_decoder+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -8689,7 +8691,8 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lzma_lzma_stream_decoder" >&5
 $as_echo "$ac_cv_lib_lzma_lzma_stream_decoder" >&6; }
 if test "x$ac_cv_lib_lzma_lzma_stream_decoder" = xyes; then :
-  zlib="$zlib -DHAVE_LZMA -llzma"
+  ZLIB_CFLAGS="$ZLIB_CFLAGS -DHAVE_LZMA"
+         ZLIB_LIBS="$ZLIB_LIBS -llzma"
 fi
 
 
@@ -8699,7 +8702,7 @@ fi
 ac_fn_c_check_header_mongrel "$LINENO" "lzo/lzo1x.h" "ac_cv_header_lzo_lzo1x_h" "$ac_includes_default"
 if test "x$ac_cv_header_lzo_lzo1x_h" = xyes; then :
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzo1x_decompress in -llzo2" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzo1x_decompress in -llzo2" >&5
 $as_echo_n "checking for lzo1x_decompress in -llzo2... " >&6; }
 if ${ac_cv_lib_lzo2_lzo1x_decompress+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -8736,7 +8739,8 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lzo2_lzo1x_decompress" >&5
 $as_echo "$ac_cv_lib_lzo2_lzo1x_decompress" >&6; }
 if test "x$ac_cv_lib_lzo2_lzo1x_decompress" = xyes; then :
-  zlib="$zlib -DHAVE_LZO1X -llzo2"
+  ZLIB_CFLAGS="$ZLIB_CFLAGS -DHAVE_LZO1X"
+         ZLIB_LIBS="$ZLIB_LIBS -llzo2"
 fi
 
 
@@ -8812,10 +8816,12 @@ else
 	libzstd_LIBS=$pkg_cv_libzstd_LIBS
         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
-	zlib="$zlib -DHAVE_ZSTD $libzstd_CFLAGS $libzstd_LIBS"
+	ZLIB_CFLAGS="$ZLIB_CFLAGS -DHAVE_ZSTD $libzstd_CFLAGS"
+     ZLIB_LIBS="$ZLIB_LIBS $libzstd_LIBS"
 fi
 
 
+
 ac_fn_c_check_header_mongrel "$LINENO" "ext2fs/ext2fs.h" "ac_cv_header_ext2fs_ext2fs_h" "$ac_includes_default"
 if test "x$ac_cv_header_ext2fs_ext2fs_h" = xyes; then :
 
diff --git a/tools/libs/guest/Makefile b/tools/libs/guest/Makefile
index 8f5f3acd21..1f4b7f7c58 100644
--- a/tools/libs/guest/Makefile
+++ b/tools/libs/guest/Makefile
@@ -89,13 +89,12 @@ CFLAGS	+= $(CFLAGS_libxendevicemodel)
 CFLAGS += $(CFLAGS_libxencall) $(CFLAGS_libxenforeignmemory)
 
 ifeq ($(CONFIG_MiniOS),y)
-zlib-options =
-else
-zlib-options = $(ZLIB)
+ZLIB_CFLAGS :=
+ZLIB_LIBS :=
 endif
 
-xg_dom_bzimageloader.o: CFLAGS += $(filter -D%,$(zlib-options))
-xg_dom_bzimageloader.opic: CFLAGS += $(filter -D%,$(zlib-options))
+xg_dom_bzimageloader.o: CFLAGS += $(ZLIB_CFLAGS)
+xg_dom_bzimageloader.opic: CFLAGS += $(ZLIB_CFLAGS)
 
 LIBHEADER := xenguest.h
 
@@ -103,8 +102,7 @@ NO_HEADERS_CHK := y
 
 include $(XEN_ROOT)/tools/libs/libs.mk
 
-libxenguest.so.$(MAJOR).$(MINOR): COMPRESSION_LIBS = $(filter -l%,$(zlib-options))
-libxenguest.so.$(MAJOR).$(MINOR): APPEND_LDFLAGS += $(COMPRESSION_LIBS) -lz
+libxenguest.so.$(MAJOR).$(MINOR): APPEND_LDFLAGS += $(ZLIB_LIBS) -lz
 
 -include $(DEPS_INCLUDE)
 
-- 
Anthony PERARD



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

* [XEN PATCH 20/57] tools/Rules.mk: introduce FORCE target
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (18 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 19/57] tools/configure.ac: Create ZLIB_LIBS and ZLIB_CFLAGS Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-07 10:54   ` Juergen Gross
  2021-12-06 17:02 ` [XEN PATCH 21/57] tools/include/xen-foreign: avoid to rely on default .SUFFIXES Anthony PERARD
                   ` (36 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu, Juergen Gross

And replace the one defined in libs.mk.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/Rules.mk     | 3 +++
 tools/libs/libs.mk | 3 ---
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/Rules.mk b/tools/Rules.mk
index 4e9b4ee17f..0d3febfbb6 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -210,3 +210,6 @@ $(PKG_CONFIG_DIR)/%.pc: Makefile $(XEN_ROOT)/tools/Rules.mk $(PKG_CONFIG_DIR)
 	echo "Libs.private: $(PKG_CONFIG_LIBSPRIV)"; \
 	echo "Requires.private: $(PKG_CONFIG_REQPRIV)"; \
 	} > $@
+
+.PHONY: FORCE
+FORCE:
diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk
index 5c2f16dda4..996d467346 100644
--- a/tools/libs/libs.mk
+++ b/tools/libs/libs.mk
@@ -135,6 +135,3 @@ clean:
 
 .PHONY: distclean
 distclean: clean
-
-.PHONY: FORCE
-FORCE:
-- 
Anthony PERARD



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

* [XEN PATCH 21/57] tools/include/xen-foreign: avoid to rely on default .SUFFIXES
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (19 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 20/57] tools/Rules.mk: introduce FORCE target Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-06 17:02 ` [XEN PATCH 22/57] tools/console: have one Makefile per program/directory Anthony PERARD
                   ` (35 subsequent siblings)
  56 siblings, 0 replies; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel; +Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu

When a rule isn't a pattern rule, and thus don't have a %, the
value of the automatic variable stem $* depends on .SUFFIXES. GNU make
manual explain that it is better to avoid this "bizarre" behavior
which exist for compatibility.

Use $(basename ) instead. So we can one day avoid make's build-in
rules and variables.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/include/xen-foreign/Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/include/xen-foreign/Makefile b/tools/include/xen-foreign/Makefile
index e395011fdd..6ce51daf5e 100644
--- a/tools/include/xen-foreign/Makefile
+++ b/tools/include/xen-foreign/Makefile
@@ -25,28 +25,28 @@ check-headers: checker
 	rm tmp.size
 
 arm32.h: mkheader.py structs.py $(ROOT)/arch-arm.h $(ROOT)/xen.h
-	$(PYTHON) $< $* $@.tmp $(filter %.h,$^)
+	$(PYTHON) $< $(basename $@) $@.tmp $(filter %.h,$^)
 	#Avoid mixing an alignment directive with a uint64_t cast or sizeof expression
 	sed 's/(__align8__ \(uint64_t\))/(\1)/g' < $@.tmp > $@.tmp2
 	rm $@.tmp
 	$(call move-if-changed,$@.tmp2,$@)
 
 arm64.h: mkheader.py structs.py $(ROOT)/arch-arm.h $(ROOT)/xen.h
-	$(PYTHON) $< $* $@.tmp $(filter %.h,$^)
+	$(PYTHON) $< $(basename $@) $@.tmp $(filter %.h,$^)
 	#Avoid mixing an alignment directive with a uint64_t cast or sizeof expression
 	sed 's/(__align8__ \(uint64_t\))/(\1)/g' < $@.tmp > $@.tmp2
 	rm $@.tmp
 	$(call move-if-changed,$@.tmp2,$@)
 
 x86_32.h: mkheader.py structs.py $(ROOT)/arch-x86/xen-x86_32.h $(ROOT)/arch-x86/xen.h $(ROOT)/xen.h
-	$(PYTHON) $< $* $@.tmp $(filter %.h,$^)
+	$(PYTHON) $< $(basename $@) $@.tmp $(filter %.h,$^)
 	#Avoid mixing an alignment directive with a uint64_t cast or sizeof expression
 	sed 's/(__align8__ \(uint64_t\))/(\1)/g' < $@.tmp > $@.tmp2
 	rm $@.tmp
 	$(call move-if-changed,$@.tmp2,$@)
 
 x86_64.h: mkheader.py structs.py $(ROOT)/arch-x86/xen-x86_64.h $(ROOT)/arch-x86/xen.h $(ROOT)/xen.h
-	$(PYTHON) $< $* $@.tmp $(filter %.h,$^)
+	$(PYTHON) $< $(basename $@) $@.tmp $(filter %.h,$^)
 	#Avoid mixing an alignment directive with a uint64_t cast or sizeof expression
 	sed 's/(__align8__ \(uint64_t\))/(\1)/g' < $@.tmp > $@.tmp2
 	rm $@.tmp
-- 
Anthony PERARD



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

* [XEN PATCH 22/57] tools/console: have one Makefile per program/directory
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (20 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 21/57] tools/include/xen-foreign: avoid to rely on default .SUFFIXES Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-16 17:26   ` Andrew Cooper
  2021-12-06 17:02 ` [XEN PATCH 23/57] tools/debugger: Allow make to recurse into debugger/ Anthony PERARD
                   ` (34 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Andrew Cooper, George Dunlap,
	Ian Jackson, Jan Beulich, Julien Grall, Stefano Stabellini,
	Wei Liu

Sources of both xenconsoled and xenconsole are already separated into
different directory and don't share anything in common. Having two
different Makefile means it's easier to deal with *FLAGS.

Some common changes:
Rename $(BIN) to $(TARGETS), this will be useful later.
Stop removing *.so *.rpm *.a as they aren't created here.
Use $(OBJS-y) to list objects.
Update $(CFLAGS) for the directory rather than a single object.

daemon:
    Remove the need for $(LDLIBS_xenconsoled), use $(LDLIBS) instead.
    Remove the need for $(CONSOLE_CFLAGS-y) and use $(CFLAGS-y)
	instead.

client:
    Remove the unused $(LDLIBS_xenconsole)

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 .gitignore                    |  4 +--
 tools/console/Makefile        | 49 +++-------------------------------
 tools/console/client/Makefile | 39 +++++++++++++++++++++++++++
 tools/console/daemon/Makefile | 50 +++++++++++++++++++++++++++++++++++
 4 files changed, 94 insertions(+), 48 deletions(-)
 create mode 100644 tools/console/client/Makefile
 create mode 100644 tools/console/daemon/Makefile

diff --git a/.gitignore b/.gitignore
index b39b996718..c31fa9b841 100644
--- a/.gitignore
+++ b/.gitignore
@@ -159,8 +159,8 @@ tools/libs/util/libxenutil.map
 tools/libs/vchan/headers.chk
 tools/libs/vchan/libxenvchan.map
 tools/libs/vchan/xenvchan.pc
-tools/console/xenconsole
-tools/console/xenconsoled
+tools/console/client/xenconsole
+tools/console/daemon/xenconsoled
 tools/debugger/gdb/gdb-6.2.1-linux-i386-xen/*
 tools/debugger/gdb/gdb-6.2.1/*
 tools/debugger/gdb/gdb-6.2.1.tar.bz2
diff --git a/tools/console/Makefile b/tools/console/Makefile
index 207c04c9cd..63bd2ac302 100644
--- a/tools/console/Makefile
+++ b/tools/console/Makefile
@@ -1,50 +1,7 @@
 XEN_ROOT=$(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-CFLAGS  += -Werror
+SUBDIRS-y := daemon client
 
-CFLAGS  += $(CFLAGS_libxenctrl)
-CFLAGS  += $(CFLAGS_libxenstore)
-LDLIBS += $(LDLIBS_libxenctrl)
-LDLIBS += $(LDLIBS_libxenstore)
-LDLIBS += $(SOCKET_LIBS)
-
-LDLIBS_xenconsoled += $(UTIL_LIBS)
-LDLIBS_xenconsoled += -lrt
-CONSOLE_CFLAGS-$(CONFIG_ARM) = -DCONFIG_ARM
-
-BIN      = xenconsoled xenconsole
-
-.PHONY: all
-all: $(BIN)
-
-.PHONY: clean
-clean:
-	$(RM) *.a *.so *.o *.rpm $(BIN) $(DEPS_RM)
-	$(RM) client/*.o daemon/*.o
-
-.PHONY: distclean
-distclean: clean
-
-daemon/main.o: CFLAGS += -include $(XEN_ROOT)/tools/config.h
-daemon/io.o: CFLAGS += $(CFLAGS_libxenevtchn) $(CFLAGS_libxengnttab) $(CFLAGS_libxenforeignmemory) $(CONSOLE_CFLAGS-y)
-xenconsoled: $(patsubst %.c,%.o,$(wildcard daemon/*.c))
-	$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS) $(LDLIBS_libxenevtchn) $(LDLIBS_libxengnttab) $(LDLIBS_libxenforeignmemory) $(LDLIBS_xenconsoled) $(APPEND_LDFLAGS)
-
-client/main.o: CFLAGS += -include $(XEN_ROOT)/tools/config.h
-xenconsole: $(patsubst %.c,%.o,$(wildcard client/*.c))
-	$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS) $(LDLIBS_xenconsole) $(APPEND_LDFLAGS)
-
-.PHONY: install
-install: $(BIN)
-	$(INSTALL_DIR) $(DESTDIR)/$(sbindir)
-	$(INSTALL_PROG) xenconsoled $(DESTDIR)/$(sbindir)
-	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
-	$(INSTALL_PROG) xenconsole $(DESTDIR)$(LIBEXEC_BIN)
-
-.PHONY: uninstall
-uninstall:
-	rm -f $(DESTDIR)$(LIBEXEC_BIN)/xenconsole
-	rm -f $(DESTDIR)$(sbindir)/xenconsoled
-
--include $(DEPS_INCLUDE)
+.PHONY: all clean install distclean uninstall
+all clean install distclean uninstall: %: subdirs-%
diff --git a/tools/console/client/Makefile b/tools/console/client/Makefile
new file mode 100644
index 0000000000..44176c6d93
--- /dev/null
+++ b/tools/console/client/Makefile
@@ -0,0 +1,39 @@
+XEN_ROOT=$(CURDIR)/../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+CFLAGS += -Werror
+CFLAGS += $(CFLAGS_libxenctrl)
+CFLAGS += $(CFLAGS_libxenstore)
+CFLAGS += -include $(XEN_ROOT)/tools/config.h
+
+LDLIBS += $(LDLIBS_libxenctrl)
+LDLIBS += $(LDLIBS_libxenstore)
+LDLIBS += $(SOCKET_LIBS)
+
+OBJS-y := main.o
+
+TARGETS := xenconsole
+
+.PHONY: all
+all: $(TARGETS)
+
+xenconsole: $(OBJS-y)
+	$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS) $(APPEND_LDFLAGS)
+
+.PHONY: install
+install: all
+	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
+	$(INSTALL_PROG) xenconsole $(DESTDIR)$(LIBEXEC_BIN)
+
+.PHONY: uninstall
+uninstall:
+	rm -f $(DESTDIR)$(LIBEXEC_BIN)/xenconsole
+
+.PHONY: clean
+clean:
+	$(RM) *.o $(TARGETS) $(DEPS_RM)
+
+.PHONY: distclean
+distclean: clean
+
+-include $(DEPS_INCLUDE)
diff --git a/tools/console/daemon/Makefile b/tools/console/daemon/Makefile
new file mode 100644
index 0000000000..0f004f0b14
--- /dev/null
+++ b/tools/console/daemon/Makefile
@@ -0,0 +1,50 @@
+XEN_ROOT=$(CURDIR)/../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+CFLAGS += -Werror
+CFLAGS += $(CFLAGS_libxenctrl)
+CFLAGS += $(CFLAGS_libxenstore)
+CFLAGS += $(CFLAGS_libxenevtchn)
+CFLAGS += $(CFLAGS_libxengnttab)
+CFLAGS += $(CFLAGS_libxenforeignmemory)
+CFLAGS-$(CONFIG_ARM) += -DCONFIG_ARM
+CFLAGS += -include $(XEN_ROOT)/tools/config.h
+
+LDLIBS += $(LDLIBS_libxenctrl)
+LDLIBS += $(LDLIBS_libxenstore)
+LDLIBS += $(LDLIBS_libxenevtchn)
+LDLIBS += $(LDLIBS_libxengnttab)
+LDLIBS += $(LDLIBS_libxenforeignmemory)
+LDLIBS += $(SOCKET_LIBS)
+LDLIBS += $(UTIL_LIBS)
+LDLIBS += -lrt
+
+OBJS-y := main.o
+OBJS-y += io.o
+OBJS-y += utils.o
+
+TARGETS := xenconsoled
+
+.PHONY: all
+all: $(TARGETS)
+
+xenconsoled: $(OBJS-y)
+	$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS) $(APPEND_LDFLAGS)
+
+.PHONY: install
+install: all
+	$(INSTALL_DIR) $(DESTDIR)/$(sbindir)
+	$(INSTALL_PROG) xenconsoled $(DESTDIR)/$(sbindir)
+
+.PHONY: uninstall
+uninstall:
+	rm -f $(DESTDIR)$(sbindir)/xenconsoled
+
+.PHONY: clean
+clean:
+	$(RM) *.o $(TARGETS) $(DEPS_RM)
+
+.PHONY: distclean
+distclean: clean
+
+-include $(DEPS_INCLUDE)
-- 
Anthony PERARD



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

* [XEN PATCH 23/57] tools/debugger: Allow make to recurse into debugger/
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (21 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 22/57] tools/console: have one Makefile per program/directory Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-06 17:02 ` [XEN PATCH 24/57] tools/debugger/gdbsx: Fix and cleanup makefiles Anthony PERARD
                   ` (33 subsequent siblings)
  56 siblings, 0 replies; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel; +Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu

Avoid the need for explicite rules to recurse into debugger/* dirs by
adding a Makefile in debugger/.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/Makefile          | 27 +--------------------------
 tools/debugger/Makefile |  8 ++++++++
 2 files changed, 9 insertions(+), 26 deletions(-)
 create mode 100644 tools/debugger/Makefile

diff --git a/tools/Makefile b/tools/Makefile
index 8936b754c8..79b4c7e3de 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -32,8 +32,7 @@ SUBDIRS-$(CONFIG_GOLANG) += golang
 SUBDIRS-y += xl
 SUBDIRS-y += helpers
 SUBDIRS-$(CONFIG_X86) += xenpaging
-SUBDIRS-$(CONFIG_X86) += debugger/gdbsx
-SUBDIRS-$(CONFIG_X86) += debugger/kdd
+SUBDIRS-$(CONFIG_X86) += debugger
 SUBDIRS-$(CONFIG_TESTS) += tests
 
 SUBDIRS-y += python
@@ -272,30 +271,6 @@ subdir-clean-qemu-xen-dir:
 
 subdir-uninstall-qemu-xen-dir: ;
 
-subdir-clean-debugger/gdbsx subdir-distclean-debugger/gdbsx: .phony
-	$(MAKE) -C debugger/gdbsx clean
-
-subdir-install-debugger/gdbsx: .phony
-	$(MAKE) -C debugger/gdbsx install
-
-subdir-all-debugger/gdbsx: .phony
-	$(MAKE) -C debugger/gdbsx all
-
-subdir-uninstall-debugger/gdbsx: .phony
-	$(MAKE) -C debugger/gdbsx uninstall
-
-subdir-clean-debugger/kdd subdir-distclean-debugger/kdd: .phony
-	$(MAKE) -C debugger/kdd clean
-
-subdir-install-debugger/kdd: .phony
-	$(MAKE) -C debugger/kdd install
-
-subdir-uninstall-debugger/kdd: .phony
-	$(MAKE) -C debugger/kdd uninstall
-
-subdir-all-debugger/kdd: .phony
-	$(MAKE) -C debugger/kdd all
-
 subtree-force-update:
 ifeq ($(CONFIG_QEMU_XEN),y)
 	$(MAKE) qemu-xen-dir-force-update
diff --git a/tools/debugger/Makefile b/tools/debugger/Makefile
new file mode 100644
index 0000000000..51efd3680b
--- /dev/null
+++ b/tools/debugger/Makefile
@@ -0,0 +1,8 @@
+XEN_ROOT=$(CURDIR)/../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+SUBDIRS-y := gdbsx
+SUBDIRS-y += kdd
+
+.PHONY: all clean install distclean uninstall
+all clean install distclean uninstall: %: subdirs-%
-- 
Anthony PERARD



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

* [XEN PATCH 24/57] tools/debugger/gdbsx: Fix and cleanup makefiles
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (22 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 23/57] tools/debugger: Allow make to recurse into debugger/ Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-16 17:55   ` Andrew Cooper
  2021-12-06 17:02 ` [XEN PATCH 25/57] tools/examples: cleanup Makefile Anthony PERARD
                   ` (32 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Elena Ufimtseva, Ian Jackson, Wei Liu

gdbsx/:
  - Make use of subdir facility for the "clean" target.
  - No need to remove the *.a, they aren't in this dir.
  - Avoid calling "distclean" in subdirs as "distclean" targets do only
    call "clean", and the "clean" also runs "clean" in subdirs.
  - Avoid the need to make "gx_all.a" and "xg_all.a" in the "all"
    recipe by forcing make to check for update of "xg/xg_all.a" and
    "gx/gx_all.a" by having "FORCE" as prerequisite. Now, when making
    "gdbsx", make will recurse even when both *.a already exist.
  - List target in $(TARGETS).

gdbsx/*/:
  - Fix dependency on *.h.
  - Remove some dead code.
  - List targets in $(TARGETS).
  - Remove "build" target.
  - Cleanup "clean" targets.
  - remove comments about the choice of "ar" instead of "ld"

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/debugger/gdbsx/Makefile    | 20 ++++++++++----------
 tools/debugger/gdbsx/gx/Makefile | 15 +++++++--------
 tools/debugger/gdbsx/xg/Makefile | 25 +++++++------------------
 3 files changed, 24 insertions(+), 36 deletions(-)

diff --git a/tools/debugger/gdbsx/Makefile b/tools/debugger/gdbsx/Makefile
index 8d7cd94a31..4aaf427c45 100644
--- a/tools/debugger/gdbsx/Makefile
+++ b/tools/debugger/gdbsx/Makefile
@@ -1,20 +1,20 @@
 XEN_ROOT = $(CURDIR)/../../..
 include ./Rules.mk
 
+SUBDIRS-y += gx
+SUBDIRS-y += xg
+
+TARGETS := gdbsx
+
 .PHONY: all
-all:
-	$(MAKE) -C gx
-	$(MAKE) -C xg
-	$(MAKE) gdbsx
+all: $(TARGETS)
 
 .PHONY: clean
-clean:
-	rm -f xg_all.a gx_all.a gdbsx
-	set -e; for d in xg gx; do $(MAKE) -C $$d clean; done
+clean: subdirs-clean
+	rm -f $(TARGETS)
 
 .PHONY: distclean
 distclean: clean
-	set -e; for d in xg gx; do $(MAKE) -c $$d distclean; done
 
 .PHONY: install
 install: all
@@ -28,7 +28,7 @@ uninstall:
 gdbsx: gx/gx_all.a xg/xg_all.a 
 	$(CC) $(LDFLAGS) -o $@ $^
 
-xg/xg_all.a:
+xg/xg_all.a: FORCE
 	$(MAKE) -C xg
-gx/gx_all.a:
+gx/gx_all.a: FORCE
 	$(MAKE) -C gx
diff --git a/tools/debugger/gdbsx/gx/Makefile b/tools/debugger/gdbsx/gx/Makefile
index 3b8467f799..ff5c8e9e6e 100644
--- a/tools/debugger/gdbsx/gx/Makefile
+++ b/tools/debugger/gdbsx/gx/Makefile
@@ -2,21 +2,20 @@ XEN_ROOT = $(CURDIR)/../../../..
 include ../Rules.mk
 
 GX_OBJS := gx_comm.o gx_main.o gx_utils.o gx_local.o
-GX_HDRS := $(wildcard *.h)
+
+TARGETS := gx_all.a
 
 .PHONY: all
-all: gx_all.a
+all: $(TARGETS)
 
 .PHONY: clean
 clean:
-	rm -rf gx_all.a *.o .*.d
+	rm -f *.o $(TARGETS) $(DEPS_RM)
 
 .PHONY: distclean
 distclean: clean
 
-#%.o: %.c $(GX_HDRS) Makefile
-#	$(CC) -c $(CFLAGS) -o $@ $<
-
-gx_all.a: $(GX_OBJS) Makefile $(GX_HDRS)
-	ar cr $@ $(GX_OBJS)        # problem with ld using -m32 
+gx_all.a: $(GX_OBJS) Makefile
+	ar cr $@ $(GX_OBJS)
 
+-include $(DEPS_INCLUDE)
diff --git a/tools/debugger/gdbsx/xg/Makefile b/tools/debugger/gdbsx/xg/Makefile
index acdcddf0d5..a02c7649cf 100644
--- a/tools/debugger/gdbsx/xg/Makefile
+++ b/tools/debugger/gdbsx/xg/Makefile
@@ -1,35 +1,24 @@
 XEN_ROOT = $(CURDIR)/../../../..
 include ../Rules.mk
 
-XG_HDRS := xg_public.h 
 XG_OBJS := xg_main.o 
 
 CFLAGS += -D__XEN_TOOLS__
 CFLAGS += $(CFLAGS_xeninclude)
 
+TARGETS := xg_all.a
 
 .PHONY: all
-all: build
+all: $(TARGETS)
 
-.PHONY: build
-build: xg_all.a $(XG_HDRS) $(XG_OBJS) Makefile
-# build: mk-symlinks xg_all.a $(XG_HDRS) $(XG_OBJS) Makefile
-# build: mk-symlinks xg_all.a
-
-xg_all.a: $(XG_OBJS) Makefile $(XG_HDRS)
-	ar cr $@ $(XG_OBJS)    # problems using -m32 in ld 
-#	$(LD) -b elf32-i386 $(LDFLAGS) -r -o $@ $^
-#	$(CC) -m32 -c -o $@ $^
-
-# xg_main.o: xg_main.c Makefile $(XG_HDRS)
-#$(CC) -c $(CFLAGS) -o $@ $<
-
-# %.o: %.c $(XG_HDRS) Makefile  -- doesn't work as it won't overwrite Rules.mk
-#%.o: %.c       -- doesn't recompile when .c changed
+xg_all.a: $(XG_OBJS) Makefile
+	ar cr $@ $(XG_OBJS)
 
 .PHONY: clean
 clean:
-	rm -rf xen xg_all.a $(XG_OBJS)  .*.d
+	rm -f $(TARGETS) $(XG_OBJS) $(DEPS_RM)
 
 .PHONY: distclean
 distclean: clean
+
+-include $(DEPS_INCLUDE)
-- 
Anthony PERARD



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

* [XEN PATCH 25/57] tools/examples: cleanup Makefile
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (23 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 24/57] tools/debugger/gdbsx: Fix and cleanup makefiles Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-16 17:57   ` Andrew Cooper
  2021-12-06 17:02 ` [XEN PATCH 26/57] tools/firmware/hvmloader: rework Makefile Anthony PERARD
                   ` (31 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel; +Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu

Don't check if a target exist before installing it. For directory,
install doesn't complain, and for file it would prevent from updating
them.

Remove XEN_CONFIGS-y which isn't used.

Remove "build" target.

Add an empty line after the first comment. The comment isn't about
$(XEN_READMES), it is about the makefile as a whole.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/examples/Makefile | 21 ++++++---------------
 1 file changed, 6 insertions(+), 15 deletions(-)

diff --git a/tools/examples/Makefile b/tools/examples/Makefile
index 14e24f4cb3..48b520e133 100644
--- a/tools/examples/Makefile
+++ b/tools/examples/Makefile
@@ -2,6 +2,7 @@ XEN_ROOT = $(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
 # Xen configuration dir and configs to go there.
+
 XEN_READMES = README
 
 XEN_CONFIGS += xlexample.hvm
@@ -10,14 +11,9 @@ XEN_CONFIGS += xlexample.pvhlinux
 XEN_CONFIGS += xl.conf
 XEN_CONFIGS += cpupool
 
-XEN_CONFIGS += $(XEN_CONFIGS-y)
-
 .PHONY: all
 all:
 
-.PHONY: build
-build:
-
 .PHONY: install
 install: all install-readmes install-configs
 
@@ -26,10 +22,8 @@ uninstall: uninstall-readmes uninstall-configs
 
 .PHONY: install-readmes
 install-readmes:
-	[ -d $(DESTDIR)$(XEN_CONFIG_DIR) ] || \
-		$(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)
-	set -e; for i in $(XEN_READMES); \
-	    do [ -e $(DESTDIR)$(XEN_CONFIG_DIR)/$$i ] || \
+	$(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)
+	set -e; for i in $(XEN_READMES); do \
 	    $(INSTALL_DATA) $$i $(DESTDIR)$(XEN_CONFIG_DIR); \
 	done
 
@@ -39,12 +33,9 @@ uninstall-readmes:
 
 .PHONY: install-configs
 install-configs: $(XEN_CONFIGS)
-	[ -d $(DESTDIR)$(XEN_CONFIG_DIR) ] || \
-		$(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)
-	[ -d $(DESTDIR)$(XEN_CONFIG_DIR)/auto ] || \
-		$(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)/auto
-	set -e; for i in $(XEN_CONFIGS); \
-	    do [ -e $(DESTDIR)$(XEN_CONFIG_DIR)/$$i ] || \
+	$(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)
+	$(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)/auto
+	set -e; for i in $(XEN_CONFIGS); do \
 	    $(INSTALL_DATA) $$i $(DESTDIR)$(XEN_CONFIG_DIR); \
 	done
 
-- 
Anthony PERARD



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

* [XEN PATCH 26/57] tools/firmware/hvmloader: rework Makefile
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (24 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 25/57] tools/examples: cleanup Makefile Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-16 18:03   ` Andrew Cooper
  2021-12-06 17:02 ` [XEN PATCH 27/57] tools/fuzz/libelf: rework makefile Anthony PERARD
                   ` (30 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Jan Beulich, Andrew Cooper,
	Roger Pau Monné,
	Wei Liu, Ian Jackson

Setup proper dependencies with libacpi so we don't need to run "make
hvmloader" in the "all" target. ("build.o" new prerequisite isn't
exactly proper but a side effect of building the $(DSDT_FILES) is to
generate the "ssdt_*.h" needed by "build.o".)

Make use if "-iquote" instead of a plain "-I".

For "roms.inc" target, use "$(SHELL)" instead of plain "sh". And use
full path to "mkhex" instead of a relative one. Lastly, add "-f" flag
to "mv", in case the target already exist.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/firmware/hvmloader/Makefile | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/tools/firmware/hvmloader/Makefile b/tools/firmware/hvmloader/Makefile
index b754220839..fc20932110 100644
--- a/tools/firmware/hvmloader/Makefile
+++ b/tools/firmware/hvmloader/Makefile
@@ -60,8 +60,7 @@ ROMS += $(ROMBIOS_ROM) $(STDVGA_ROM) $(CIRRUSVGA_ROM)
 endif
 
 .PHONY: all
-all: acpi
-	$(MAKE) hvmloader
+all: hvmloader
 
 .PHONY: acpi
 acpi:
@@ -73,12 +72,15 @@ smbios.o: CFLAGS += -D__SMBIOS_DATE__="\"$(SMBIOS_REL_DATE)\""
 ACPI_PATH = ../../libacpi
 DSDT_FILES = dsdt_anycpu.c dsdt_15cpu.c dsdt_anycpu_qemu_xen.c
 ACPI_OBJS = $(patsubst %.c,%.o,$(DSDT_FILES)) build.o static_tables.o
-$(ACPI_OBJS): CFLAGS += -I. -DLIBACPI_STDUTILS=\"$(CURDIR)/util.h\"
+$(ACPI_OBJS): CFLAGS += -iquote . -DLIBACPI_STDUTILS=\"$(CURDIR)/util.h\"
 CFLAGS += -I$(ACPI_PATH)
 vpath build.c $(ACPI_PATH)
 vpath static_tables.c $(ACPI_PATH)
 OBJS += $(ACPI_OBJS)
 
+$(DSDT_FILES): acpi
+build.o: $(DSDT_FILES)
+
 hvmloader: $(OBJS) hvmloader.lds
 	$(LD) $(LDFLAGS_DIRECT) -N -T hvmloader.lds -o $@ $(OBJS)
 
@@ -87,21 +89,21 @@ roms.inc: $(ROMS)
 
 ifneq ($(ROMBIOS_ROM),)
 	echo "#ifdef ROM_INCLUDE_ROMBIOS" >> $@.new
-	sh ../../misc/mkhex rombios $(ROMBIOS_ROM) >> $@.new
+	$(SHELL) $(XEN_ROOT)/tools/misc/mkhex rombios $(ROMBIOS_ROM) >> $@.new
 	echo "#endif" >> $@.new
 endif
 
 ifneq ($(STDVGA_ROM),)
 	echo "#ifdef ROM_INCLUDE_VGABIOS" >> $@.new
-	sh ../../misc/mkhex vgabios_stdvga $(STDVGA_ROM) >> $@.new
+	$(SHELL) $(XEN_ROOT)/tools/misc/mkhex vgabios_stdvga $(STDVGA_ROM) >> $@.new
 	echo "#endif" >> $@.new
 endif
 ifneq ($(CIRRUSVGA_ROM),)
 	echo "#ifdef ROM_INCLUDE_VGABIOS" >> $@.new
-	sh ../../misc/mkhex vgabios_cirrusvga $(CIRRUSVGA_ROM) >> $@.new
+	$(SHELL) $(XEN_ROOT)/tools/misc/mkhex vgabios_cirrusvga $(CIRRUSVGA_ROM) >> $@.new
 	echo "#endif" >> $@.new
 endif
-	mv $@.new $@
+	mv -f $@.new $@
 
 .PHONY: clean
 clean:
-- 
Anthony PERARD



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

* [XEN PATCH 27/57] tools/fuzz/libelf: rework makefile
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (25 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 26/57] tools/firmware/hvmloader: rework Makefile Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-06 17:02 ` [XEN PATCH 28/57] tools/fuzz/x86_instruction_emulator: " Anthony PERARD
                   ` (29 subsequent siblings)
  56 siblings, 0 replies; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Andrew Cooper, George Dunlap,
	Ian Jackson, Jan Beulich, Julien Grall, Stefano Stabellini,
	Wei Liu

Rename ELF_LIB_OBJS to LIBELF_OBJS as to have the same name as in
libs/guest/.

Replace "-I" by "-iquote".

Remove the use of "vpath". It will not works when we will convert this
makefile to subdirmk. Instead, we create symlinks to the source files.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 .gitignore                 |  1 +
 tools/fuzz/libelf/Makefile | 21 ++++++++++-----------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/.gitignore b/.gitignore
index c31fa9b841..4267bb4dee 100644
--- a/.gitignore
+++ b/.gitignore
@@ -197,6 +197,7 @@ tools/flask/utils/flask-setenforce
 tools/flask/utils/flask-set-bool
 tools/flask/utils/flask-label-pci
 tools/fuzz/libelf/afl-libelf-fuzzer
+tools/fuzz/libelf/libelf-*.c
 tools/fuzz/x86_instruction_emulator/asm
 tools/fuzz/x86_instruction_emulator/afl-harness
 tools/fuzz/x86_instruction_emulator/afl-harness-cov
diff --git a/tools/fuzz/libelf/Makefile b/tools/fuzz/libelf/Makefile
index 9eb30ee40c..9211f75951 100644
--- a/tools/fuzz/libelf/Makefile
+++ b/tools/fuzz/libelf/Makefile
@@ -1,25 +1,24 @@
 XEN_ROOT = $(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-# libelf fuzz target
-vpath %.c ../../../xen/common/libelf
-CFLAGS += -I../../../xen/common/libelf
-ELF_SRCS-y += libelf-tools.c libelf-loader.c libelf-dominfo.c
-ELF_LIB_OBJS := $(patsubst %.c,%.o,$(ELF_SRCS-y))
+LIBELF_OBJS := libelf-tools.o libelf-loader.o libelf-dominfo.o
 
-$(patsubst %.c,%.o,$(ELF_SRCS-y)): CFLAGS += -Wno-pointer-sign
-
-$(ELF_LIB_OBJS): CFLAGS += -DFUZZ_NO_LIBXC $(CFLAGS_xeninclude)
+CFLAGS += -iquote ../../../xen/common/libelf
+$(LIBELF_OBJS): CFLAGS += -Wno-pointer-sign
+$(LIBELF_OBJS): CFLAGS += -DFUZZ_NO_LIBXC $(CFLAGS_xeninclude)
 
 libelf-fuzzer.o: CFLAGS += $(CFLAGS_xeninclude)
 
-libelf.a: libelf-fuzzer.o $(ELF_LIB_OBJS)
+$(LIBELF_OBJS:.o=.c): libelf-%.c: ../../../xen/common/libelf/libelf-%.c FORCE
+	ln -nsf $< $@
+
+libelf.a: libelf-fuzzer.o $(LIBELF_OBJS)
 	$(AR) rc $@ $^
 
 .PHONY: libelf-fuzzer-all
 libelf-fuzzer-all: libelf.a libelf-fuzzer.o
 
-afl-libelf-fuzzer: afl-libelf-fuzzer.o libelf-fuzzer.o $(ELF_LIB_OBJS)
+afl-libelf-fuzzer: afl-libelf-fuzzer.o libelf-fuzzer.o $(LIBELF_OBJS)
 	$(CC) $(CFLAGS) $^ -o $@
 
 # Common targets
@@ -31,7 +30,7 @@ distclean: clean
 
 .PHONY: clean
 clean:
-	rm -f *.o .*.d *.a *-libelf-fuzzer
+	rm -f *.o .*.d *.a *-libelf-fuzzer $(LIBELF_OBJS:.o=.c)
 
 .PHONY: install
 install: all
-- 
Anthony PERARD



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

* [XEN PATCH 28/57] tools/fuzz/x86_instruction_emulator: rework makefile
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (26 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 27/57] tools/fuzz/libelf: rework makefile Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-06 17:02 ` [XEN PATCH 29/57] tools/helper: Cleanup Makefile Anthony PERARD
                   ` (28 subsequent siblings)
  56 siblings, 0 replies; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Andrew Cooper, George Dunlap,
	Ian Jackson, Jan Beulich, Julien Grall, Stefano Stabellini,
	Wei Liu, Roger Pau Monné

Rework dependencies of all objects. We don't need to add dependencies
for headers that $(CC) is capable of generating, we only need to
include $(DEPS_INCLUDE). Some dependencies are still needed so make
knows to generate symlinks for them.

We remove the use of "vpath" for cpuid.c. While it works fine for now,
when we will convert this makefile to subdirmk, vpath will not be
usable. Also, "-iquote" is now needed to build "cpuid.o".

Replace "-I." by "-iquote .", so it applies to double-quote includes
only.

Rather than checking if a symlink exist, always regenerate the
symlink. So if the source tree changed location, the symlink is
updated.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 .gitignore                                   |  1 +
 tools/fuzz/x86_instruction_emulator/Makefile | 32 +++++++++-----------
 2 files changed, 15 insertions(+), 18 deletions(-)

diff --git a/.gitignore b/.gitignore
index 4267bb4dee..8fb74a4c94 100644
--- a/.gitignore
+++ b/.gitignore
@@ -201,6 +201,7 @@ tools/fuzz/libelf/libelf-*.c
 tools/fuzz/x86_instruction_emulator/asm
 tools/fuzz/x86_instruction_emulator/afl-harness
 tools/fuzz/x86_instruction_emulator/afl-harness-cov
+tools/fuzz/x86_instruction_emulator/cpuid.c
 tools/fuzz/x86_instruction_emulator/wrappers.c
 tools/fuzz/x86_instruction_emulator/x86_emulate
 tools/fuzz/x86_instruction_emulator/x86-emulate.[ch]
diff --git a/tools/fuzz/x86_instruction_emulator/Makefile b/tools/fuzz/x86_instruction_emulator/Makefile
index 1a6dbf94e1..f11437e6a2 100644
--- a/tools/fuzz/x86_instruction_emulator/Makefile
+++ b/tools/fuzz/x86_instruction_emulator/Makefile
@@ -8,33 +8,27 @@ else
 x86-insn-fuzz-all:
 endif
 
-# Add libx86 to the build
-vpath %.c $(XEN_ROOT)/xen/lib/x86
+cpuid.c: %: $(XEN_ROOT)/xen/lib/x86/% FORCE
+	ln -nsf $< $@
 
-x86_emulate:
-	[ -L $@ ] || ln -sf $(XEN_ROOT)/xen/arch/x86/$@
+x86_emulate: FORCE
+	ln -nsf $(XEN_ROOT)/xen/arch/x86/$@
 
 x86_emulate/%: x86_emulate ;
 
-x86-emulate.c x86-emulate.h wrappers.c: %:
-	[ -L $* ] || ln -sf $(XEN_ROOT)/tools/tests/x86_emulator/$*
+x86-emulate.c x86-emulate.h wrappers.c: %: $(XEN_ROOT)/tools/tests/x86_emulator/% FORCE
+	ln -nsf $< $@
 
-CFLAGS += $(CFLAGS_xeninclude) -D__XEN_TOOLS__ -I.
+CFLAGS += $(CFLAGS_xeninclude) -D__XEN_TOOLS__ -iquote .
+cpuid.o: CFLAGS += -iquote $(XEN_ROOT)/xen/lib/x86
 
 GCOV_FLAGS := --coverage
 %-cov.o: %.c
 	$(CC) -c $(CFLAGS) $(GCOV_FLAGS) $< -o $@
 
-x86.h := $(addprefix $(XEN_ROOT)/tools/include/xen/asm/,\
-                     x86-vendors.h x86-defns.h msr-index.h) \
-         $(addprefix $(XEN_ROOT)/tools/include/xen/lib/x86/, \
-                     cpuid.h cpuid-autogen.h)
-x86_emulate.h := x86-emulate.h x86_emulate/x86_emulate.h $(x86.h)
-
-# x86-emulate.c will be implicit for both
-x86-emulate.o x86-emulate-cov.o: x86_emulate/x86_emulate.c $(x86_emulate.h)
-
-fuzz-emul.o fuzz-emulate-cov.o cpuid.o wrappers.o: $(x86_emulate.h)
+x86-emulate.h: x86_emulate/x86_emulate.h
+x86-emulate.o x86-emulate-cov.o: x86-emulate.h x86_emulate/x86_emulate.c
+fuzz-emul.o fuzz-emul-cov.o wrappers.o: x86-emulate.h
 
 x86-insn-fuzzer.a: fuzz-emul.o x86-emulate.o cpuid.o
 	$(AR) rc $@ $^
@@ -51,7 +45,7 @@ all: x86-insn-fuzz-all
 
 .PHONY: distclean
 distclean: clean
-	rm -f x86_emulate x86-emulate.c x86-emulate.h
+	rm -f x86_emulate x86-emulate.c x86-emulate.h wrappers.c cpuid.c
 
 .PHONY: clean
 clean:
@@ -67,3 +61,5 @@ afl: afl-harness
 
 .PHONY: afl-cov
 afl-cov: afl-harness-cov
+
+-include $(DEPS_INCLUDE)
-- 
Anthony PERARD



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

* [XEN PATCH 29/57] tools/helper: Cleanup Makefile
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (27 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 28/57] tools/fuzz/x86_instruction_emulator: " Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-06 17:02 ` [XEN PATCH 30/57] tools/hotplug: cleanup Makefiles Anthony PERARD
                   ` (27 subsequent siblings)
  56 siblings, 0 replies; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel; +Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu

Use $(TARGETS) to collect targets.
Collect library to link against in $(LDLIBS).
Remove extra "-f" flags that is already part of $(RM).

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/helpers/Makefile | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/tools/helpers/Makefile b/tools/helpers/Makefile
index 7f6c422440..2fe3be2f89 100644
--- a/tools/helpers/Makefile
+++ b/tools/helpers/Makefile
@@ -5,10 +5,10 @@
 XEN_ROOT = $(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-PROGS += xen-init-dom0
+TARGETS += xen-init-dom0
 ifeq ($(CONFIG_Linux),y)
 ifeq ($(CONFIG_X86),y)
-PROGS += init-xenstore-domain
+TARGETS += init-xenstore-domain
 endif
 endif
 
@@ -17,6 +17,10 @@ $(XEN_INIT_DOM0_OBJS): CFLAGS += $(CFLAGS_libxentoollog)
 $(XEN_INIT_DOM0_OBJS): CFLAGS += $(CFLAGS_libxenstore)
 $(XEN_INIT_DOM0_OBJS): CFLAGS += $(CFLAGS_libxenlight)
 $(XEN_INIT_DOM0_OBJS): CFLAGS += $(CFLAGS_libxenctrl)
+xen-init-dom0: LDLIBS += $(LDLIBS_libxenctrl)
+xen-init-dom0: LDLIBS += $(LDLIBS_libxentoollog)
+xen-init-dom0: LDLIBS += $(LDLIBS_libxenstore)
+xen-init-dom0: LDLIBS += $(LDLIBS_libxenlight)
 
 INIT_XENSTORE_DOMAIN_OBJS = init-xenstore-domain.o init-dom-json.o
 $(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += $(CFLAGS_libxentoollog)
@@ -25,27 +29,32 @@ $(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += $(CFLAGS_libxenctrl)
 $(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += $(CFLAGS_libxenstore)
 $(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += $(CFLAGS_libxenlight)
 $(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += -include $(XEN_ROOT)/tools/config.h
+init-xenstore-domain: LDLIBS += $(LDLIBS_libxentoollog)
+init-xenstore-domain: LDLIBS += $(LDLIBS_libxenstore)
+init-xenstore-domain: LDLIBS += $(LDLIBS_libxenctrl)
+init-xenstore-domain: LDLIBS += $(LDLIBS_libxenguest)
+init-xenstore-domain: LDLIBS += $(LDLIBS_libxenlight)
 
 .PHONY: all
-all: $(PROGS)
+all: $(TARGETS)
 
 xen-init-dom0: $(XEN_INIT_DOM0_OBJS)
-	$(CC) $(LDFLAGS) -o $@ $(XEN_INIT_DOM0_OBJS) $(LDLIBS_libxenctrl) $(LDLIBS_libxentoollog) $(LDLIBS_libxenstore) $(LDLIBS_libxenlight) $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) -o $@ $(XEN_INIT_DOM0_OBJS) $(LDLIBS) $(APPEND_LDFLAGS)
 
 init-xenstore-domain: $(INIT_XENSTORE_DOMAIN_OBJS)
-	$(CC) $(LDFLAGS) -o $@ $(INIT_XENSTORE_DOMAIN_OBJS) $(LDLIBS_libxentoollog) $(LDLIBS_libxenstore) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenlight) $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) -o $@ $(INIT_XENSTORE_DOMAIN_OBJS) $(LDLIBS) $(APPEND_LDFLAGS)
 
 .PHONY: install
 install: all
 	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
-	for i in $(PROGS); do $(INSTALL_PROG) $$i $(DESTDIR)$(LIBEXEC_BIN); done
+	for i in $(TARGETS); do $(INSTALL_PROG) $$i $(DESTDIR)$(LIBEXEC_BIN); done
 
 .PHONY: uninstall
 uninstall:
-	for i in $(PROGS); do rm -f $(DESTDIR)$(LIBEXEC_BIN)/$$i; done
+	for i in $(TARGETS); do rm -f $(DESTDIR)$(LIBEXEC_BIN)/$$i; done
 
 .PHONY: clean
 clean:
-	$(RM) -f *.o $(PROGS) $(DEPS_RM)
+	$(RM) *.o $(TARGETS) $(DEPS_RM)
 
 distclean: clean
-- 
Anthony PERARD



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

* [XEN PATCH 30/57] tools/hotplug: cleanup Makefiles
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (28 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 29/57] tools/helper: Cleanup Makefile Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-06 17:02 ` [XEN PATCH 31/57] tools/libfsimage: Cleanup makefiles Anthony PERARD
                   ` (26 subsequent siblings)
  56 siblings, 0 replies; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel; +Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu

Remove "build" targets.

Use simply expanded variables when recursively expanded variable
aren't needed. (Use ":=" instead of "=".)

Don't check if a directory already exist when installing, just create
it.

Fix $(HOTPLUGPATH), it shouldn't have any double-quote.

Some reindentation.

FreeBSD, "hotplugpath.sh" is already installed by common/.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 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 ++++++----------
 5 files changed, 25 insertions(+), 43 deletions(-)

diff --git a/tools/hotplug/FreeBSD/Makefile b/tools/hotplug/FreeBSD/Makefile
index de9928cd86..a6552c9884 100644
--- a/tools/hotplug/FreeBSD/Makefile
+++ b/tools/hotplug/FreeBSD/Makefile
@@ -2,18 +2,15 @@ XEN_ROOT = $(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
 # Xen script dir and scripts to go there.
-XEN_SCRIPTS = vif-bridge block
+XEN_SCRIPTS := vif-bridge block
 
-XEN_SCRIPT_DATA =
+XEN_SCRIPT_DATA :=
 
-XEN_RCD_PROG = rc.d/xencommons rc.d/xendriverdomain
+XEN_RCD_PROG := rc.d/xencommons rc.d/xendriverdomain
 
 .PHONY: all
 all:
 
-.PHONY: build
-build:
-
 .PHONY: install
 install: install-scripts install-rcd
 
@@ -44,12 +41,10 @@ install-rcd:
 	   do \
 	   $(INSTALL_PROG) $$i $(DESTDIR)$(INITD_DIR); \
 	done
-	$(INSTALL_DATA) ../common/hotplugpath.sh $(DESTDIR)$(XEN_SCRIPT_DIR)
 
 .PHONY: uninstall-rcd
 uninstall-rcd:
 	rm -f $(addprefix $(DESTDIR)$(INITD_DIR)/, $(XEN_RCD_PROG))
-	rm -f $(DESTDIR)$(XEN_SCRIPT_DIR)/hotplugpath.sh
 
 .PHONY: clean
 clean:
diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
index 0b1d111d7e..9a7b3a3515 100644
--- a/tools/hotplug/Linux/Makefile
+++ b/tools/hotplug/Linux/Makefile
@@ -2,7 +2,7 @@ XEN_ROOT = $(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
 # Xen script dir and scripts to go there.
-XEN_SCRIPTS = vif-bridge
+XEN_SCRIPTS := vif-bridge
 XEN_SCRIPTS += vif-route
 XEN_SCRIPTS += vif-nat
 XEN_SCRIPTS += vif-openvswitch
@@ -22,16 +22,13 @@ XEN_SCRIPTS += launch-xenstore
 
 SUBDIRS-$(CONFIG_SYSTEMD) += systemd
 
-XEN_SCRIPT_DATA = xen-script-common.sh locking.sh logging.sh
+XEN_SCRIPT_DATA := xen-script-common.sh locking.sh logging.sh
 XEN_SCRIPT_DATA += xen-hotplug-common.sh xen-network-common.sh vif-common.sh
 XEN_SCRIPT_DATA += block-common.sh
 
 .PHONY: all
 all: subdirs-all
 
-.PHONY: build
-build:
-
 .PHONY: install
 install: install-initd install-scripts subdirs-install
 
@@ -41,9 +38,9 @@ uninstall: uninstall-initd uninstall-scripts subdirs-uninstall
 # See docs/misc/distro_mapping.txt for INITD_DIR location
 .PHONY: install-initd
 install-initd:
-	[ -d $(DESTDIR)$(INITD_DIR) ] || $(INSTALL_DIR) $(DESTDIR)$(INITD_DIR)
-	[ -d $(DESTDIR)$(SYSCONFIG_DIR) ] || $(INSTALL_DIR) $(DESTDIR)$(SYSCONFIG_DIR)
-	[ -d $(DESTDIR)$(LIBEXEC_BIN) ] || $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
+	$(INSTALL_DIR) $(DESTDIR)$(INITD_DIR)
+	$(INSTALL_DIR) $(DESTDIR)$(SYSCONFIG_DIR)
+	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
 	$(INSTALL_DATA) init.d/sysconfig.xendomains $(DESTDIR)$(SYSCONFIG_DIR)/xendomains
 	$(INSTALL_DATA) init.d/sysconfig.xencommons $(DESTDIR)$(SYSCONFIG_DIR)/xencommons
 	$(INSTALL_PROG) xendomains $(DESTDIR)$(LIBEXEC_BIN)
@@ -64,8 +61,7 @@ uninstall-initd:
 
 .PHONY: install-scripts
 install-scripts:
-	[ -d $(DESTDIR)$(XEN_SCRIPT_DIR) ] || \
-		$(INSTALL_DIR) $(DESTDIR)$(XEN_SCRIPT_DIR)
+	$(INSTALL_DIR) $(DESTDIR)$(XEN_SCRIPT_DIR)
 	set -e; for i in $(XEN_SCRIPTS); \
 	    do \
 	    $(INSTALL_PROG) $$i $(DESTDIR)$(XEN_SCRIPT_DIR); \
diff --git a/tools/hotplug/Linux/systemd/Makefile b/tools/hotplug/Linux/systemd/Makefile
index a5d41d86ef..26df2a43b1 100644
--- a/tools/hotplug/Linux/systemd/Makefile
+++ b/tools/hotplug/Linux/systemd/Makefile
@@ -1,12 +1,12 @@
 XEN_ROOT = $(CURDIR)/../../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-XEN_SYSTEMD_MODULES = xen.conf
+XEN_SYSTEMD_MODULES := xen.conf
 
-XEN_SYSTEMD_MOUNT =  proc-xen.mount
+XEN_SYSTEMD_MOUNT := proc-xen.mount
 XEN_SYSTEMD_MOUNT += var-lib-xenstored.mount
 
-XEN_SYSTEMD_SERVICE  = xenstored.service
+XEN_SYSTEMD_SERVICE := xenstored.service
 XEN_SYSTEMD_SERVICE += xenconsoled.service
 XEN_SYSTEMD_SERVICE += xen-qemu-dom0-disk-backend.service
 XEN_SYSTEMD_SERVICE += xendomains.service
@@ -14,7 +14,7 @@ XEN_SYSTEMD_SERVICE += xen-watchdog.service
 XEN_SYSTEMD_SERVICE += xen-init-dom0.service
 XEN_SYSTEMD_SERVICE += xendriverdomain.service
 
-ALL_XEN_SYSTEMD =	$(XEN_SYSTEMD_MODULES)  \
+ALL_XEN_SYSTEMD :=	$(XEN_SYSTEMD_MODULES)  \
 			$(XEN_SYSTEMD_MOUNT)	\
 			$(XEN_SYSTEMD_SERVICE)
 
@@ -30,10 +30,8 @@ distclean: clean
 
 .PHONY: install
 install: $(ALL_XEN_SYSTEMD)
-	[ -d $(DESTDIR)$(XEN_SYSTEMD_DIR) ] || \
-		$(INSTALL_DIR) $(DESTDIR)$(XEN_SYSTEMD_DIR)
-	[ -d $(DESTDIR)$(XEN_SYSTEMD_MODULES_LOAD) ] || \
-		$(INSTALL_DIR) $(DESTDIR)$(XEN_SYSTEMD_MODULES_LOAD)
+	$(INSTALL_DIR) $(DESTDIR)$(XEN_SYSTEMD_DIR)
+	$(INSTALL_DIR) $(DESTDIR)$(XEN_SYSTEMD_MODULES_LOAD)
 	$(INSTALL_DATA) *.service $(DESTDIR)$(XEN_SYSTEMD_DIR)
 	$(INSTALL_DATA) *.mount $(DESTDIR)$(XEN_SYSTEMD_DIR)
 	$(INSTALL_DATA) *.conf $(DESTDIR)$(XEN_SYSTEMD_MODULES_LOAD)
@@ -48,5 +46,5 @@ $(XEN_SYSTEMD_MODULES):
 	rm -f $@.tmp
 	for mod in $(LINUX_BACKEND_MODULES) ; do \
 		echo $$mod ; \
-		done > $@.tmp
+	done > $@.tmp
 	$(call move-if-changed,$@.tmp,$@)
diff --git a/tools/hotplug/NetBSD/Makefile b/tools/hotplug/NetBSD/Makefile
index f909ffa367..1cd3db2ccb 100644
--- a/tools/hotplug/NetBSD/Makefile
+++ b/tools/hotplug/NetBSD/Makefile
@@ -2,22 +2,19 @@ XEN_ROOT = $(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
 # Xen script dir and scripts to go there.
-XEN_SCRIPTS =
+XEN_SCRIPTS :=
 XEN_SCRIPTS += locking.sh
 XEN_SCRIPTS += block
 XEN_SCRIPTS += vif-bridge
 XEN_SCRIPTS += vif-ip
 XEN_SCRIPTS += qemu-ifup
 
-XEN_SCRIPT_DATA =
-XEN_RCD_PROG = rc.d/xencommons rc.d/xendomains rc.d/xen-watchdog rc.d/xendriverdomain
+XEN_SCRIPT_DATA :=
+XEN_RCD_PROG := rc.d/xencommons rc.d/xendomains rc.d/xen-watchdog rc.d/xendriverdomain
 
 .PHONY: all
 all:
 
-.PHONY: build
-build:
-
 .PHONY: install
 install: install-scripts install-rcd
 
diff --git a/tools/hotplug/common/Makefile b/tools/hotplug/common/Makefile
index ef48bfacc9..e8a8dbea6c 100644
--- a/tools/hotplug/common/Makefile
+++ b/tools/hotplug/common/Makefile
@@ -1,22 +1,19 @@
 XEN_ROOT = $(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-HOTPLUGPATH="hotplugpath.sh"
+HOTPLUGPATH := hotplugpath.sh
 
 # OS-independent hotplug scripts go in this directory
 
 # Xen scripts to go there.
-XEN_SCRIPTS =
-XEN_SCRIPT_DATA = $(HOTPLUGPATH)
+XEN_SCRIPTS :=
+XEN_SCRIPT_DATA := $(HOTPLUGPATH)
 
 genpath-target = $(call buildmakevars2file,$(HOTPLUGPATH))
 $(eval $(genpath-target))
 
 .PHONY: all
-all: build
-
-.PHONY: build
-build: $(HOTPLUGPATH)
+all: $(HOTPLUGPATH)
 
 .PHONY: install
 install: install-scripts
@@ -25,9 +22,8 @@ install: install-scripts
 uninstall: uninstall-scripts
 
 .PHONY: install-scripts
-install-scripts: build
-	[ -d $(DESTDIR)$(XEN_SCRIPT_DIR) ] || \
-		$(INSTALL_DIR) $(DESTDIR)$(XEN_SCRIPT_DIR)
+install-scripts: all
+	$(INSTALL_DIR) $(DESTDIR)$(XEN_SCRIPT_DIR)
 	set -e; for i in $(XEN_SCRIPTS); \
 	   do \
 	   $(INSTALL_PROG) $$i $(DESTDIR)$(XEN_SCRIPT_DIR); \
-- 
Anthony PERARD



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

* [XEN PATCH 31/57] tools/libfsimage: Cleanup makefiles
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (29 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 30/57] tools/hotplug: cleanup Makefiles Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-06 17:02 ` [XEN PATCH 32/57] tools/misc: rework Makefile Anthony PERARD
                   ` (25 subsequent siblings)
  56 siblings, 0 replies; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel; +Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu

Remove the need for "fs-*" targets by creating a "common.mk" which
have flags that are common to libfsimage/common/ and the other
libfsimages/*/ directories.

In common.mk, make $(PIC_OBJS) a recursively expanded variable so it
doesn't matter where $(LIB_SRCS-y) is defined, and remove the extra
$(PIC_OBJS) from libfsimage/common/Makefile.

Use a $(TARGETS) variable to list things to be built. And $(TARGETS)
can be use in the clean target in common.mk.

iso9660/:
    Remove the explicit dependency between fsys_iso9660.c and
    iso9660.h, this is handled automaticaly by the .*.d dependency files,
    and iso9660.h already exist.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libfsimage/Rules.mk            | 26 ++++++++------------------
 tools/libfsimage/common.mk           | 11 +++++++++++
 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 ---------
 11 files changed, 22 insertions(+), 100 deletions(-)
 create mode 100644 tools/libfsimage/common.mk

diff --git a/tools/libfsimage/Rules.mk b/tools/libfsimage/Rules.mk
index bb6d42abb4..cf37d6cb0d 100644
--- a/tools/libfsimage/Rules.mk
+++ b/tools/libfsimage/Rules.mk
@@ -1,25 +1,18 @@
-include $(XEN_ROOT)/tools/Rules.mk
-
-CFLAGS += -Wno-unknown-pragmas -I$(XEN_ROOT)/tools/libfsimage/common/ -DFSIMAGE_FSDIR=\"$(FSDIR)\"
-CFLAGS += -Werror -D_GNU_SOURCE
-LDFLAGS += -L../common/
-
-PIC_OBJS := $(patsubst %.c,%.opic,$(LIB_SRCS-y))
-
-FSDIR = $(libdir)/xenfsimage
+include $(XEN_ROOT)/tools/libfsimage/common.mk
 
 FSLIB = fsimage.so
+TARGETS += $(FSLIB)
 
-.PHONY: fs-all
-fs-all: $(FSLIB)
+.PHONY: all
+all: $(TARGETS)
 
-.PHONY: fs-install
-fs-install: fs-all
+.PHONY: install
+install: all
 	$(INSTALL_DIR) $(DESTDIR)$(FSDIR)/$(FS)
 	$(INSTALL_PROG) $(FSLIB) $(DESTDIR)$(FSDIR)/$(FS)
 
-.PHONY: fs-uninstall
-fs-uninstall:
+.PHONY: uninstall
+uninstall:
 	rm -f $(addprefix $(DESTDIR)$(FSDIR)/$(FS)/, $(FSLIB))
 	if [ -d $(DESTDIR)$(FSDIR)/$(FS) ]; then \
 		rmdir $(DESTDIR)$(FSDIR)/$(FS); \
@@ -28,7 +21,4 @@ fs-uninstall:
 $(FSLIB): $(PIC_OBJS)
 	$(CC) $(LDFLAGS) $(SHLIB_LDFLAGS) -o $@ $^ -lxenfsimage $(FS_LIBDEPS) $(APPEND_LDFLAGS)
 
-clean distclean::
-	rm -f $(PIC_OBJS) $(FSLIB) $(DEPS_RM)
-
 -include $(DEPS_INCLUDE)
diff --git a/tools/libfsimage/common.mk b/tools/libfsimage/common.mk
new file mode 100644
index 0000000000..77bc957f27
--- /dev/null
+++ b/tools/libfsimage/common.mk
@@ -0,0 +1,11 @@
+include $(XEN_ROOT)/tools/Rules.mk
+
+FSDIR := $(libdir)/xenfsimage
+CFLAGS += -Wno-unknown-pragmas -I$(XEN_ROOT)/tools/libfsimage/common/ -DFSIMAGE_FSDIR=\"$(FSDIR)\"
+CFLAGS += -Werror -D_GNU_SOURCE
+LDFLAGS += -L../common/
+
+PIC_OBJS = $(patsubst %.c,%.opic,$(LIB_SRCS-y))
+
+clean distclean::
+	rm -f $(PIC_OBJS) $(TARGETS) $(DEPS_RM)
diff --git a/tools/libfsimage/common/Makefile b/tools/libfsimage/common/Makefile
index 24bc90e73e..bcda86d754 100644
--- a/tools/libfsimage/common/Makefile
+++ b/tools/libfsimage/common/Makefile
@@ -1,5 +1,5 @@
 XEN_ROOT = $(CURDIR)/../../..
-include $(XEN_ROOT)/tools/libfsimage/Rules.mk
+include $(XEN_ROOT)/tools/libfsimage/common.mk
 
 MAJOR = 4.16
 MINOR = 0
@@ -13,12 +13,10 @@ LDFLAGS += $(PTHREAD_LDFLAGS)
 
 LIB_SRCS-y = fsimage.c fsimage_plugin.c fsimage_grub.c
 
-PIC_OBJS := $(patsubst %.c,%.opic,$(LIB_SRCS-y))
-
-LIB = libxenfsimage.so libxenfsimage.so.$(MAJOR) libxenfsimage.so.$(MAJOR).$(MINOR)
+TARGETS = libxenfsimage.so libxenfsimage.so.$(MAJOR) libxenfsimage.so.$(MAJOR).$(MINOR)
 
 .PHONY: all
-all: $(LIB)
+all: $(TARGETS)
 
 .PHONY: install
 install: all
@@ -40,9 +38,6 @@ uninstall:
 	rm -f $(DESTDIR)$(libdir)/libxenfsimage.so.$(MAJOR)
 	rm -f $(DESTDIR)$(libdir)/libxenfsimage.so.$(MAJOR).$(MINOR)
 
-clean distclean::
-	rm -f $(LIB)
-
 libxenfsimage.so: libxenfsimage.so.$(MAJOR)
 	ln -sf $< $@
 libxenfsimage.so.$(MAJOR): libxenfsimage.so.$(MAJOR).$(MINOR)
diff --git a/tools/libfsimage/ext2fs-lib/Makefile b/tools/libfsimage/ext2fs-lib/Makefile
index 431a79068e..b9b560df75 100644
--- a/tools/libfsimage/ext2fs-lib/Makefile
+++ b/tools/libfsimage/ext2fs-lib/Makefile
@@ -9,13 +9,4 @@ FS_LIBDEPS = $(EXTFS_LIBS)
 # Include configure output (config.h)
 CFLAGS += -include $(XEN_ROOT)/tools/config.h
 
-.PHONY: all
-all: fs-all
-
-.PHONY: install
-install: fs-install
-
-.PHONY: uninstall
-uninstall: fs-uninstall
-
 include $(XEN_ROOT)/tools/libfsimage/Rules.mk
diff --git a/tools/libfsimage/ext2fs/Makefile b/tools/libfsimage/ext2fs/Makefile
index c62ae359ac..fe01f98148 100644
--- a/tools/libfsimage/ext2fs/Makefile
+++ b/tools/libfsimage/ext2fs/Makefile
@@ -4,13 +4,4 @@ LIB_SRCS-y = fsys_ext2fs.c
 
 FS = ext2fs
 
-.PHONY: all
-all: fs-all
-
-.PHONY: install
-install: fs-install
-
-.PHONY: uninstall
-uninstall: fs-uninstall
-
 include $(XEN_ROOT)/tools/libfsimage/Rules.mk
diff --git a/tools/libfsimage/fat/Makefile b/tools/libfsimage/fat/Makefile
index 7ee5e7588d..58bcc0751d 100644
--- a/tools/libfsimage/fat/Makefile
+++ b/tools/libfsimage/fat/Makefile
@@ -4,13 +4,4 @@ LIB_SRCS-y = fsys_fat.c
 
 FS = fat
 
-.PHONY: all
-all: fs-all
-
-.PHONY: install
-install: fs-install
-
-.PHONY: uninstall
-uninstall: fs-uninstall
-
 include $(XEN_ROOT)/tools/libfsimage/Rules.mk
diff --git a/tools/libfsimage/iso9660/Makefile b/tools/libfsimage/iso9660/Makefile
index bc86baf2c0..acf3164046 100644
--- a/tools/libfsimage/iso9660/Makefile
+++ b/tools/libfsimage/iso9660/Makefile
@@ -4,15 +4,4 @@ LIB_SRCS-y = fsys_iso9660.c
 
 FS = iso9660
 
-.PHONY: all
-all: fs-all
-
-.PHONY: install
-install: fs-install
-
-.PHONY: uninstall
-uninstall: fs-uninstall
-
-fsys_iso9660.c: iso9660.h
-
 include $(XEN_ROOT)/tools/libfsimage/Rules.mk
diff --git a/tools/libfsimage/reiserfs/Makefile b/tools/libfsimage/reiserfs/Makefile
index 5acfedf25e..42b751e007 100644
--- a/tools/libfsimage/reiserfs/Makefile
+++ b/tools/libfsimage/reiserfs/Makefile
@@ -4,13 +4,4 @@ LIB_SRCS-y = fsys_reiserfs.c
 
 FS = reiserfs
 
-.PHONY: all
-all: fs-all
-
-.PHONY: install
-install: fs-install
-
-.PHONY: uninstall
-uninstall: fs-uninstall
-
 include $(XEN_ROOT)/tools/libfsimage/Rules.mk
diff --git a/tools/libfsimage/ufs/Makefile b/tools/libfsimage/ufs/Makefile
index f32b9178bd..cca4f0a588 100644
--- a/tools/libfsimage/ufs/Makefile
+++ b/tools/libfsimage/ufs/Makefile
@@ -4,13 +4,4 @@ LIB_SRCS-y = fsys_ufs.c
 
 FS = ufs
 
-.PHONY: all
-all: fs-all
-
-.PHONY: install
-install: fs-install
-
-.PHONY: uninstall
-uninstall: fs-uninstall
-
 include $(XEN_ROOT)/tools/libfsimage/Rules.mk
diff --git a/tools/libfsimage/xfs/Makefile b/tools/libfsimage/xfs/Makefile
index 54eeb6e35e..ebac7baf14 100644
--- a/tools/libfsimage/xfs/Makefile
+++ b/tools/libfsimage/xfs/Makefile
@@ -4,13 +4,4 @@ LIB_SRCS-y = fsys_xfs.c
 
 FS = xfs
 
-.PHONY: all
-all: fs-all
-
-.PHONY: install
-install: fs-install
-
-.PHONY: uninstall
-uninstall: fs-uninstall
-
 include $(XEN_ROOT)/tools/libfsimage/Rules.mk
diff --git a/tools/libfsimage/zfs/Makefile b/tools/libfsimage/zfs/Makefile
index 084e5ec08d..434a9c3580 100644
--- a/tools/libfsimage/zfs/Makefile
+++ b/tools/libfsimage/zfs/Makefile
@@ -28,13 +28,4 @@ LIB_SRCS-y = zfs_lzjb.c zfs_sha256.c zfs_fletcher.c fsi_zfs.c fsys_zfs.c
 
 FS = zfs
 
-.PHONY: all
-all: fs-all
-
-.PHONY: install
-install: fs-install
-
-.PHONY: uninstall
-uninstall: fs-uninstall
-
 include $(XEN_ROOT)/tools/libfsimage/Rules.mk
-- 
Anthony PERARD



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

* [XEN PATCH 32/57] tools/misc: rework Makefile
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (30 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 31/57] tools/libfsimage: Cleanup makefiles Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-06 17:02 ` [XEN PATCH 33/57] tools/vchan: Collect targets in TARGETS Anthony PERARD
                   ` (24 subsequent siblings)
  56 siblings, 0 replies; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel; +Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu

Add missing "xen-detect" rule. It only works without it because we
still have make's built-ins rules and variables, but fix this to not
have to rely on them.

Rename $(TARGETS_BUILD) to $(TARGETS).

Remove the unused "build" target.

Also, they are no more "build-only" targets, remove the extra code.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/misc/Makefile | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tools/misc/Makefile b/tools/misc/Makefile
index 8b9558b93f..5e7787e501 100644
--- a/tools/misc/Makefile
+++ b/tools/misc/Makefile
@@ -50,16 +50,13 @@ TARGETS_COPY += xencov_split
 TARGETS_COPY += xenpvnetboot
 
 # Everything which needs to be built
-TARGETS_BUILD := $(filter-out $(TARGETS_COPY),$(TARGETS_ALL))
+TARGETS := $(filter-out $(TARGETS_COPY),$(TARGETS_ALL))
 
-# ... including build-only targets
-TARGETS_BUILD += $(TARGETS_BUILD-y)
-
-.PHONY: all build
-all build: $(TARGETS_BUILD)
+.PHONY: all
+all: $(TARGETS)
 
 .PHONY: install
-install: build
+install: all
 	$(INSTALL_DIR) $(DESTDIR)$(bindir)
 	$(INSTALL_DIR) $(DESTDIR)$(sbindir)
 	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
@@ -75,7 +72,7 @@ uninstall:
 
 .PHONY: clean
 clean:
-	$(RM) *.o $(TARGETS_BUILD) *~ $(DEPS_RM)
+	$(RM) *.o $(TARGETS) *~ $(DEPS_RM)
 
 .PHONY: distclean
 distclean: clean
@@ -86,6 +83,9 @@ xen-access: xen-access.o
 xen-cpuid: xen-cpuid.o
 	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(APPEND_LDFLAGS)
 
+xen-detect: xen-detect.o
+	$(CC) $(LDFLAGS) -o $@ $< $(APPEND_LDFLAGS)
+
 xen-hvmctx: xen-hvmctx.o
 	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
 
-- 
Anthony PERARD



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

* [XEN PATCH 33/57] tools/vchan: Collect targets in TARGETS
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (31 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 32/57] tools/misc: rework Makefile Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-06 17:02 ` [XEN PATCH 34/57] tools/xcutils: rework Makefile Anthony PERARD
                   ` (23 subsequent siblings)
  56 siblings, 0 replies; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel; +Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu

And use the new TARGETS to clean them. Now "clean" will remove
"vchan-socket-proxy".

$(RM) already have the "-f" flags, so remove the second one.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/vchan/Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/vchan/Makefile b/tools/vchan/Makefile
index a731e0e073..c886c22e12 100644
--- a/tools/vchan/Makefile
+++ b/tools/vchan/Makefile
@@ -11,8 +11,10 @@ NODE2_OBJS = node-select.o
 $(NODE_OBJS) $(NODE2_OBJS): CFLAGS += $(CFLAGS_libxenvchan) $(CFLAGS_libxengnttab) $(CFLAGS_libxenevtchn)
 vchan-socket-proxy.o: CFLAGS += $(CFLAGS_libxenvchan) $(CFLAGS_libxenstore) $(CFLAGS_libxenctrl) $(CFLAGS_libxengnttab) $(CFLAGS_libxenevtchn)
 
+TARGETS := vchan-node1 vchan-node2 vchan-socket-proxy
+
 .PHONY: all
-all: vchan-node1 vchan-node2 vchan-socket-proxy
+all: $(TARGETS)
 
 vchan-node1: $(NODE_OBJS)
 	$(CC) $(LDFLAGS) -o $@ $(NODE_OBJS) $(LDLIBS_libxenvchan) $(APPEND_LDFLAGS)
@@ -30,7 +32,7 @@ install: all
 
 .PHONY: clean
 clean:
-	$(RM) -f *.o vchan-node1 vchan-node2 $(DEPS_RM)
+	$(RM) *.o $(TARGETS) $(DEPS_RM)
 
 distclean: clean
 
-- 
Anthony PERARD



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

* [XEN PATCH 34/57] tools/xcutils: rework Makefile
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (32 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 33/57] tools/vchan: Collect targets in TARGETS Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-16 18:20   ` Andrew Cooper
  2021-12-06 17:02 ` [XEN PATCH 35/57] tools/xenpaging: Rework makefile Anthony PERARD
                   ` (22 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel; +Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu

Use TARGETS to collect targets to build

Remove "build" target.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/xcutils/Makefile | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/tools/xcutils/Makefile b/tools/xcutils/Makefile
index 82d42624c8..198be22a5a 100644
--- a/tools/xcutils/Makefile
+++ b/tools/xcutils/Makefile
@@ -11,7 +11,7 @@
 XEN_ROOT	= $(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-PROGRAMS = readnotes lsevtchn
+TARGETS := readnotes lsevtchn
 
 CFLAGS += -Werror
 
@@ -19,10 +19,7 @@ CFLAGS_readnotes.o  := $(CFLAGS_libxenevtchn) $(CFLAGS_libxenctrl) $(CFLAGS_libx
 CFLAGS_lsevtchn.o   := $(CFLAGS_libxenevtchn) $(CFLAGS_libxenctrl)
 
 .PHONY: all
-all: build
-
-.PHONY: build
-build: $(PROGRAMS)
+all: $(TARGETS)
 
 readnotes: readnotes.o
 	$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(APPEND_LDFLAGS)
@@ -31,17 +28,17 @@ lsevtchn: lsevtchn.o
 	$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
 
 .PHONY: install
-install: build
+install: all
 	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
-	$(INSTALL_PROG) $(PROGRAMS) $(DESTDIR)$(LIBEXEC_BIN)
+	$(INSTALL_PROG) $(TARGETS) $(DESTDIR)$(LIBEXEC_BIN)
 
 .PHONY: uninstall
 uninstall:
-	rm -f $(addprefix $(DESTDIR)$(LIBEXECDIR)/, $(PROGRAMS))
+	rm -f $(addprefix $(DESTDIR)$(LIBEXECDIR)/, $(TARGETS))
 
 .PHONY: clean
 clean:
-	$(RM) *.o $(PROGRAMS)
+	$(RM) *.o $(TARGETS)
 	$(RM) $(DEPS_RM)
 
 .PHONY: distclean
-- 
Anthony PERARD



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

* [XEN PATCH 35/57] tools/xenpaging: Rework makefile
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (33 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 34/57] tools/xcutils: rework Makefile Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-16 18:25   ` Andrew Cooper
  2021-12-06 17:02 ` [XEN PATCH 36/57] tools/xenstore: Cleanup makefile Anthony PERARD
                   ` (21 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel; +Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu

- Rename $(SRCS) to $(OBJS-y), we don't need to collect sources.
- Rename $(IBINS) to $(TARGETS)
- Stop cleaning "xen" and non-set variable $(LIB).

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/xenpaging/Makefile | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/tools/xenpaging/Makefile b/tools/xenpaging/Makefile
index 04743b335c..e2ed9eaa3f 100644
--- a/tools/xenpaging/Makefile
+++ b/tools/xenpaging/Makefile
@@ -5,33 +5,33 @@ CFLAGS += $(CFLAGS_libxentoollog) $(CFLAGS_libxenevtchn) $(CFLAGS_libxenctrl) $(
 LDLIBS += $(LDLIBS_libxentoollog) $(LDLIBS_libxenevtchn) $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore) $(PTHREAD_LIBS)
 LDFLAGS += $(PTHREAD_LDFLAGS)
 
-POLICY    = default
+POLICY   := default
 
-SRC      :=
-SRCS     += file_ops.c xenpaging.c policy_$(POLICY).c
-SRCS     += pagein.c
+OBJS-y   := file_ops.o
+OBJS-y   += xenpaging.o
+OBJS-y   += policy_$(POLICY).o
+OBJS-y   += pagein.o
 
 CFLAGS   += -Werror
 CFLAGS   += -Wno-unused
 
-OBJS     = $(SRCS:.c=.o)
-IBINS    = xenpaging
+TARGETS := xenpaging
 
-all: $(IBINS)
+all: $(TARGETS)
 
-xenpaging: $(OBJS)
+xenpaging: $(OBJS-y)
 	$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) $(APPEND_LDFLAGS)
 
 install: all
 	$(INSTALL_DIR) -m 0700 $(DESTDIR)$(XEN_PAGING_DIR)
 	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
-	$(INSTALL_PROG) $(IBINS) $(DESTDIR)$(LIBEXEC_BIN)
+	$(INSTALL_PROG) $(TARGETS) $(DESTDIR)$(LIBEXEC_BIN)
 
 uninstall:
-	rm -f $(addprefix $(DESTDIR)$(LIBEXEC_BIN)/, $(IBINS))
+	rm -f $(addprefix $(DESTDIR)$(LIBEXEC_BIN)/, $(TARGETS))
 
 clean:
-	rm -f *.o *~ $(DEPS_RM) xen TAGS $(IBINS) $(LIB)
+	rm -f *.o *~ $(DEPS_RM) TAGS $(TARGETS)
 
 distclean: clean
 
@@ -39,6 +39,6 @@ distclean: clean
 
 .PHONY: TAGS
 TAGS:
-	etags -t $(SRCS) *.h
+	etags -t *.c *.h
 
 -include $(DEPS_INCLUDE)
-- 
Anthony PERARD



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

* [XEN PATCH 36/57] tools/xenstore: Cleanup makefile
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (34 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 35/57] tools/xenpaging: Rework makefile Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-07 11:21   ` Juergen Gross
                     ` (2 more replies)
  2021-12-06 17:02 ` [XEN PATCH 37/57] tools/xentop: rework makefile Anthony PERARD
                   ` (20 subsequent siblings)
  56 siblings, 3 replies; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu,
	Juergen Gross, Julien Grall

Regroup *FLAGS together, use $(LDLIBS).

Remove $(LDLIBS_xenstored) which was the wrong name name as it doesn't
decribe how to link to a potential libxenstored.so, instead add the
value to $(LDLIBS) of xenstored.

Add SYSTEMD_LIBS into $(LDLIBS) instead of $(LDFLAGS).

Remove the "-I." from $(CFLAGS), it shouldn't be needed.

Removed $(CFLAGS-y) and $(LDFLAGS-y). $(CFLAGS-y) is already included
in $(CFLAGS) and both aren't used anyway.

Rename ALL_TARGETS to TARGETS.
Only add programmes we want to build in $(TARGETS), not phony-targets
(replace "clients").

Store all `xenstored` objs into $(XENSTORED_OBJS-y).

Replace one $< by $^ even if there's only one dependency,
(xenstore-control).

clean: "init-xenstore-domain" isn't built here, so stop trying to
remove it, remove $(TARGETS).

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/xenstore/Makefile | 81 ++++++++++++++++++++++-------------------
 1 file changed, 44 insertions(+), 37 deletions(-)

diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
index 292b478fa1..7fe1d9c1e2 100644
--- a/tools/xenstore/Makefile
+++ b/tools/xenstore/Makefile
@@ -5,7 +5,6 @@ MAJOR = 3.0
 MINOR = 3
 
 CFLAGS += -Werror
-CFLAGS += -I.
 # Include configure output (config.h)
 CFLAGS += -include $(XEN_ROOT)/tools/config.h
 CFLAGS += -I./include
@@ -16,36 +15,53 @@ CFLAGS += $(CFLAGS_libxentoolcore)
 CFLAGS += -DXEN_LIB_STORED="\"$(XEN_LIB_STORED)\""
 CFLAGS += -DXEN_RUN_STORED="\"$(XEN_RUN_STORED)\""
 
-CFLAGS  += $(CFLAGS-y)
-LDFLAGS += $(LDFLAGS-y)
+ifdef CONFIG_STUBDOM
+CFLAGS += -DNO_SOCKETS=1
+endif
 
-CLIENTS := xenstore-exists xenstore-list xenstore-read xenstore-rm xenstore-chmod
-CLIENTS += xenstore-write xenstore-ls xenstore-watch
+XENSTORED_OBJS-y := xenstored_core.o xenstored_watch.o xenstored_domain.o
+XENSTORED_OBJS-y += xenstored_transaction.o xenstored_control.o
+XENSTORED_OBJS-y += xs_lib.o talloc.o utils.o tdb.o hashtable.o
 
-XENSTORED_OBJS = xenstored_core.o xenstored_watch.o xenstored_domain.o
-XENSTORED_OBJS += xenstored_transaction.o xenstored_control.o
-XENSTORED_OBJS += xs_lib.o talloc.o utils.o tdb.o hashtable.o
+XENSTORED_OBJS-$(CONFIG_Linux) += xenstored_posix.o
+XENSTORED_OBJS-$(CONFIG_SunOS) += xenstored_solaris.o xenstored_posix.o xenstored_probes.o
+XENSTORED_OBJS-$(CONFIG_NetBSD) += xenstored_posix.o
+XENSTORED_OBJS-$(CONFIG_FreeBSD) += xenstored_posix.o
+XENSTORED_OBJS-$(CONFIG_MiniOS) += xenstored_minios.o
 
-XENSTORED_OBJS_$(CONFIG_Linux) = xenstored_posix.o
-XENSTORED_OBJS_$(CONFIG_SunOS) = xenstored_solaris.o xenstored_posix.o xenstored_probes.o
-XENSTORED_OBJS_$(CONFIG_NetBSD) = xenstored_posix.o
-XENSTORED_OBJS_$(CONFIG_FreeBSD) = xenstored_posix.o
-XENSTORED_OBJS_$(CONFIG_MiniOS) = xenstored_minios.o
+$(XENSTORED_OBJS-y): CFLAGS += $(CFLAGS_libxengnttab)
 
-XENSTORED_OBJS += $(XENSTORED_OBJS_y)
-LDLIBS_xenstored += -lrt
+xenstored: LDLIBS += $(LDLIBS_libxenevtchn)
+xenstored: LDLIBS += $(LDLIBS_libxengnttab)
+xenstored: LDLIBS += $(LDLIBS_libxenctrl)
+xenstored: LDLIBS += -lrt
+xenstored: LDLIBS += $(SOCKET_LIBS)
 
-ALL_TARGETS = clients
-ifeq ($(XENSTORE_XENSTORED),y)
-ALL_TARGETS += xs_tdb_dump xenstored
+ifeq ($(CONFIG_SYSTEMD),y)
+$(XENSTORED_OBJS-y): CFLAGS += $(SYSTEMD_CFLAGS)
+xenstored: LDLIBS += $(SYSTEMD_LIBS)
 endif
 
-ifdef CONFIG_STUBDOM
-CFLAGS += -DNO_SOCKETS=1
+xenstore: LDLIBS += $(LDLIBS_libxenstore)
+xenstore: LDLIBS += $(LDLIBS_libxentoolcore)
+xenstore: LDLIBS += $(SOCKET_LIBS)
+
+xenstore-control: LDLIBS += $(LDLIBS_libxenstore)
+xenstore-control: LDLIBS += $(LDLIBS_libxenctrl)
+xenstore-control: LDLIBS += $(LDLIBS_libxenguest)
+xenstore-control: LDLIBS += $(LDLIBS_libxentoolcore)
+xenstore-control: LDLIBS += $(SOCKET_LIBS)
+
+CLIENTS := xenstore-exists xenstore-list xenstore-read xenstore-rm xenstore-chmod
+CLIENTS += xenstore-write xenstore-ls xenstore-watch
+
+TARGETS := xenstore $(CLIENTS) xenstore-control
+ifeq ($(XENSTORE_XENSTORED),y)
+TARGETS += xs_tdb_dump xenstored
 endif
 
 .PHONY: all
-all: $(ALL_TARGETS)
+all: $(TARGETS)
 
 .PHONY: clients
 clients: xenstore $(CLIENTS) xenstore-control
@@ -62,37 +78,28 @@ xenstored_probes.o: xenstored_solaris.o
 CFLAGS += -DHAVE_DTRACE=1
 endif
 
-ifeq ($(CONFIG_SYSTEMD),y)
-$(XENSTORED_OBJS): CFLAGS += $(SYSTEMD_CFLAGS)
-xenstored: LDFLAGS += $(SYSTEMD_LIBS)
-endif
-
-$(XENSTORED_OBJS): CFLAGS += $(CFLAGS_libxengnttab)
-
-xenstored: $(XENSTORED_OBJS)
-	$(CC) $^ $(LDFLAGS) $(LDLIBS_libxenevtchn) $(LDLIBS_libxengnttab) $(LDLIBS_libxenctrl) $(LDLIBS_xenstored) $(SOCKET_LIBS) -o $@ $(APPEND_LDFLAGS)
+xenstored: $(XENSTORED_OBJS-y)
+	$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@ $(APPEND_LDFLAGS)
 
-xenstored.a: $(XENSTORED_OBJS)
+xenstored.a: $(XENSTORED_OBJS-y)
 	$(AR) cr $@ $^
 
 $(CLIENTS): xenstore
 	ln -f xenstore $@
 
 xenstore: xenstore_client.o xs_lib.o
-	$(CC) $^ $(LDFLAGS) $(LDLIBS_libxenstore) $(LDLIBS_libxentoolcore) $(SOCKET_LIBS) -o $@ $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@ $(APPEND_LDFLAGS)
 
 xenstore-control: xenstore_control.o
-	$(CC) $< $(LDFLAGS) $(LDLIBS_libxenstore) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxentoolcore) $(SOCKET_LIBS) -o $@ $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@ $(APPEND_LDFLAGS)
 
 xs_tdb_dump: xs_tdb_dump.o utils.o tdb.o talloc.o
-	$(CC) $^ $(LDFLAGS) -o $@ $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) $^ -o $@ $(APPEND_LDFLAGS)
 
 .PHONY: clean
 clean:
 	rm -f *.a *.o xenstored_probes.h
-	rm -f xenstored
-	rm -f xs_tdb_dump xenstore-control init-xenstore-domain
-	rm -f xenstore $(CLIENTS)
+	rm -f $(TARGETS)
 	$(RM) $(DEPS_RM)
 
 .PHONY: distclean
-- 
Anthony PERARD



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

* [XEN PATCH 37/57] tools/xentop: rework makefile
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (35 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 36/57] tools/xenstore: Cleanup makefile Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-16 18:36   ` Andrew Cooper
  2021-12-06 17:02 ` [XEN PATCH 38/57] tools/xenstrace: rework Makefile Anthony PERARD
                   ` (19 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel; +Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu

Add "xentop" to "TARGETS" because this variable will be useful later.

Always define all the targets, even when configured with
--disable-monitor, instead don't visit the subdirectory.
This mean xentop/ isn't visited anymore during "make clean" that's how
most other subdirs in the tools/ works.

Also add missing "xentop" rules. It only works without it because we
still have make's built-ins rules and variables, but fix this to not
have to rely on them.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/Makefile        |  2 +-
 tools/xentop/Makefile | 19 ++++++++-----------
 2 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index 79b4c7e3de..0c1d8b64a4 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -17,7 +17,7 @@ SUBDIRS-$(CONFIG_XCUTILS) += xcutils
 SUBDIRS-$(CONFIG_X86) += firmware
 SUBDIRS-y += console
 SUBDIRS-y += xenmon
-SUBDIRS-y += xentop
+SUBDIRS-$(XENSTAT_XENTOP) += xentop
 SUBDIRS-y += libfsimage
 SUBDIRS-$(CONFIG_Linux) += vchan
 
diff --git a/tools/xentop/Makefile b/tools/xentop/Makefile
index 0034114684..1e52b29b37 100644
--- a/tools/xentop/Makefile
+++ b/tools/xentop/Makefile
@@ -13,24 +13,23 @@
 XEN_ROOT=$(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-ifneq ($(XENSTAT_XENTOP),y)
-.PHONY: all install xentop uninstall
-all install xentop uninstall:
-else
-
 CFLAGS += -DGCC_PRINTF -Werror $(CFLAGS_libxenstat)
 LDLIBS += $(LDLIBS_libxenstat) $(CURSES_LIBS) $(TINFO_LIBS) $(SOCKET_LIBS) -lm
 CFLAGS += -DHOST_$(XEN_OS)
 
 # Include configure output (config.h)
 CFLAGS += -include $(XEN_ROOT)/tools/config.h
-LDFLAGS += $(APPEND_LDFLAGS)
+
+TARGETS := xentop
 
 .PHONY: all
-all: xentop
+all: $(TARGETS)
+
+xentop: xentop.o
+	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS) $(APPEND_LDFLAGS)
 
 .PHONY: install
-install: xentop
+install: all
 	$(INSTALL_DIR) $(DESTDIR)$(sbindir)
 	$(INSTALL_PROG) xentop $(DESTDIR)$(sbindir)/xentop
 
@@ -38,11 +37,9 @@ install: xentop
 uninstall:
 	rm -f $(DESTDIR)$(sbindir)/xentop
 
-endif
-
 .PHONY: clean
 clean:
-	rm -f xentop xentop.o $(DEPS_RM)
+	rm -f $(TARGETS) xentop.o $(DEPS_RM)
 
 .PHONY: distclean
 distclean: clean
-- 
Anthony PERARD



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

* [XEN PATCH 38/57] tools/xenstrace: rework Makefile
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (36 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 37/57] tools/xentop: rework makefile Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-16 18:38   ` Andrew Cooper
  2021-12-06 17:02 ` [XEN PATCH 39/57] libs: Remove both "libs" and "build" target Anthony PERARD
                   ` (18 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, George Dunlap, Ian Jackson, Wei Liu

Remove "build" targets.

Use "$(TARGETS)" to list binary to be built.

Cleanup "clean" rule.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/xentrace/Makefile | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/tools/xentrace/Makefile b/tools/xentrace/Makefile
index 9fb7fc96e7..2b166335dc 100644
--- a/tools/xentrace/Makefile
+++ b/tools/xentrace/Makefile
@@ -14,14 +14,13 @@ SBIN     = xentrace xentrace_setsize
 LIBBIN   = xenctx
 SCRIPTS  = xentrace_format
 
-.PHONY: all
-all: build
+TARGETS := $(BIN) $(SBIN) $(LIBBIN)
 
-.PHONY: build
-build: $(BIN) $(SBIN) $(LIBBIN)
+.PHONY: all
+all: $(TARGETS)
 
 .PHONY: install
-install: build
+install: all
 	$(INSTALL_DIR) $(DESTDIR)$(bindir)
 	$(INSTALL_DIR) $(DESTDIR)$(sbindir)
 	[ -z "$(LIBBIN)" ] || $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
@@ -43,7 +42,7 @@ endif
 
 .PHONY: clean
 clean:
-	$(RM) *.a *.so *.o *.rpm $(BIN) $(SBIN) $(LIBBIN) $(DEPS_RM)
+	$(RM) *.o $(TARGETS) $(DEPS_RM)
 
 .PHONY: distclean
 distclean: clean
-- 
Anthony PERARD



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

* [XEN PATCH 39/57] libs: Remove both "libs" and "build" target
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (37 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 38/57] tools/xenstrace: rework Makefile Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-07 12:14   ` Juergen Gross
  2021-12-06 17:02 ` [XEN PATCH 40/57] libs: rename LDUSELIBS to LDLIBS and use it instead of APPEND_LDFLAGS Anthony PERARD
                   ` (17 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu, Juergen Gross

"libs" is odd and has been introduced without a reason by c7d3afbb44.
Instead, only use "all".

Also remove "build" target as "all" is more appropriate and nothing is
using "build" in libs/ in the xen.git repo.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libs/libs.mk        | 12 +++---------
 tools/libs/light/Makefile |  2 +-
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk
index 996d467346..7c5ae26bbd 100644
--- a/tools/libs/libs.mk
+++ b/tools/libs/libs.mk
@@ -53,13 +53,7 @@ $(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_INCLUDE)
 $(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR = $(CURDIR)
 
 .PHONY: all
-all: build
-
-.PHONY: build
-build: libs libxen$(LIBNAME).map $(LIBHEADERS)
-
-.PHONY: libs
-libs: headers.chk $(LIB) $(PKG_CONFIG_INST) $(PKG_CONFIG_LOCAL)
+all: headers.chk $(LIB) $(PKG_CONFIG_INST) $(PKG_CONFIG_LOCAL) libxen$(LIBNAME).map $(LIBHEADERS)
 
 ifneq ($(NO_HEADERS_CHK),y)
 headers.chk:
@@ -96,14 +90,14 @@ lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxen$(LIBNAME).map
 # If abi-dumper is available, write out the ABI analysis
 ifneq ($(ABI_DUMPER),)
 ifneq ($(nosharedlibs),y)
-libs: $(PKG_ABI)
+all: $(PKG_ABI)
 $(PKG_ABI): lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR) headers.lst
 	$(ABI_DUMPER) $< -o $@ -public-headers headers.lst -lver $(MAJOR).$(MINOR)
 endif
 endif
 
 .PHONY: install
-install: build
+install: all
 	$(INSTALL_DIR) $(DESTDIR)$(libdir)
 	$(INSTALL_DIR) $(DESTDIR)$(includedir)
 	$(INSTALL_SHLIB) lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile
index fb5a9ca87e..be32d95d39 100644
--- a/tools/libs/light/Makefile
+++ b/tools/libs/light/Makefile
@@ -187,7 +187,7 @@ testidl.c: libxl_types.idl gentest.py $(XEN_INCLUDE)/libxl.h $(AUTOINCS)
 	$(PYTHON) gentest.py libxl_types.idl testidl.c.new
 	mv testidl.c.new testidl.c
 
-build: $(CLIENTS) $(TEST_PROGS) $(AUTOSRCS) $(AUTOINCS)
+all: $(CLIENTS) $(TEST_PROGS) $(AUTOSRCS) $(AUTOINCS)
 
 $(LIB_OBJS) $(PIC_OBJS) $(SAVE_HELPER_OBJS) $(LIBXL_TEST_OBJS) $(TEST_PROG_OBJS): $(AUTOINCS) libxl.api-ok
 
-- 
Anthony PERARD



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

* [XEN PATCH 40/57] libs: rename LDUSELIBS to LDLIBS and use it instead of APPEND_LDFLAGS
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (38 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 39/57] libs: Remove both "libs" and "build" target Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-07 12:17   ` Juergen Gross
  2021-12-06 17:02 ` [XEN PATCH 41/57] libs: Remove need for *installlocal targets Anthony PERARD
                   ` (16 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu, Juergen Gross

LDLIBS is more appropriate and intended to be used to add library
dependencies. APPEND_LDFLAGS wasn't intended to be changed by the
build system.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libs/libs.mk        |  4 ++--
 tools/libs/guest/Makefile |  2 +-
 tools/libs/hypfs/Makefile |  2 +-
 tools/libs/light/Makefile | 18 +++++++++---------
 tools/libs/stat/Makefile  |  2 +-
 tools/libs/store/Makefile |  2 +-
 6 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk
index 7c5ae26bbd..91d4efeaed 100644
--- a/tools/libs/libs.mk
+++ b/tools/libs/libs.mk
@@ -15,7 +15,7 @@ CFLAGS   += -Werror -Wmissing-prototypes
 CFLAGS   += $(CFLAGS_xeninclude)
 CFLAGS   += $(foreach lib, $(USELIBS_$(LIBNAME)), $(CFLAGS_libxen$(lib)))
 
-LDUSELIBS = $(foreach lib, $(USELIBS_$(LIBNAME)), $(LDLIBS_libxen$(lib)))
+LDLIBS += $(foreach lib, $(USELIBS_$(LIBNAME)), $(LDLIBS_libxen$(lib)))
 
 LIB_OBJS := $(SRCS-y:.c=.o)
 PIC_OBJS := $(SRCS-y:.c=.opic)
@@ -85,7 +85,7 @@ lib$(LIB_FILE_NAME).so.$(MAJOR): lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR)
 	$(SYMLINK_SHLIB) $< $@
 
 lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxen$(LIBNAME).map
-	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,lib$(LIB_FILE_NAME).so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDUSELIBS) $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,lib$(LIB_FILE_NAME).so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDLIBS) $(APPEND_LDFLAGS)
 
 # If abi-dumper is available, write out the ABI analysis
 ifneq ($(ABI_DUMPER),)
diff --git a/tools/libs/guest/Makefile b/tools/libs/guest/Makefile
index 1f4b7f7c58..636b4ea5cb 100644
--- a/tools/libs/guest/Makefile
+++ b/tools/libs/guest/Makefile
@@ -102,7 +102,7 @@ NO_HEADERS_CHK := y
 
 include $(XEN_ROOT)/tools/libs/libs.mk
 
-libxenguest.so.$(MAJOR).$(MINOR): APPEND_LDFLAGS += $(ZLIB_LIBS) -lz
+libxenguest.so.$(MAJOR).$(MINOR): LDLIBS += $(ZLIB_LIBS) -lz
 
 -include $(DEPS_INCLUDE)
 
diff --git a/tools/libs/hypfs/Makefile b/tools/libs/hypfs/Makefile
index 39feca87e8..efa955bd50 100644
--- a/tools/libs/hypfs/Makefile
+++ b/tools/libs/hypfs/Makefile
@@ -4,7 +4,7 @@ include $(XEN_ROOT)/tools/Rules.mk
 MAJOR    = 1
 MINOR    = 0
 
-APPEND_LDFLAGS += -lz
+LDLIBS += -lz
 
 SRCS-y                 += core.c
 
diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile
index be32d95d39..622fa04470 100644
--- a/tools/libs/light/Makefile
+++ b/tools/libs/light/Makefile
@@ -166,14 +166,14 @@ NO_HEADERS_CHK := y
 
 include $(XEN_ROOT)/tools/libs/libs.mk
 
-LDUSELIBS-y += $(PTYFUNCS_LIBS)
-LDUSELIBS-$(CONFIG_LIBNL) += $(LIBNL3_LIBS)
-LDUSELIBS-$(CONFIG_Linux) += -luuid
-LDUSELIBS-$(CONFIG_Linux) += -lrt
-LDUSELIBS-$(CONFIG_ARM) += -lfdt
-LDUSELIBS-y += $(PTHREAD_LIBS)
-LDUSELIBS-y += -lyajl
-LDUSELIBS += $(LDUSELIBS-y)
+LDLIBS-y += $(PTYFUNCS_LIBS)
+LDLIBS-$(CONFIG_LIBNL) += $(LIBNL3_LIBS)
+LDLIBS-$(CONFIG_Linux) += -luuid
+LDLIBS-$(CONFIG_Linux) += -lrt
+LDLIBS-$(CONFIG_ARM) += -lfdt
+LDLIBS-y += $(PTHREAD_LIBS)
+LDLIBS-y += -lyajl
+LDLIBS += $(LDLIBS-y)
 
 $(LIB_OBJS) $(PIC_OBJS) $(LIBXL_TEST_OBJS): CFLAGS += $(CFLAGS_LIBXL) -include $(XEN_ROOT)/tools/config.h
 $(ACPI_OBJS) $(ACPI_PIC_OBJS): CFLAGS += -I. -DLIBACPI_STDUTILS=\"$(CURDIR)/libxl_x86_acpi.h\"
@@ -232,7 +232,7 @@ $(XEN_INCLUDE)/_%.h: _%.h
 	$(call move-if-changed,_$*.h,$(XEN_INCLUDE)/_$*.h)
 
 libxenlight_test.so: $(PIC_OBJS) $(LIBXL_TEST_OBJS)
-	$(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenlight.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDUSELIBS) $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenlight.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS) $(APPEND_LDFLAGS)
 
 test_%: test_%.o test_common.o libxenlight_test.so
 	$(CC) $(LDFLAGS) -o $@ $^ $(filter-out %libxenlight.so, $(LDLIBS_libxenlight)) $(LDLIBS_libxentoollog) $(LDLIBS_libxentoolcore) -lyajl $(APPEND_LDFLAGS)
diff --git a/tools/libs/stat/Makefile b/tools/libs/stat/Makefile
index 01417b5334..c8c81048c0 100644
--- a/tools/libs/stat/Makefile
+++ b/tools/libs/stat/Makefile
@@ -26,7 +26,7 @@ SRCS-$(CONFIG_FreeBSD) += xenstat_freebsd.c
 
 LDLIBS-y += -lyajl
 LDLIBS-$(CONFIG_SunOS) += -lkstat
-APPEND_LDFLAGS += $(LDLIBS-y)
+LDLIBS += $(LDLIBS-y)
 
 include $(XEN_ROOT)/tools/libs/libs.mk
 
diff --git a/tools/libs/store/Makefile b/tools/libs/store/Makefile
index c208dbb48a..457122a041 100644
--- a/tools/libs/store/Makefile
+++ b/tools/libs/store/Makefile
@@ -5,7 +5,7 @@ MAJOR = 4
 MINOR = 0
 
 ifeq ($(CONFIG_Linux),y)
-APPEND_LDFLAGS += -ldl
+LDLIBS += -ldl
 endif
 
 SRCS-y   += xs_lib.c
-- 
Anthony PERARD



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

* [XEN PATCH 41/57] libs: Remove need for *installlocal targets
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (39 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 40/57] libs: rename LDUSELIBS to LDLIBS and use it instead of APPEND_LDFLAGS Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-07 13:20   ` Juergen Gross
  2021-12-06 17:02 ` [XEN PATCH 42/57] libs,tools/include: Clean "clean" targets Anthony PERARD
                   ` (15 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu, Juergen Gross

There is no need for an extra "installlocal" target, we can use
double-colon rules instead.

"install-headers" in "libs/store" was introduced for the same reason
that "installlocal" exist, so it is replaced as well.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libs/libs.mk        |  4 ++--
 tools/libs/light/Makefile | 10 ++--------
 tools/libs/store/Makefile | 10 ++--------
 3 files changed, 6 insertions(+), 18 deletions(-)

diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk
index 91d4efeaed..7f2c676be4 100644
--- a/tools/libs/libs.mk
+++ b/tools/libs/libs.mk
@@ -97,7 +97,7 @@ endif
 endif
 
 .PHONY: install
-install: all
+install:: all
 	$(INSTALL_DIR) $(DESTDIR)$(libdir)
 	$(INSTALL_DIR) $(DESTDIR)$(includedir)
 	$(INSTALL_SHLIB) lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
@@ -108,7 +108,7 @@ install: all
 	$(INSTALL_DATA) $(PKG_CONFIG) $(DESTDIR)$(PKG_INSTALLDIR)
 
 .PHONY: uninstall
-uninstall:
+uninstall::
 	rm -f $(DESTDIR)$(PKG_INSTALLDIR)/$(LIB_FILE_NAME).pc
 	for i in $(LIBHEADER); do rm -f $(DESTDIR)$(includedir)/$$i; done
 	rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so
diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile
index 622fa04470..5e52db9b30 100644
--- a/tools/libs/light/Makefile
+++ b/tools/libs/light/Makefile
@@ -243,17 +243,11 @@ libxl-save-helper: $(SAVE_HELPER_OBJS) libxenlight.so
 testidl: testidl.o libxenlight.so
 	$(CC) $(LDFLAGS) -o $@ testidl.o $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) $(LDLIBS_libxentoolcore) $(APPEND_LDFLAGS)
 
-install: installlocal $(LIBHEADERS)
-
-.PHONY: installlocal
-installlocal: libxl-save-helper
+install:: $(LIBHEADERS) libxl-save-helper
 	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
 	$(INSTALL_PROG) libxl-save-helper $(DESTDIR)$(LIBEXEC_BIN)
 
-uninstall: uninstalllocal
-
-.PHONY: uninstalllocal
-uninstalllocal:
+uninstall::
 	rm -f $(DESTDIR)$(LIBEXEC_BIN)/libxl-save-helper
 
 clean: cleanlocal
diff --git a/tools/libs/store/Makefile b/tools/libs/store/Makefile
index 457122a041..1bacee6cf1 100644
--- a/tools/libs/store/Makefile
+++ b/tools/libs/store/Makefile
@@ -32,10 +32,7 @@ endif
 -include $(DEPS_INCLUDE)
 
 .PHONY: install
-install: install-headers
-
-.PHONY: install-headers
-install-headers:
+install::
 	$(INSTALL_DIR) $(DESTDIR)$(includedir)
 	$(INSTALL_DIR) $(DESTDIR)$(includedir)/xenstore-compat
 	$(INSTALL_DATA) $(XEN_INCLUDE)/xenstore-compat/xs.h $(DESTDIR)$(includedir)/xenstore-compat/xs.h
@@ -44,10 +41,7 @@ install-headers:
 	ln -sf xenstore-compat/xs_lib.h $(DESTDIR)$(includedir)/xs_lib.h
 
 .PHONY: uninstall
-uninstall: uninstall-headers
-
-.PHONY: uninstall-headers
-uninstall-headers:
+uninstall::
 	rm -f $(DESTDIR)$(includedir)/xs_lib.h
 	rm -f $(DESTDIR)$(includedir)/xs.h
 	rm -f $(DESTDIR)$(includedir)/xenstore-compat/xs_lib.h
-- 
Anthony PERARD



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

* [XEN PATCH 42/57] libs,tools/include: Clean "clean" targets
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (40 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 41/57] libs: Remove need for *installlocal targets Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-07 13:21   ` Juergen Gross
  2021-12-06 17:02 ` [XEN PATCH 43/57] libs: Rename $(SRCS-y) to $(OBJS-y) Anthony PERARD
                   ` (14 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu, Juergen Gross

There is no need for an extra "cleanlocal" target, we can use
double-colon rules instead.

Generated headers are now in tools/include/, so remove those file
there.

Remove -f flag as it's already in $(RM).

libs.mk:
  - don't try to remove "*.rpm" anymore.

libs/light:
  - "_paths.*.tmp" isn't created anymore.
  - clean "libxenlight_test.so" and "libxl_test_*.opic".

libs/util:
  - fix clean of version-script file.

include/xen-foreign:
  - remove __pycache__

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libs/libs.mk                 |  4 ++--
 tools/include/Makefile             |  1 +
 tools/include/xen-foreign/Makefile |  1 +
 tools/libs/ctrl/Makefile           |  5 +----
 tools/libs/guest/Makefile          |  3 +--
 tools/libs/light/Makefile          | 19 ++++++++-----------
 tools/libs/stat/Makefile           |  5 +----
 tools/libs/util/Makefile           |  7 ++-----
 tools/libs/vchan/Makefile          |  5 +----
 9 files changed, 18 insertions(+), 32 deletions(-)

diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk
index 7f2c676be4..3078e45cf4 100644
--- a/tools/libs/libs.mk
+++ b/tools/libs/libs.mk
@@ -121,8 +121,8 @@ TAGS:
 	etags -t *.c *.h
 
 .PHONY: clean
-clean:
-	rm -rf *.rpm $(LIB) *~ $(DEPS_RM) $(LIB_OBJS) $(PIC_OBJS)
+clean::
+	rm -rf $(LIB) *~ $(DEPS_RM) $(LIB_OBJS) $(PIC_OBJS)
 	rm -f lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR) lib$(LIB_FILE_NAME).so.$(MAJOR)
 	rm -f headers.chk headers.lst
 	rm -f $(PKG_CONFIG)
diff --git a/tools/include/Makefile b/tools/include/Makefile
index 42605d46b9..a9c11d06c8 100644
--- a/tools/include/Makefile
+++ b/tools/include/Makefile
@@ -80,6 +80,7 @@ uninstall:
 clean:
 	rm -rf xen xen-xsm acpi
 	$(MAKE) -C xen-foreign clean
+	rm -f _*.h
 
 .PHONY: dist
 dist: install
diff --git a/tools/include/xen-foreign/Makefile b/tools/include/xen-foreign/Makefile
index 6ce51daf5e..b538d0ea94 100644
--- a/tools/include/xen-foreign/Makefile
+++ b/tools/include/xen-foreign/Makefile
@@ -13,6 +13,7 @@ clean:
 	rm -f $(headers)
 	rm -f checker checker.c
 	rm -f *.pyc *.o *~
+	rm -rf __pycache__
 
 distclean: clean
 
diff --git a/tools/libs/ctrl/Makefile b/tools/libs/ctrl/Makefile
index 5d866b8d04..a46e30a168 100644
--- a/tools/libs/ctrl/Makefile
+++ b/tools/libs/ctrl/Makefile
@@ -56,8 +56,5 @@ include $(XEN_ROOT)/tools/libs/libs.mk
 
 -include $(DEPS_INCLUDE)
 
-clean: cleanlocal
-
-.PHONY: cleanlocal
-cleanlocal:
+clean::
 	rm -f libxenctrl.map
diff --git a/tools/libs/guest/Makefile b/tools/libs/guest/Makefile
index 636b4ea5cb..67837c4e73 100644
--- a/tools/libs/guest/Makefile
+++ b/tools/libs/guest/Makefile
@@ -106,6 +106,5 @@ libxenguest.so.$(MAJOR).$(MINOR): LDLIBS += $(ZLIB_LIBS) -lz
 
 -include $(DEPS_INCLUDE)
 
-.PHONY: cleanlocal
-cleanlocal:
+clean::
 	rm -f libxenguest.map
diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile
index 5e52db9b30..719630eda2 100644
--- a/tools/libs/light/Makefile
+++ b/tools/libs/light/Makefile
@@ -250,17 +250,14 @@ install:: $(LIBHEADERS) libxl-save-helper
 uninstall::
 	rm -f $(DESTDIR)$(LIBEXEC_BIN)/libxl-save-helper
 
-clean: cleanlocal
-
-.PHONY: cleanlocal
-cleanlocal:
-	$(RM) -f _*.h *.o $(CLIENTS)
-	$(RM) -f _*.c *.pyc _paths.*.tmp _*.api-for-check
-	$(RM) -f testidl.c.new testidl.c *.api-ok
-	$(RM) -f $(TEST_PROGS)
-	$(RM) -rf __pycache__
-	$(RM) -f libxenlight.map
-	$(RM) -f $(AUTOSRCS) $(AUTOINCS)
+clean::
+	$(RM) _*.h *.o $(CLIENTS)
+	$(RM) _*.c *.pyc _*.api-for-check
+	$(RM) testidl.c.new testidl.c *.api-ok
+	$(RM) $(TEST_PROGS) libxenlight_test.so libxl_test_*.opic
+	$(RM) -r __pycache__
+	$(RM) libxenlight.map
+	$(RM) $(AUTOSRCS) $(AUTOINCS)
 	$(MAKE) -C $(ACPI_PATH) ACPI_BUILD_DIR=$(CURDIR) clean
 
 -include $(DEPS_INCLUDE)
diff --git a/tools/libs/stat/Makefile b/tools/libs/stat/Makefile
index c8c81048c0..24b5949b3e 100644
--- a/tools/libs/stat/Makefile
+++ b/tools/libs/stat/Makefile
@@ -115,10 +115,7 @@ install: install-perl-bindings
 uninstall: uninstall-perl-bindings
 endif
 
-clean: cleanlocal
-
-.PHONY: cleanlocal
-cleanlocal:
+clean::
 	rm -f $(BINDINGS) $(BINDINGSRC) $(DEPS_RM)
 	rm -f libxenstat.map
 
diff --git a/tools/libs/util/Makefile b/tools/libs/util/Makefile
index 87425d862a..4e41bc9ff0 100644
--- a/tools/libs/util/Makefile
+++ b/tools/libs/util/Makefile
@@ -51,8 +51,5 @@ $(LIB_OBJS) $(PIC_OBJS): $(AUTOINCS)
 
 -include $(DEPS_INCLUDE)
 
-clean: cleanlocal
-
-.PHONY: cleanlocal
-cleanlocal:
-	$(RM) -f libxlutil.map
+clean::
+	$(RM) libxenutil.map
diff --git a/tools/libs/vchan/Makefile b/tools/libs/vchan/Makefile
index df112f1b88..f6f1002800 100644
--- a/tools/libs/vchan/Makefile
+++ b/tools/libs/vchan/Makefile
@@ -13,8 +13,5 @@ NO_HEADERS_CHK := y
 include $(XEN_ROOT)/tools/libs/libs.mk
 -include $(DEPS_INCLUDE)
 
-clean: cleanlocal
-
-.PHONY: cleanlocal
-cleanlocal:
+clean::
 	rm -f libxenvchan.map
-- 
Anthony PERARD



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

* [XEN PATCH 43/57] libs: Rename $(SRCS-y) to $(OBJS-y)
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (41 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 42/57] libs,tools/include: Clean "clean" targets Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-07 13:24   ` Juergen Gross
  2021-12-06 17:02 ` [XEN PATCH 44/57] libs/guest: rename ELF_OBJS to LIBELF_OBJS Anthony PERARD
                   ` (13 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu, Juergen Gross

The only thing done thing done with $(SRCS-y) is to replace ".c" by
".o". It is more useful to collect which object we want to build as
make will figure out how to build it and from which source file.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libs/libs.mk                |   7 +-
 tools/libs/call/Makefile          |  12 +--
 tools/libs/ctrl/Makefile          |  74 +++++++-------
 tools/libs/devicemodel/Makefile   |  12 +--
 tools/libs/evtchn/Makefile        |  12 +--
 tools/libs/foreignmemory/Makefile |  12 +--
 tools/libs/gnttab/Makefile        |  14 +--
 tools/libs/guest/Makefile         |  86 ++++++++--------
 tools/libs/hypfs/Makefile         |   2 +-
 tools/libs/light/Makefile         | 162 +++++++++++++++---------------
 tools/libs/stat/Makefile          |  12 +--
 tools/libs/store/Makefile         |   4 +-
 tools/libs/toolcore/Makefile      |   4 +-
 tools/libs/toollog/Makefile       |   4 +-
 tools/libs/util/Makefile          |  16 +--
 tools/libs/vchan/Makefile         |   4 +-
 16 files changed, 218 insertions(+), 219 deletions(-)

diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk
index 3078e45cf4..d3b056e799 100644
--- a/tools/libs/libs.mk
+++ b/tools/libs/libs.mk
@@ -17,8 +17,7 @@ CFLAGS   += $(foreach lib, $(USELIBS_$(LIBNAME)), $(CFLAGS_libxen$(lib)))
 
 LDLIBS += $(foreach lib, $(USELIBS_$(LIBNAME)), $(LDLIBS_libxen$(lib)))
 
-LIB_OBJS := $(SRCS-y:.c=.o)
-PIC_OBJS := $(SRCS-y:.c=.opic)
+PIC_OBJS := $(OBJS-y:.o=.opic)
 
 LIB_FILE_NAME = $(FILENAME_$(LIBNAME))
 LIB := lib$(LIB_FILE_NAME).a
@@ -76,7 +75,7 @@ headers.lst: FORCE
 libxen$(LIBNAME).map:
 	echo 'VERS_$(MAJOR).$(MINOR) { global: *; };' >$@
 
-lib$(LIB_FILE_NAME).a: $(LIB_OBJS)
+lib$(LIB_FILE_NAME).a: $(OBJS-y)
 	$(AR) rc $@ $^
 
 lib$(LIB_FILE_NAME).so: lib$(LIB_FILE_NAME).so.$(MAJOR)
@@ -122,7 +121,7 @@ TAGS:
 
 .PHONY: clean
 clean::
-	rm -rf $(LIB) *~ $(DEPS_RM) $(LIB_OBJS) $(PIC_OBJS)
+	rm -rf $(LIB) *~ $(DEPS_RM) $(OBJS-y) $(PIC_OBJS)
 	rm -f lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR) lib$(LIB_FILE_NAME).so.$(MAJOR)
 	rm -f headers.chk headers.lst
 	rm -f $(PKG_CONFIG)
diff --git a/tools/libs/call/Makefile b/tools/libs/call/Makefile
index 93d404b79e..e5cb7c937c 100644
--- a/tools/libs/call/Makefile
+++ b/tools/libs/call/Makefile
@@ -4,11 +4,11 @@ include $(XEN_ROOT)/tools/Rules.mk
 MAJOR    = 1
 MINOR    = 3
 
-SRCS-y                 += core.c buffer.c
-SRCS-$(CONFIG_Linux)   += linux.c
-SRCS-$(CONFIG_FreeBSD) += freebsd.c
-SRCS-$(CONFIG_SunOS)   += solaris.c
-SRCS-$(CONFIG_NetBSD)  += netbsd.c
-SRCS-$(CONFIG_MiniOS)  += minios.c
+OBJS-y                 += core.o buffer.o
+OBJS-$(CONFIG_Linux)   += linux.o
+OBJS-$(CONFIG_FreeBSD) += freebsd.o
+OBJS-$(CONFIG_SunOS)   += solaris.o
+OBJS-$(CONFIG_NetBSD)  += netbsd.o
+OBJS-$(CONFIG_MiniOS)  += minios.o
 
 include $(XEN_ROOT)/tools/libs/libs.mk
diff --git a/tools/libs/ctrl/Makefile b/tools/libs/ctrl/Makefile
index a46e30a168..df145ba8ec 100644
--- a/tools/libs/ctrl/Makefile
+++ b/tools/libs/ctrl/Makefile
@@ -1,43 +1,43 @@
 XEN_ROOT = $(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-SRCS-y       += xc_altp2m.c
-SRCS-y       += xc_cpupool.c
-SRCS-y       += xc_domain.c
-SRCS-y       += xc_evtchn.c
-SRCS-y       += xc_gnttab.c
-SRCS-y       += xc_misc.c
-SRCS-y       += xc_flask.c
-SRCS-y       += xc_physdev.c
-SRCS-y       += xc_private.c
-SRCS-y       += xc_csched.c
-SRCS-y       += xc_csched2.c
-SRCS-y       += xc_arinc653.c
-SRCS-y       += xc_rt.c
-SRCS-y       += xc_tbuf.c
-SRCS-y       += xc_pm.c
-SRCS-y       += xc_cpu_hotplug.c
-SRCS-y       += xc_vm_event.c
-SRCS-y       += xc_vmtrace.c
-SRCS-y       += xc_monitor.c
-SRCS-y       += xc_mem_paging.c
-SRCS-y       += xc_mem_access.c
-SRCS-y       += xc_memshr.c
-SRCS-y       += xc_hcall_buf.c
-SRCS-y       += xc_foreign_memory.c
-SRCS-y       += xc_kexec.c
-SRCS-y       += xc_resource.c
-SRCS-$(CONFIG_X86) += xc_psr.c
-SRCS-$(CONFIG_X86) += xc_pagetab.c
-SRCS-$(CONFIG_Linux) += xc_linux.c
-SRCS-$(CONFIG_FreeBSD) += xc_freebsd.c
-SRCS-$(CONFIG_SunOS) += xc_solaris.c
-SRCS-$(CONFIG_NetBSD) += xc_netbsd.c
-SRCS-$(CONFIG_NetBSDRump) += xc_netbsd.c
-SRCS-$(CONFIG_MiniOS) += xc_minios.c
-SRCS-y       += xc_evtchn_compat.c
-SRCS-y       += xc_gnttab_compat.c
-SRCS-y       += xc_devicemodel_compat.c
+OBJS-y       += xc_altp2m.o
+OBJS-y       += xc_cpupool.o
+OBJS-y       += xc_domain.o
+OBJS-y       += xc_evtchn.o
+OBJS-y       += xc_gnttab.o
+OBJS-y       += xc_misc.o
+OBJS-y       += xc_flask.o
+OBJS-y       += xc_physdev.o
+OBJS-y       += xc_private.o
+OBJS-y       += xc_csched.o
+OBJS-y       += xc_csched2.o
+OBJS-y       += xc_arinc653.o
+OBJS-y       += xc_rt.o
+OBJS-y       += xc_tbuf.o
+OBJS-y       += xc_pm.o
+OBJS-y       += xc_cpu_hotplug.o
+OBJS-y       += xc_vm_event.o
+OBJS-y       += xc_vmtrace.o
+OBJS-y       += xc_monitor.o
+OBJS-y       += xc_mem_paging.o
+OBJS-y       += xc_mem_access.o
+OBJS-y       += xc_memshr.o
+OBJS-y       += xc_hcall_buf.o
+OBJS-y       += xc_foreign_memory.o
+OBJS-y       += xc_kexec.o
+OBJS-y       += xc_resource.o
+OBJS-$(CONFIG_X86) += xc_psr.o
+OBJS-$(CONFIG_X86) += xc_pagetab.o
+OBJS-$(CONFIG_Linux) += xc_linux.o
+OBJS-$(CONFIG_FreeBSD) += xc_freebsd.o
+OBJS-$(CONFIG_SunOS) += xc_solaris.o
+OBJS-$(CONFIG_NetBSD) += xc_netbsd.o
+OBJS-$(CONFIG_NetBSDRump) += xc_netbsd.o
+OBJS-$(CONFIG_MiniOS) += xc_minios.o
+OBJS-y       += xc_evtchn_compat.o
+OBJS-y       += xc_gnttab_compat.o
+OBJS-y       += xc_devicemodel_compat.o
 
 CFLAGS   += -D__XEN_TOOLS__
 CFLAGS	+= $(PTHREAD_CFLAGS)
diff --git a/tools/libs/devicemodel/Makefile b/tools/libs/devicemodel/Makefile
index 3e50ff6d90..a0a2d24f99 100644
--- a/tools/libs/devicemodel/Makefile
+++ b/tools/libs/devicemodel/Makefile
@@ -4,11 +4,11 @@ include $(XEN_ROOT)/tools/Rules.mk
 MAJOR    = 1
 MINOR    = 4
 
-SRCS-y                 += core.c
-SRCS-$(CONFIG_Linux)   += common.c
-SRCS-$(CONFIG_FreeBSD) += common.c
-SRCS-$(CONFIG_SunOS)   += compat.c
-SRCS-$(CONFIG_NetBSD)  += compat.c
-SRCS-$(CONFIG_MiniOS)  += compat.c
+OBJS-y                 += core.o
+OBJS-$(CONFIG_Linux)   += common.o
+OBJS-$(CONFIG_FreeBSD) += common.o
+OBJS-$(CONFIG_SunOS)   += compat.o
+OBJS-$(CONFIG_NetBSD)  += compat.o
+OBJS-$(CONFIG_MiniOS)  += compat.o
 
 include $(XEN_ROOT)/tools/libs/libs.mk
diff --git a/tools/libs/evtchn/Makefile b/tools/libs/evtchn/Makefile
index b8c37b5b97..8208ecf650 100644
--- a/tools/libs/evtchn/Makefile
+++ b/tools/libs/evtchn/Makefile
@@ -4,11 +4,11 @@ include $(XEN_ROOT)/tools/Rules.mk
 MAJOR    = 1
 MINOR    = 2
 
-SRCS-y                 += core.c
-SRCS-$(CONFIG_Linux)   += linux.c
-SRCS-$(CONFIG_FreeBSD) += freebsd.c
-SRCS-$(CONFIG_SunOS)   += solaris.c
-SRCS-$(CONFIG_NetBSD)  += netbsd.c
-SRCS-$(CONFIG_MiniOS)  += minios.c
+OBJS-y                 += core.o
+OBJS-$(CONFIG_Linux)   += linux.o
+OBJS-$(CONFIG_FreeBSD) += freebsd.o
+OBJS-$(CONFIG_SunOS)   += solaris.o
+OBJS-$(CONFIG_NetBSD)  += netbsd.o
+OBJS-$(CONFIG_MiniOS)  += minios.o
 
 include $(XEN_ROOT)/tools/libs/libs.mk
diff --git a/tools/libs/foreignmemory/Makefile b/tools/libs/foreignmemory/Makefile
index 0eb9a3a712..4427435932 100644
--- a/tools/libs/foreignmemory/Makefile
+++ b/tools/libs/foreignmemory/Makefile
@@ -4,11 +4,11 @@ include $(XEN_ROOT)/tools/Rules.mk
 MAJOR    = 1
 MINOR    = 4
 
-SRCS-y                 += core.c
-SRCS-$(CONFIG_Linux)   += linux.c
-SRCS-$(CONFIG_FreeBSD) += freebsd.c
-SRCS-$(CONFIG_SunOS)   += compat.c solaris.c
-SRCS-$(CONFIG_NetBSD)  += netbsd.c
-SRCS-$(CONFIG_MiniOS)  += minios.c
+OBJS-y                 += core.o
+OBJS-$(CONFIG_Linux)   += linux.o
+OBJS-$(CONFIG_FreeBSD) += freebsd.o
+OBJS-$(CONFIG_SunOS)   += compat.o solaris.o
+OBJS-$(CONFIG_NetBSD)  += netbsd.o
+OBJS-$(CONFIG_MiniOS)  += minios.o
 
 include $(XEN_ROOT)/tools/libs/libs.mk
diff --git a/tools/libs/gnttab/Makefile b/tools/libs/gnttab/Makefile
index ae390ce60f..7d7aeeadff 100644
--- a/tools/libs/gnttab/Makefile
+++ b/tools/libs/gnttab/Makefile
@@ -4,13 +4,13 @@ include $(XEN_ROOT)/tools/Rules.mk
 MAJOR    = 1
 MINOR    = 2
 
-SRCS-GNTTAB            += gnttab_core.c
-SRCS-GNTSHR            += gntshr_core.c
+OBJS-GNTTAB            += gnttab_core.o
+OBJS-GNTSHR            += gntshr_core.o
 
-SRCS-$(CONFIG_Linux)   += $(SRCS-GNTTAB) $(SRCS-GNTSHR) linux.c
-SRCS-$(CONFIG_MiniOS)  += $(SRCS-GNTTAB) gntshr_unimp.c minios.c
-SRCS-$(CONFIG_FreeBSD) += $(SRCS-GNTTAB) $(SRCS-GNTSHR) freebsd.c
-SRCS-$(CONFIG_NetBSD)  += $(SRCS-GNTTAB) $(SRCS-GNTSHR) netbsd.c
-SRCS-$(CONFIG_SunOS)   += gnttab_unimp.c gntshr_unimp.c
+OBJS-$(CONFIG_Linux)   += $(OBJS-GNTTAB) $(OBJS-GNTSHR) linux.o
+OBJS-$(CONFIG_MiniOS)  += $(OBJS-GNTTAB) gntshr_unimp.o minios.o
+OBJS-$(CONFIG_FreeBSD) += $(OBJS-GNTTAB) $(OBJS-GNTSHR) freebsd.o
+OBJS-$(CONFIG_NetBSD)  += $(OBJS-GNTTAB) $(OBJS-GNTSHR) netbsd.o
+OBJS-$(CONFIG_SunOS)   += gnttab_unimp.o gntshr_unimp.o
 
 include $(XEN_ROOT)/tools/libs/libs.mk
diff --git a/tools/libs/guest/Makefile b/tools/libs/guest/Makefile
index 67837c4e73..455e23c432 100644
--- a/tools/libs/guest/Makefile
+++ b/tools/libs/guest/Makefile
@@ -6,69 +6,69 @@ ifeq ($(CONFIG_LIBXC_MINIOS),y)
 override CONFIG_MIGRATE := n
 endif
 
-SRCS-y += xg_private.c
-SRCS-y += xg_domain.c
-SRCS-y += xg_suspend.c
-SRCS-y += xg_resume.c
+OBJS-y += xg_private.o
+OBJS-y += xg_domain.o
+OBJS-y += xg_suspend.o
+OBJS-y += xg_resume.o
 ifeq ($(CONFIG_MIGRATE),y)
-SRCS-y += xg_sr_common.c
-SRCS-$(CONFIG_X86) += xg_sr_common_x86.c
-SRCS-$(CONFIG_X86) += xg_sr_common_x86_pv.c
-SRCS-$(CONFIG_X86) += xg_sr_restore_x86_pv.c
-SRCS-$(CONFIG_X86) += xg_sr_restore_x86_hvm.c
-SRCS-$(CONFIG_X86) += xg_sr_save_x86_pv.c
-SRCS-$(CONFIG_X86) += xg_sr_save_x86_hvm.c
-SRCS-y += xg_sr_restore.c
-SRCS-y += xg_sr_save.c
-SRCS-y += xg_offline_page.c
+OBJS-y += xg_sr_common.o
+OBJS-$(CONFIG_X86) += xg_sr_common_x86.o
+OBJS-$(CONFIG_X86) += xg_sr_common_x86_pv.o
+OBJS-$(CONFIG_X86) += xg_sr_restore_x86_pv.o
+OBJS-$(CONFIG_X86) += xg_sr_restore_x86_hvm.o
+OBJS-$(CONFIG_X86) += xg_sr_save_x86_pv.o
+OBJS-$(CONFIG_X86) += xg_sr_save_x86_hvm.o
+OBJS-y += xg_sr_restore.o
+OBJS-y += xg_sr_save.o
+OBJS-y += xg_offline_page.o
 else
-SRCS-y += xg_nomigrate.c
+OBJS-y += xg_nomigrate.o
 endif
-SRCS-y       += xg_core.c
-SRCS-$(CONFIG_X86) += xg_core_x86.c
-SRCS-$(CONFIG_ARM) += xg_core_arm.c
+OBJS-y       += xg_core.o
+OBJS-$(CONFIG_X86) += xg_core_x86.o
+OBJS-$(CONFIG_ARM) += xg_core_arm.o
 
 CFLAGS += -I$(XEN_libxenctrl)
 
 vpath %.c ../../../xen/common/libelf
 CFLAGS += -I../../../xen/common/libelf
 
-ELF_SRCS-y += libelf-tools.c libelf-loader.c
-ELF_SRCS-y += libelf-dominfo.c
+ELF_OBJS-y += libelf-tools.o libelf-loader.o
+ELF_OBJS-y += libelf-dominfo.o
 
-SRCS-y += $(ELF_SRCS-y)
+OBJS-y += $(ELF_OBJS-y)
 
-$(patsubst %.c,%.o,$(ELF_SRCS-y)): CFLAGS += -Wno-pointer-sign
-$(patsubst %.c,%.opic,$(ELF_SRCS-y)): CFLAGS += -Wno-pointer-sign
+$(ELF_OBJS-y): CFLAGS += -Wno-pointer-sign
+$(ELF_OBJS-y:.o=.opic): CFLAGS += -Wno-pointer-sign
 
 ifeq ($(CONFIG_X86),y) # Add libx86 to the build
 vpath %.c ../../../xen/lib/x86
 
-SRCS-y                 += cpuid.c msr.c policy.c
+OBJS-y                 += cpuid.o msr.o policy.o
 endif
 
 # new domain builder
-SRCS-y                 += xg_dom_core.c
-SRCS-y                 += xg_dom_boot.c
-SRCS-y                 += xg_dom_elfloader.c
-SRCS-$(CONFIG_X86)     += xg_dom_bzimageloader.c
-SRCS-$(CONFIG_X86)     += xg_dom_decompress_lz4.c
-SRCS-$(CONFIG_X86)     += xg_dom_hvmloader.c
-SRCS-$(CONFIG_ARM)     += xg_dom_armzimageloader.c
-SRCS-y                 += xg_dom_binloader.c
-SRCS-y                 += xg_dom_compat_linux.c
-
-SRCS-$(CONFIG_X86)     += xg_dom_x86.c
-SRCS-$(CONFIG_X86)     += xg_cpuid_x86.c
-SRCS-$(CONFIG_ARM)     += xg_dom_arm.c
+OBJS-y                 += xg_dom_core.o
+OBJS-y                 += xg_dom_boot.o
+OBJS-y                 += xg_dom_elfloader.o
+OBJS-$(CONFIG_X86)     += xg_dom_bzimageloader.o
+OBJS-$(CONFIG_X86)     += xg_dom_decompress_lz4.o
+OBJS-$(CONFIG_X86)     += xg_dom_hvmloader.o
+OBJS-$(CONFIG_ARM)     += xg_dom_armzimageloader.o
+OBJS-y                 += xg_dom_binloader.o
+OBJS-y                 += xg_dom_compat_linux.o
+
+OBJS-$(CONFIG_X86)     += xg_dom_x86.o
+OBJS-$(CONFIG_X86)     += xg_cpuid_x86.o
+OBJS-$(CONFIG_ARM)     += xg_dom_arm.o
 
 ifeq ($(CONFIG_LIBXC_MINIOS),y)
-SRCS-y                 += xg_dom_decompress_unsafe.c
-SRCS-y                 += xg_dom_decompress_unsafe_bzip2.c
-SRCS-y                 += xg_dom_decompress_unsafe_lzma.c
-SRCS-y                 += xg_dom_decompress_unsafe_lzo1x.c
-SRCS-y                 += xg_dom_decompress_unsafe_xz.c
-SRCS-y                 += xg_dom_decompress_unsafe_zstd.c
+OBJS-y                 += xg_dom_decompress_unsafe.o
+OBJS-y                 += xg_dom_decompress_unsafe_bzip2.o
+OBJS-y                 += xg_dom_decompress_unsafe_lzma.o
+OBJS-y                 += xg_dom_decompress_unsafe_lzo1x.o
+OBJS-y                 += xg_dom_decompress_unsafe_xz.o
+OBJS-y                 += xg_dom_decompress_unsafe_zstd.o
 endif
 
 CFLAGS   += -Werror -Wmissing-prototypes
diff --git a/tools/libs/hypfs/Makefile b/tools/libs/hypfs/Makefile
index efa955bd50..630e1e6f3e 100644
--- a/tools/libs/hypfs/Makefile
+++ b/tools/libs/hypfs/Makefile
@@ -6,6 +6,6 @@ MINOR    = 0
 
 LDLIBS += -lz
 
-SRCS-y                 += core.c
+OBJS-y += core.o
 
 include ../libs.mk
diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile
index 719630eda2..d3ae2f6179 100644
--- a/tools/libs/light/Makefile
+++ b/tools/libs/light/Makefile
@@ -1,31 +1,31 @@
 XEN_ROOT = $(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-SRCS-y += osdeps.c
-SRCS-y += libxl_paths.c
-SRCS-y += libxl_bootloader.c
-SRCS-y += flexarray.c
+OBJS-y += osdeps.o
+OBJS-y += libxl_paths.o
+OBJS-y += libxl_bootloader.o
+OBJS-y += flexarray.o
 ifeq ($(CONFIG_LIBNL),y)
-SRCS-y += libxl_netbuffer.c
+OBJS-y += libxl_netbuffer.o
 else
-SRCS-y += libxl_nonetbuffer.c
+OBJS-y += libxl_nonetbuffer.o
 endif
 ifeq ($(CONFIG_X86),y)
-SRCS-y += libxl_convert_callout.c
+OBJS-y += libxl_convert_callout.o
 else
-SRCS-y += libxl_no_convert_callout.c
+OBJS-y += libxl_no_convert_callout.o
 endif
-SRCS-y += libxl_remus.c
-SRCS-y += libxl_checkpoint_device.c
-SRCS-y += libxl_remus_disk_drbd.c
+OBJS-y += libxl_remus.o
+OBJS-y += libxl_checkpoint_device.o
+OBJS-y += libxl_remus_disk_drbd.o
 ifeq ($(CONFIG_LIBNL),y)
-SRCS-y += libxl_colo_restore.c
-SRCS-y += libxl_colo_save.c
-SRCS-y += libxl_colo_qdisk.c
-SRCS-y += libxl_colo_proxy.c
-SRCS-y += libxl_colo_nic.c
+OBJS-y += libxl_colo_restore.o
+OBJS-y += libxl_colo_save.o
+OBJS-y += libxl_colo_qdisk.o
+OBJS-y += libxl_colo_proxy.o
+OBJS-y += libxl_colo_nic.o
 else
-SRCS-y += libxl_no_colo.c
+OBJS-y += libxl_no_colo.o
 endif
 
 ACPI_PATH  = $(XEN_ROOT)/tools/libacpi
@@ -40,82 +40,82 @@ vpath static_tables.c $(ACPI_PATH)/
 acpi:
 	$(MAKE) -C $(ACPI_PATH) ACPI_BUILD_DIR=$(CURDIR) DSDT_FILES="$(DSDT_FILES-y)"
 
-SRCS-$(CONFIG_X86) += $(ACPI_OBJS:.o=.c)
+OBJS-$(CONFIG_X86) += $(ACPI_OBJS)
 
 CFLAGS += -Wno-format-zero-length -Wmissing-declarations \
 	-Wno-declaration-after-statement -Wformat-nonliteral
 
 CFLAGS-$(CONFIG_X86) += -DCONFIG_PCI_SUPP_LEGACY_IRQ
 
-SRCS-$(CONFIG_X86) += libxl_cpuid.c
-SRCS-$(CONFIG_X86) += libxl_x86.c
-SRCS-$(CONFIG_X86) += libxl_psr.c
-SRCS-$(CONFIG_X86) += libxl_x86_acpi.c
-SRCS-$(CONFIG_ARM) += libxl_nocpuid.c
-SRCS-$(CONFIG_ARM) += libxl_arm.c
-SRCS-$(CONFIG_ARM) += libxl_libfdt_compat.c
+OBJS-$(CONFIG_X86) += libxl_cpuid.o
+OBJS-$(CONFIG_X86) += libxl_x86.o
+OBJS-$(CONFIG_X86) += libxl_psr.o
+OBJS-$(CONFIG_X86) += libxl_x86_acpi.o
+OBJS-$(CONFIG_ARM) += libxl_nocpuid.o
+OBJS-$(CONFIG_ARM) += libxl_arm.o
+OBJS-$(CONFIG_ARM) += libxl_libfdt_compat.o
 ifeq ($(CONFIG_ARM_64),y)
 DSDT_FILES-y = dsdt_anycpu_arm.c
-SRCS-y += libxl_arm_acpi.c
-SRCS-y += $(DSDT_FILES-y)
+OBJS-y += libxl_arm_acpi.o
+OBJS-y += $(DSDT_FILES-y:.c=.o)
 dsdt_anycpu_arm.c:
 	$(MAKE) -C $(ACPI_PATH) ACPI_BUILD_DIR=$(CURDIR) DSDT_FILES="$(DSDT_FILES-y)"
 else
-SRCS-$(CONFIG_ARM) += libxl_arm_no_acpi.c
+OBJS-$(CONFIG_ARM) += libxl_arm_no_acpi.o
 endif
 
-SRCS-OS-$(CONFIG_NetBSD) = libxl_netbsd.c
-SRCS-OS-$(CONFIG_Linux) = libxl_linux.c libxl_setresuid.c
-SRCS-OS-$(CONFIG_FreeBSD) = libxl_freebsd.c libxl_setresuid.c
-ifeq ($(SRCS-OS-y),)
+OBJS-OS-$(CONFIG_NetBSD) = libxl_netbsd.o
+OBJS-OS-$(CONFIG_Linux) = libxl_linux.o libxl_setresuid.o
+OBJS-OS-$(CONFIG_FreeBSD) = libxl_freebsd.o libxl_setresuid.o
+ifeq ($(OBJS-OS-y),)
 $(error Your Operating System is not supported by libxenlight, \
 please check libxl_linux.c and libxl_netbsd.c to see how to get it ported)
 endif
-SRCS-y += $(SRCS-OS-y)
-
-SRCS-y += libxl.c
-SRCS-y += libxl_create.c
-SRCS-y += libxl_dm.c
-SRCS-y += libxl_pci.c
-SRCS-y += libxl_dom.c
-SRCS-y += libxl_exec.c
-SRCS-y += libxl_xshelp.c
-SRCS-y += libxl_device.c
-SRCS-y += libxl_internal.c
-SRCS-y += libxl_utils.c
-SRCS-y += libxl_uuid.c
-SRCS-y += libxl_json.c
-SRCS-y += libxl_aoutils.c
-SRCS-y += libxl_numa.c
-SRCS-y += libxl_vnuma.c
-SRCS-y += libxl_stream_read.c
-SRCS-y += libxl_stream_write.c
-SRCS-y += libxl_save_callout.c
-SRCS-y += _libxl_save_msgs_callout.c
-SRCS-y += libxl_qmp.c
-SRCS-y += libxl_event.c
-SRCS-y += libxl_fork.c
-SRCS-y += libxl_dom_suspend.c
-SRCS-y += libxl_dom_save.c
-SRCS-y += libxl_usb.c
-SRCS-y += libxl_vtpm.c
-SRCS-y += libxl_nic.c
-SRCS-y += libxl_disk.c
-SRCS-y += libxl_console.c
-SRCS-y += libxl_cpupool.c
-SRCS-y += libxl_mem.c
-SRCS-y += libxl_sched.c
-SRCS-y += libxl_tmem.c
-SRCS-y += libxl_9pfs.c
-SRCS-y += libxl_domain.c
-SRCS-y += libxl_vdispl.c
-SRCS-y += libxl_pvcalls.c
-SRCS-y += libxl_vsnd.c
-SRCS-y += libxl_vkb.c
-SRCS-y += libxl_genid.c
-SRCS-y += _libxl_types.c
-SRCS-y += libxl_flask.c
-SRCS-y += _libxl_types_internal.c
+OBJS-y += $(OBJS-OS-y)
+
+OBJS-y += libxl.o
+OBJS-y += libxl_create.o
+OBJS-y += libxl_dm.o
+OBJS-y += libxl_pci.o
+OBJS-y += libxl_dom.o
+OBJS-y += libxl_exec.o
+OBJS-y += libxl_xshelp.o
+OBJS-y += libxl_device.o
+OBJS-y += libxl_internal.o
+OBJS-y += libxl_utils.o
+OBJS-y += libxl_uuid.o
+OBJS-y += libxl_json.o
+OBJS-y += libxl_aoutils.o
+OBJS-y += libxl_numa.o
+OBJS-y += libxl_vnuma.o
+OBJS-y += libxl_stream_read.o
+OBJS-y += libxl_stream_write.o
+OBJS-y += libxl_save_callout.o
+OBJS-y += _libxl_save_msgs_callout.o
+OBJS-y += libxl_qmp.o
+OBJS-y += libxl_event.o
+OBJS-y += libxl_fork.o
+OBJS-y += libxl_dom_suspend.o
+OBJS-y += libxl_dom_save.o
+OBJS-y += libxl_usb.o
+OBJS-y += libxl_vtpm.o
+OBJS-y += libxl_nic.o
+OBJS-y += libxl_disk.o
+OBJS-y += libxl_console.o
+OBJS-y += libxl_cpupool.o
+OBJS-y += libxl_mem.o
+OBJS-y += libxl_sched.o
+OBJS-y += libxl_tmem.o
+OBJS-y += libxl_9pfs.o
+OBJS-y += libxl_domain.o
+OBJS-y += libxl_vdispl.o
+OBJS-y += libxl_pvcalls.o
+OBJS-y += libxl_vsnd.o
+OBJS-y += libxl_vkb.o
+OBJS-y += libxl_genid.o
+OBJS-y += _libxl_types.o
+OBJS-y += libxl_flask.o
+OBJS-y += _libxl_types_internal.o
 
 ifeq ($(CONFIG_LIBNL),y)
 CFLAGS_LIBXL += $(LIBNL3_CFLAGS)
@@ -175,7 +175,7 @@ LDLIBS-y += $(PTHREAD_LIBS)
 LDLIBS-y += -lyajl
 LDLIBS += $(LDLIBS-y)
 
-$(LIB_OBJS) $(PIC_OBJS) $(LIBXL_TEST_OBJS): CFLAGS += $(CFLAGS_LIBXL) -include $(XEN_ROOT)/tools/config.h
+$(OBJS-y) $(PIC_OBJS) $(LIBXL_TEST_OBJS): CFLAGS += $(CFLAGS_LIBXL) -include $(XEN_ROOT)/tools/config.h
 $(ACPI_OBJS) $(ACPI_PIC_OBJS): CFLAGS += -I. -DLIBACPI_STDUTILS=\"$(CURDIR)/libxl_x86_acpi.h\"
 $(TEST_PROG_OBJS) _libxl.api-for-check: CFLAGS += $(CFLAGS_libxentoollog) $(CFLAGS_libxentoolcore)
 libxl_dom.o libxl_dom.opic: CFLAGS += -I$(XEN_ROOT)/tools  # include libacpi/x86.h
@@ -189,7 +189,7 @@ testidl.c: libxl_types.idl gentest.py $(XEN_INCLUDE)/libxl.h $(AUTOINCS)
 
 all: $(CLIENTS) $(TEST_PROGS) $(AUTOSRCS) $(AUTOINCS)
 
-$(LIB_OBJS) $(PIC_OBJS) $(SAVE_HELPER_OBJS) $(LIBXL_TEST_OBJS) $(TEST_PROG_OBJS): $(AUTOINCS) libxl.api-ok
+$(OBJS-y) $(PIC_OBJS) $(SAVE_HELPER_OBJS) $(LIBXL_TEST_OBJS) $(TEST_PROG_OBJS): $(AUTOINCS) libxl.api-ok
 
 libxl.api-ok: check-libxl-api-rules _libxl.api-for-check
 	$(PERL) $^
@@ -216,8 +216,8 @@ $(XEN_INCLUDE)/libxl_json.h: $(XEN_INCLUDE)/_libxl_types_json.h
 libxl_internal.h: _libxl_types_internal.h _libxl_types_private.h _libxl_types_internal_private.h
 libxl_internal_json.h: _libxl_types_internal_json.h
 
-$(LIB_OBJS) $(PIC_OBJS) $(LIBXL_TEST_OBJS) $(TEST_PROG_OBJS) $(SAVE_HELPER_OBJS): $(XEN_INCLUDE)/libxl.h
-$(LIB_OBJS) $(PIC_OBJS) $(LIBXL_TEST_OBJS): libxl_internal.h
+$(OBJS-y) $(PIC_OBJS) $(LIBXL_TEST_OBJS) $(TEST_PROG_OBJS) $(SAVE_HELPER_OBJS): $(XEN_INCLUDE)/libxl.h
+$(OBJS-y) $(PIC_OBJS) $(LIBXL_TEST_OBJS): libxl_internal.h
 
 _libxl_type%.h _libxl_type%_json.h _libxl_type%_private.h _libxl_type%.c: libxl_type%.idl gentypes.py idl.py
 	$(eval stem = $(notdir $*))
diff --git a/tools/libs/stat/Makefile b/tools/libs/stat/Makefile
index 24b5949b3e..e39fe29bd1 100644
--- a/tools/libs/stat/Makefile
+++ b/tools/libs/stat/Makefile
@@ -17,12 +17,12 @@ include $(XEN_ROOT)/tools/Rules.mk
 
 CFLAGS += -include $(XEN_ROOT)/tools/config.h
 
-SRCS-y += xenstat.c
-SRCS-y += xenstat_qmp.c
-SRCS-$(CONFIG_Linux) += xenstat_linux.c
-SRCS-$(CONFIG_SunOS) += xenstat_solaris.c
-SRCS-$(CONFIG_NetBSD) += xenstat_netbsd.c
-SRCS-$(CONFIG_FreeBSD) += xenstat_freebsd.c
+OBJS-y += xenstat.o
+OBJS-y += xenstat_qmp.o
+OBJS-$(CONFIG_Linux) += xenstat_linux.o
+OBJS-$(CONFIG_SunOS) += xenstat_solaris.o
+OBJS-$(CONFIG_NetBSD) += xenstat_netbsd.o
+OBJS-$(CONFIG_FreeBSD) += xenstat_freebsd.o
 
 LDLIBS-y += -lyajl
 LDLIBS-$(CONFIG_SunOS) += -lkstat
diff --git a/tools/libs/store/Makefile b/tools/libs/store/Makefile
index 1bacee6cf1..6cc9baaabe 100644
--- a/tools/libs/store/Makefile
+++ b/tools/libs/store/Makefile
@@ -8,8 +8,8 @@ ifeq ($(CONFIG_Linux),y)
 LDLIBS += -ldl
 endif
 
-SRCS-y   += xs_lib.c
-SRCS-y   += xs.c
+OBJS-y   += xs_lib.o
+OBJS-y   += xs.o
 
 LIBHEADER = xenstore.h xenstore_lib.h
 
diff --git a/tools/libs/toolcore/Makefile b/tools/libs/toolcore/Makefile
index 3550786491..632048c899 100644
--- a/tools/libs/toolcore/Makefile
+++ b/tools/libs/toolcore/Makefile
@@ -7,13 +7,13 @@ AUTOINCS := $(XEN_INCLUDE)/_xentoolcore_list.h
 
 LIBHEADER := xentoolcore.h xentoolcore_internal.h
 
-SRCS-y	+= handlereg.c
+OBJS-y	+= handlereg.o
 
 include $(XEN_ROOT)/tools/libs/libs.mk
 
 PKG_CONFIG_DESC := Central support for Xen Hypervisor userland libraries
 
-$(LIB_OBJS): $(AUTOINCS)
+$(OBJS-y): $(AUTOINCS)
 $(PIC_OBJS): $(AUTOINCS)
 
 $(XEN_INCLUDE)/_xentoolcore_list.h: $(XEN_INCLUDE)/xen-external/bsd-sys-queue-h-seddery $(XEN_INCLUDE)/xen-external/bsd-sys-queue.h
diff --git a/tools/libs/toollog/Makefile b/tools/libs/toollog/Makefile
index dce1b2de85..c09aa02ba5 100644
--- a/tools/libs/toollog/Makefile
+++ b/tools/libs/toollog/Makefile
@@ -4,7 +4,7 @@ include $(XEN_ROOT)/tools/Rules.mk
 MAJOR	= 1
 MINOR	= 0
 
-SRCS-y	+= xtl_core.c
-SRCS-y	+= xtl_logger_stdio.c
+OBJS-y	+= xtl_core.o
+OBJS-y	+= xtl_logger_stdio.o
 
 include $(XEN_ROOT)/tools/libs/libs.mk
diff --git a/tools/libs/util/Makefile b/tools/libs/util/Makefile
index 4e41bc9ff0..17b95f7c71 100644
--- a/tools/libs/util/Makefile
+++ b/tools/libs/util/Makefile
@@ -1,13 +1,13 @@
 XEN_ROOT = $(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-SRCS-y += libxlu_cfg_y.c
-SRCS-y += libxlu_cfg_l.c
-SRCS-y += libxlu_cfg.c
-SRCS-y += libxlu_disk_l.c
-SRCS-y += libxlu_disk.c
-SRCS-y += libxlu_vif.c
-SRCS-y += libxlu_pci.c
+OBJS-y += libxlu_cfg_y.o
+OBJS-y += libxlu_cfg_l.o
+OBJS-y += libxlu_cfg.o
+OBJS-y += libxlu_disk_l.o
+OBJS-y += libxlu_disk.o
+OBJS-y += libxlu_vif.o
+OBJS-y += libxlu_pci.o
 
 CFLAGS += -Wno-format-zero-length -Wmissing-declarations \
 	-Wno-declaration-after-statement -Wformat-nonliteral
@@ -39,7 +39,7 @@ NO_HEADERS_CHK := y
 
 include $(XEN_ROOT)/tools/libs/libs.mk
 
-$(LIB_OBJS) $(PIC_OBJS): $(AUTOINCS)
+$(OBJS-y) $(PIC_OBJS): $(AUTOINCS)
 
 %.c %.h:: %.y
 	@rm -f $*.[ch]
diff --git a/tools/libs/vchan/Makefile b/tools/libs/vchan/Makefile
index f6f1002800..a41f3623c8 100644
--- a/tools/libs/vchan/Makefile
+++ b/tools/libs/vchan/Makefile
@@ -5,8 +5,8 @@ CFLAGS += $(CFLAGS_libxenctrl)
 
 LIBHEADER := libxenvchan.h
 
-SRCS-y += init.c
-SRCS-y += io.c
+OBJS-y += init.o
+OBJS-y += io.o
 
 NO_HEADERS_CHK := y
 
-- 
Anthony PERARD



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

* [XEN PATCH 44/57] libs/guest: rename ELF_OBJS to LIBELF_OBJS
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (42 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 43/57] libs: Rename $(SRCS-y) to $(OBJS-y) Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-07 13:26   ` Juergen Gross
  2021-12-06 17:02 ` [XEN PATCH 45/57] libs/guest: rework CFLAGS Anthony PERARD
                   ` (12 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu, Juergen Gross

It seems a better name. Latter, we will introduce LIBX86_OBJS to
collect lib/x86/* objects.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libs/guest/Makefile | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/tools/libs/guest/Makefile b/tools/libs/guest/Makefile
index 455e23c432..770b9a7ef1 100644
--- a/tools/libs/guest/Makefile
+++ b/tools/libs/guest/Makefile
@@ -33,13 +33,12 @@ CFLAGS += -I$(XEN_libxenctrl)
 vpath %.c ../../../xen/common/libelf
 CFLAGS += -I../../../xen/common/libelf
 
-ELF_OBJS-y += libelf-tools.o libelf-loader.o
-ELF_OBJS-y += libelf-dominfo.o
+LIBELF_OBJS += libelf-tools.o libelf-loader.o
+LIBELF_OBJS += libelf-dominfo.o
 
-OBJS-y += $(ELF_OBJS-y)
+OBJS-y += $(LIBELF_OBJS)
 
-$(ELF_OBJS-y): CFLAGS += -Wno-pointer-sign
-$(ELF_OBJS-y:.o=.opic): CFLAGS += -Wno-pointer-sign
+$(LIBELF_OBJS) $(LIBELF_OBJS:.o=.opic): CFLAGS += -Wno-pointer-sign
 
 ifeq ($(CONFIG_X86),y) # Add libx86 to the build
 vpath %.c ../../../xen/lib/x86
-- 
Anthony PERARD



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

* [XEN PATCH 45/57] libs/guest: rework CFLAGS
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (43 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 44/57] libs/guest: rename ELF_OBJS to LIBELF_OBJS Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-07 13:29   ` Juergen Gross
  2021-12-06 17:02 ` [XEN PATCH 46/57] libs/store: use of -iquote instead of -I Anthony PERARD
                   ` (11 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu, Juergen Gross

Remove '-Werror -Wmissing-progress -I./include $(CFLAGS_xeninclude)',
those flags are already added via "libs.mk".

Flag "-I." isn't needed, we just need to fix the #include of
"xg_core.h" as this header isn't expected to be installed.

Make use of "-iquote" instead of '-I' for double-quote included
headers.

Also, regroup the CFLAGS into the same place in the makefile.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libs/guest/Makefile          | 20 +++++++++-----------
 tools/libs/guest/xg_offline_page.c |  2 +-
 2 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/tools/libs/guest/Makefile b/tools/libs/guest/Makefile
index 770b9a7ef1..62b8fead86 100644
--- a/tools/libs/guest/Makefile
+++ b/tools/libs/guest/Makefile
@@ -28,18 +28,13 @@ OBJS-y       += xg_core.o
 OBJS-$(CONFIG_X86) += xg_core_x86.o
 OBJS-$(CONFIG_ARM) += xg_core_arm.o
 
-CFLAGS += -I$(XEN_libxenctrl)
-
 vpath %.c ../../../xen/common/libelf
-CFLAGS += -I../../../xen/common/libelf
 
 LIBELF_OBJS += libelf-tools.o libelf-loader.o
 LIBELF_OBJS += libelf-dominfo.o
 
 OBJS-y += $(LIBELF_OBJS)
 
-$(LIBELF_OBJS) $(LIBELF_OBJS:.o=.opic): CFLAGS += -Wno-pointer-sign
-
 ifeq ($(CONFIG_X86),y) # Add libx86 to the build
 vpath %.c ../../../xen/lib/x86
 
@@ -70,10 +65,12 @@ OBJS-y                 += xg_dom_decompress_unsafe_xz.o
 OBJS-y                 += xg_dom_decompress_unsafe_zstd.o
 endif
 
-CFLAGS   += -Werror -Wmissing-prototypes
-CFLAGS   += -I. -I./include $(CFLAGS_xeninclude)
-CFLAGS   += -D__XEN_TOOLS__
-CFLAGS   += -include $(XEN_ROOT)/tools/config.h
+CFLAGS += -D__XEN_TOOLS__
+CFLAGS += -include $(XEN_ROOT)/tools/config.h
+CFLAGS += -iquote ../../../xen/common/libelf
+
+# To be able to include xc_private.h
+CFLAGS += -iquote $(XEN_libxenctrl)
 
 # Needed for posix_fadvise64() in xc_linux.c
 CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE
@@ -92,8 +89,9 @@ ZLIB_CFLAGS :=
 ZLIB_LIBS :=
 endif
 
-xg_dom_bzimageloader.o: CFLAGS += $(ZLIB_CFLAGS)
-xg_dom_bzimageloader.opic: CFLAGS += $(ZLIB_CFLAGS)
+xg_dom_bzimageloader.o xg_dom_bzimageloader.opic: CFLAGS += $(ZLIB_CFLAGS)
+
+$(LIBELF_OBJS) $(LIBELF_OBJS:.o=.opic): CFLAGS += -Wno-pointer-sign
 
 LIBHEADER := xenguest.h
 
diff --git a/tools/libs/guest/xg_offline_page.c b/tools/libs/guest/xg_offline_page.c
index cfe0e2d537..c594fdba41 100644
--- a/tools/libs/guest/xg_offline_page.c
+++ b/tools/libs/guest/xg_offline_page.c
@@ -25,7 +25,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <sys/time.h>
-#include <xg_core.h>
+#include "xg_core.h"
 
 #include "xc_private.h"
 #include "xg_private.h"
-- 
Anthony PERARD



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

* [XEN PATCH 46/57] libs/store: use of -iquote instead of -I
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (44 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 45/57] libs/guest: rework CFLAGS Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-07 13:30   ` Juergen Gross
  2021-12-06 17:02 ` [XEN PATCH 47/57] libs/stat: Fix and rework python-bindings build Anthony PERARD
                   ` (10 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu, Juergen Gross

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libs/store/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/store/Makefile b/tools/libs/store/Makefile
index 6cc9baaabe..65092d8432 100644
--- a/tools/libs/store/Makefile
+++ b/tools/libs/store/Makefile
@@ -22,7 +22,7 @@ CFLAGS += -DXEN_LIB_STORED="\"$(XEN_LIB_STORED)\""
 CFLAGS += -DXEN_RUN_STORED="\"$(XEN_RUN_STORED)\""
 
 vpath xs_lib.c $(XEN_ROOT)/tools/xenstore
-CFLAGS += -I $(XEN_ROOT)/tools/xenstore
+CFLAGS += -iquote $(XEN_ROOT)/tools/xenstore
 
 xs.opic: CFLAGS += -DUSE_PTHREAD
 ifeq ($(CONFIG_Linux),y)
-- 
Anthony PERARD



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

* [XEN PATCH 47/57] libs/stat: Fix and rework python-bindings build
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (45 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 46/57] libs/store: use of -iquote instead of -I Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-07 14:45   ` Juergen Gross
  2021-12-16 18:47   ` Andrew Cooper
  2021-12-06 17:02 ` [XEN PATCH 48/57] libs/stat: Fix and rework perl-binding build Anthony PERARD
                   ` (9 subsequent siblings)
  56 siblings, 2 replies; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu, Juergen Gross

Fix the dependency on the library, $(SHLIB) variable doesn't exist
anymore.

Rework dependency on the include file, we can let `swig` generate the
dependency for us with the use of "-M*" flags.

The xenstat.h file has moved so we need to fix the include location.

Rather than relaying on the VCS to create an empty directory for us,
we can create one before generating the *.c file for the bindings.

Make use of generic variable names to build a shared library from a
source file: CFLAGS, LDFLAGS, and LDLIBS.

Fix python's specific *flags by using python-config, and add them to
generic flags variables: CFLAGS, LDLIBS.

To build a shared library, we need to build the source file with
"-fPIC", which was drop by 6d0ec05390 (tools: split libxenstat into
new tools/libs/stat directory).

The source file generated by swig seems to be missing a prototype for
the "init" function, so we need "-Wno-missing-prototypes" in order to
build it.

Add some targets to .PHONY.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libs/stat/Makefile                    | 27 +++++++++++++++------
 tools/libs/stat/bindings/swig/python/.empty |  1 -
 2 files changed, 19 insertions(+), 9 deletions(-)
 delete mode 100644 tools/libs/stat/bindings/swig/python/.empty

diff --git a/tools/libs/stat/Makefile b/tools/libs/stat/Makefile
index e39fe29bd1..d5d9cb3659 100644
--- a/tools/libs/stat/Makefile
+++ b/tools/libs/stat/Makefile
@@ -49,23 +49,34 @@ install-bindings: install-perl-bindings install-python-bindings
 .PHONY: uninstall-bindings
 uninstall-bindings: uninstall-perl-bindings uninstall-python-bindings
 
-$(BINDINGS): $(SHLIB) $(SHLIB_LINKS) include/xenstat.h
+$(BINDINGS): libxenstat.so
 
-SWIG_FLAGS=-module xenstat -Iinclude -I.
+SWIG_FLAGS = -module xenstat -I$(XEN_INCLUDE)
+SWIG_FLAGS += -MMD -MP -MF .$(if $(filter-out .,$(@D)),$(subst /,@,$(@D))@)$(@F).d
 
 # Python bindings
-PYTHON_VERSION=$(PYTHON:python%=%)
-PYTHON_FLAGS=-I/usr/include/python$(PYTHON_VERSION) -lpython$(PYTHON_VERSION)
 $(PYMOD): $(PYSRC)
 $(PYSRC): bindings/swig/xenstat.i
-	swig -python $(SWIG_FLAGS) -outdir $(@D) -o $(PYSRC) $<
-
+	mkdir -p $(@D)
+	swig -python $(SWIG_FLAGS) -outdir $(@D) -o $@ $<
+
+$(PYLIB): CFLAGS += $(shell $(PYTHON)-config --includes)
+$(PYLIB): CFLAGS += -fPIC
+$(PYLIB): CFLAGS += -Wno-missing-prototypes
+$(PYLIB): LDFLAGS += $(SHLIB_LDFLAGS)
+$(PYLIB): LDLIBS := $(shell $(PYTHON)-config --libs)
+$(PYLIB): LDLIBS += $(LDLIBS_libxenstat)
 $(PYLIB): $(PYSRC)
-	$(CC) $(CFLAGS) $(LDFLAGS) $(PYTHON_FLAGS) $(SHLIB_LDFLAGS) -lxenstat -o $@ $< $(APPEND_LDFLAGS)
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDLIBS) $(APPEND_LDFLAGS)
 
+.PHONY: python-bindings
 python-bindings: $(PYLIB) $(PYMOD)
 
-pythonlibdir=$(prefix)/lib/python$(PYTHON_VERSION)/site-packages
+pythonlibdir = $(shell $(PYTHON) -c \
+	       'import distutils.sysconfig as cfg; \
+	        print(cfg.get_python_lib(False, False, prefix="$(prefix)"))')
+
+.PHONY: install-python-bindings
 install-python-bindings: $(PYLIB) $(PYMOD)
 	$(INSTALL_PROG) $(PYLIB) $(DESTDIR)$(pythonlibdir)/_xenstat.so
 	$(INSTALL_PROG) $(PYMOD) $(DESTDIR)$(pythonlibdir)/xenstat.py
diff --git a/tools/libs/stat/bindings/swig/python/.empty b/tools/libs/stat/bindings/swig/python/.empty
deleted file mode 100644
index 2a8dd4274d..0000000000
--- a/tools/libs/stat/bindings/swig/python/.empty
+++ /dev/null
@@ -1 +0,0 @@
-This directory is empty; this file is included to prevent version control systems from removing the directory.
-- 
Anthony PERARD



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

* [XEN PATCH 48/57] libs/stat: Fix and rework perl-binding build
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (46 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 47/57] libs/stat: Fix and rework python-bindings build Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-07 14:46   ` Juergen Gross
  2021-12-06 17:02 ` [XEN PATCH 49/57] libs/toolcore: don't install xentoolcore_internal.h anymore Anthony PERARD
                   ` (8 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu, Juergen Gross

For PERL_FLAGS, use make's shell rather than a backquote.

Rather than relying on the VCS to create an empty directory for us,
we can create one before generating the *.c file for the bindings.

Make use of generic variable names to build a shared library from a
source file: CFLAGS, LDFLAGS, and LDLIBS.

To build a shared library, we need to build the source file with
"-fPIC", which was drop by 6d0ec05390 (tools: split libxenstat into
new tools/libs/stat directory).

The source file generated by swig seems to be missing many prototype for
many functions, so we need "-Wno-missing-prototypes" in order to
build it. Also, one of the prototype is deemed malformed, so we also
need "-Wno-strict-prototypes".

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libs/stat/Makefile                  | 15 +++++++++++----
 tools/libs/stat/bindings/swig/perl/.empty |  1 -
 2 files changed, 11 insertions(+), 5 deletions(-)
 delete mode 100644 tools/libs/stat/bindings/swig/perl/.empty

diff --git a/tools/libs/stat/Makefile b/tools/libs/stat/Makefile
index d5d9cb3659..962f02090b 100644
--- a/tools/libs/stat/Makefile
+++ b/tools/libs/stat/Makefile
@@ -94,13 +94,20 @@ uninstall: uninstall-python-bindings
 endif
 
 # Perl bindings
-PERL_FLAGS=`perl -MConfig -e 'print "$$Config{ccflags} -I$$Config{archlib}/CORE";'`
+PERL_FLAGS = $(shell $(PERL) -MConfig -e 'print "$$Config{ccflags} -I$$Config{archlib}/CORE";')
 $(PERLMOD): $(PERLSRC)
 $(PERLSRC): bindings/swig/xenstat.i
-	swig -perl $(SWIG_FLAGS) -outdir $(@D) -o $(PERLSRC) $<
-
+	mkdir -p $(@D)
+	swig -perl $(SWIG_FLAGS) -outdir $(@D) -o $@ $<
+
+$(PERLLIB): CFLAGS += -fPIC
+$(PERLLIB): CFLAGS += -Wno-strict-prototypes
+$(PERLLIB): CFLAGS += -Wno-missing-prototypes
+$(PERLLIB): LDFLAGS += $(PERL_FLAGS)
+$(PERLLIB): LDFLAGS += $(SHLIB_LDFLAGS)
+$(PERLLIB): LDLIBS := $(LDLIBS_libxenstat)
 $(PERLLIB): $(PERLSRC)
-	$(CC) $(CFLAGS) $(LDFLAGS) $(PERL_FLAGS) $(SHLIB_LDFLAGS) -lxenstat -o $@ $< $(APPEND_LDFLAGS)
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDLIBS) $(APPEND_LDFLAGS)
 
 .PHONY: perl-bindings
 perl-bindings: $(PERLLIB) $(PERLMOD)
diff --git a/tools/libs/stat/bindings/swig/perl/.empty b/tools/libs/stat/bindings/swig/perl/.empty
deleted file mode 100644
index 2a8dd4274d..0000000000
--- a/tools/libs/stat/bindings/swig/perl/.empty
+++ /dev/null
@@ -1 +0,0 @@
-This directory is empty; this file is included to prevent version control systems from removing the directory.
-- 
Anthony PERARD



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

* [XEN PATCH 49/57] libs/toolcore: don't install xentoolcore_internal.h anymore
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (47 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 48/57] libs/stat: Fix and rework perl-binding build Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-07 14:47   ` Juergen Gross
  2021-12-06 17:02 ` [XEN PATCH 50/57] tools/Rules.mk: Cleanup %.pc rules Anthony PERARD
                   ` (7 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu, Juergen Gross

With "xentoolcore_internal.h" been in LIBHEADER, it was installed. But
its dependency "_xentoolcore_list.h" wasn't installed so the header
couldn't be used anyway.

This patch also mean that the rule "headers.chk" doesn't check it
anymore as well.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libs/toolcore/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/toolcore/Makefile b/tools/libs/toolcore/Makefile
index 632048c899..360a10e5da 100644
--- a/tools/libs/toolcore/Makefile
+++ b/tools/libs/toolcore/Makefile
@@ -5,7 +5,7 @@ MAJOR	= 1
 MINOR	= 0
 AUTOINCS := $(XEN_INCLUDE)/_xentoolcore_list.h
 
-LIBHEADER := xentoolcore.h xentoolcore_internal.h
+LIBHEADER := xentoolcore.h
 
 OBJS-y	+= handlereg.o
 
-- 
Anthony PERARD



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

* [XEN PATCH 50/57] tools/Rules.mk: Cleanup %.pc rules
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (48 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 49/57] libs/toolcore: don't install xentoolcore_internal.h anymore Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-16 18:51   ` Andrew Cooper
  2021-12-06 17:02 ` [XEN PATCH 51/57] .gitignore: Cleanup ignores of tools/libs/*/{headers.chk,*.pc} Anthony PERARD
                   ` (6 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel; +Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu

PKG_CONFIG_VARS isn't used anymore.
For "local" pkg-config file, we only have one headers directory now,
"tools/include", so there is no need to specify it twice. So remove
$(CFLAGS_xeninclude) from "Cflags:".

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/Rules.mk | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/tools/Rules.mk b/tools/Rules.mk
index 0d3febfbb6..47424935ba 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -184,12 +184,11 @@ $(PKG_CONFIG_DIR)/%.pc: Makefile $(XEN_ROOT)/tools/Rules.mk $(PKG_CONFIG_DIR)
 	echo "prefix=$(PKG_CONFIG_PREFIX)"; \
 	echo "includedir=$(PKG_CONFIG_INCDIR)"; \
 	echo "libdir=$(PKG_CONFIG_LIBDIR)"; \
-	$(foreach var,$(PKG_CONFIG_VARS),echo $(var);) \
 	echo ""; \
 	echo "Name: $(PKG_CONFIG_NAME)"; \
 	echo "Description: $(PKG_CONFIG_DESC)"; \
 	echo "Version: $(PKG_CONFIG_VERSION)"; \
-	echo "Cflags: -I\$${includedir} $(CFLAGS_xeninclude)"; \
+	echo "Cflags: -I\$${includedir}"; \
 	echo "Libs: -L\$${libdir} $(PKG_CONFIG_USELIBS) -l$(PKG_CONFIG_LIB)"; \
 	echo "Libs.private: $(PKG_CONFIG_LIBSPRIV)"; \
 	echo "Requires.private: $(PKG_CONFIG_REQPRIV)"; \
@@ -200,7 +199,6 @@ $(PKG_CONFIG_DIR)/%.pc: Makefile $(XEN_ROOT)/tools/Rules.mk $(PKG_CONFIG_DIR)
 	echo "prefix=$(PKG_CONFIG_PREFIX)"; \
 	echo "includedir=$(PKG_CONFIG_INCDIR)"; \
 	echo "libdir=$(PKG_CONFIG_LIBDIR)"; \
-	$(foreach var,$(PKG_CONFIG_VARS),echo $(var);) \
 	echo ""; \
 	echo "Name: $(PKG_CONFIG_NAME)"; \
 	echo "Description: $(PKG_CONFIG_DESC)"; \
-- 
Anthony PERARD



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

* [XEN PATCH 51/57] .gitignore: Cleanup ignores of tools/libs/*/{headers.chk,*.pc}
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (49 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 50/57] tools/Rules.mk: Cleanup %.pc rules Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-06 17:02 ` [XEN PATCH 52/57] stubdom: only build libxen*.a from tools/libs/ Anthony PERARD
                   ` (5 subsequent siblings)
  56 siblings, 0 replies; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Andrew Cooper, George Dunlap,
	Ian Jackson, Jan Beulich, Julien Grall, Stefano Stabellini,
	Wei Liu

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 .gitignore | 28 ++--------------------------
 1 file changed, 2 insertions(+), 26 deletions(-)

diff --git a/.gitignore b/.gitignore
index 8fb74a4c94..d494d1125a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -105,26 +105,10 @@ tools/config.cache
 config/Tools.mk
 config/Stubdom.mk
 config/Docs.mk
-tools/libs/toolcore/headers.chk
-tools/libs/toolcore/xentoolcore.pc
-tools/libs/toollog/headers.chk
-tools/libs/toollog/xentoollog.pc
-tools/libs/evtchn/headers.chk
-tools/libs/evtchn/xenevtchn.pc
-tools/libs/gnttab/headers.chk
-tools/libs/gnttab/xengnttab.pc
-tools/libs/hypfs/headers.chk
-tools/libs/hypfs/xenhypfs.pc
-tools/libs/call/headers.chk
-tools/libs/call/xencall.pc
+tools/libs/*/headers.chk
+tools/libs/*/*.pc
 tools/libs/ctrl/libxenctrl.map
-tools/libs/ctrl/xencontrol.pc
-tools/libs/foreignmemory/headers.chk
-tools/libs/foreignmemory/xenforeignmemory.pc
-tools/libs/devicemodel/headers.chk
-tools/libs/devicemodel/xendevicemodel.pc
 tools/libs/guest/libxenguest.map
-tools/libs/guest/xenguest.pc
 tools/libs/guest/xc_bitops.h
 tools/libs/guest/xc_core.h
 tools/libs/guest/xc_core_arm.h
@@ -144,21 +128,13 @@ tools/libs/light/testidl.c
 tools/libs/light/test_timedereg
 tools/libs/light/test_fdderegrace
 tools/libs/light/tmp.*
-tools/libs/light/xenlight.pc
-tools/libs/stat/headers.chk
 tools/libs/stat/libxenstat.map
-tools/libs/stat/xenstat.pc
-tools/libs/store/headers.chk
 tools/libs/store/list.h
 tools/libs/store/utils.h
-tools/libs/store/xenstore.pc
 tools/libs/store/xs_lib.c
-tools/libs/util/*.pc
 tools/libs/util/libxlu_cfg_y.output
 tools/libs/util/libxenutil.map
-tools/libs/vchan/headers.chk
 tools/libs/vchan/libxenvchan.map
-tools/libs/vchan/xenvchan.pc
 tools/console/client/xenconsole
 tools/console/daemon/xenconsoled
 tools/debugger/gdb/gdb-6.2.1-linux-i386-xen/*
-- 
Anthony PERARD



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

* [XEN PATCH 52/57] stubdom: only build libxen*.a from tools/libs/
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (50 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 51/57] .gitignore: Cleanup ignores of tools/libs/*/{headers.chk,*.pc} Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-11 23:47   ` Samuel Thibault
  2021-12-06 17:02 ` [XEN PATCH 53/57] stubdom: introduce xenlibs.mk Anthony PERARD
                   ` (4 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu, Samuel Thibault

Avoid generating *.map files or running headers.chk when all we need
is the libxen*.a.

Also, allow force make to check again if libxen*.a needs rebuilt by
adding a '.PHONY' prerequisite.

Also, remove DESTDIR= as we don't do installation in this target, so
the value of DESTDIR doesn't matter.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 stubdom/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index ccfcf5b75f..5fb5dbc341 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -354,8 +354,8 @@ define BUILD_lib
  .PHONY: libxen$(1) clean-libxen$(1)
  libxen$(1): libs-$$(XEN_TARGET_ARCH)/$(1)/libxen$(1).a
  libs-$$(XEN_TARGET_ARCH)/$(1)/libxen$(1).a: $$(LIBDEPS_$(1)) $$(LIBDEP_$(1))
- libs-$$(XEN_TARGET_ARCH)/$(1)/libxen$(1).a: mk-headers-$$(XEN_TARGET_ARCH) $$(NEWLIB_STAMPFILE)
-	CPPFLAGS="$$(TARGET_CPPFLAGS)" CFLAGS="$$(TARGET_CFLAGS)" $$(MAKE) DESTDIR= CONFIG_LIBXC_MINIOS=y -C libs-$$(XEN_TARGET_ARCH)/$(1)
+ libs-$$(XEN_TARGET_ARCH)/$(1)/libxen$(1).a: mk-headers-$$(XEN_TARGET_ARCH) $$(NEWLIB_STAMPFILE) .phony
+	CPPFLAGS="$$(TARGET_CPPFLAGS)" CFLAGS="$$(TARGET_CFLAGS)" $$(MAKE) CONFIG_LIBXC_MINIOS=y -C $$(@D) $$(@F)
 
  clean-libxen$(1):
 	[ ! -e libs-$$(XEN_TARGET_ARCH)/$(1)/Makefile ] || $$(MAKE) DESTDIR= -C libs-$$(XEN_TARGET_ARCH)/$(1) clean
-- 
Anthony PERARD



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

* [XEN PATCH 53/57] stubdom: introduce xenlibs.mk
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (51 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 52/57] stubdom: only build libxen*.a from tools/libs/ Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-11 23:49   ` Samuel Thibault
  2021-12-06 17:02 ` [XEN PATCH 54/57] tools/libs: create Makefile.common to be used by stubdom build system Anthony PERARD
                   ` (3 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu, Samuel Thibault

This new makefile will be used to build libraries that provides
"Makefile.common".

At some point, we will be converting Makefile in tools/ to "subdirmk"
and stubdom build will not be able to use those new makefiles, so we
will put the necessary information for stubdom to build the xen
libraries into a new Makefile.common and xenlibs.mk will use it.
We only need to build static libraries and don't need anything else.

The check for the presence of "Makefile.common" will go aways once
there is one for all libraries used by stubdom build.

Also remove DESTDIR= from "clean" targets, we don't do installation in
this recipe so the value of DESTDIR doesn't matter.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 stubdom/xenlibs.mk | 13 +++++++++++++
 stubdom/Makefile   |  9 +++++++--
 2 files changed, 20 insertions(+), 2 deletions(-)
 create mode 100644 stubdom/xenlibs.mk

diff --git a/stubdom/xenlibs.mk b/stubdom/xenlibs.mk
new file mode 100644
index 0000000000..5c8742ccf9
--- /dev/null
+++ b/stubdom/xenlibs.mk
@@ -0,0 +1,13 @@
+include $(XEN_ROOT)/tools/Rules.mk
+
+include Makefile.common
+
+LIBNAME := $(notdir $(CURDIR))
+FILENAME_$(LIBNAME) ?= xen$(LIBNAME)
+LIB_FILE_NAME = $(FILENAME_$(LIBNAME))
+
+lib$(LIB_FILE_NAME).a: $(OBJS-y)
+	$(AR) rc $@ $^
+
+clean::
+	rm -f $(OBJS-y) lib$(LIB_FILE_NAME).a
diff --git a/stubdom/Makefile b/stubdom/Makefile
index 5fb5dbc341..fba4c977ef 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -346,6 +346,7 @@ define do_links
   cd $(dir $@); \
   ln -sf $(dir $<)include/*.h include/; \
   ln -sf $(dir $<)*.[ch] .; \
+  [ -e $(dir $<)Makefile.common ] && ln -sf $(dir $<)Makefile.common . ||:; \
   ln -sf $(dir $<)Makefile .
   touch $@
 endef
@@ -355,10 +356,14 @@ define BUILD_lib
  libxen$(1): libs-$$(XEN_TARGET_ARCH)/$(1)/libxen$(1).a
  libs-$$(XEN_TARGET_ARCH)/$(1)/libxen$(1).a: $$(LIBDEPS_$(1)) $$(LIBDEP_$(1))
  libs-$$(XEN_TARGET_ARCH)/$(1)/libxen$(1).a: mk-headers-$$(XEN_TARGET_ARCH) $$(NEWLIB_STAMPFILE) .phony
-	CPPFLAGS="$$(TARGET_CPPFLAGS)" CFLAGS="$$(TARGET_CFLAGS)" $$(MAKE) CONFIG_LIBXC_MINIOS=y -C $$(@D) $$(@F)
+	CPPFLAGS="$$(TARGET_CPPFLAGS)" CFLAGS="$$(TARGET_CFLAGS)" $$(MAKE) CONFIG_LIBXC_MINIOS=y $$(if $$(wildcard $$(@D)/Makefile.common),-f $(CURDIR)/xenlibs.mk) -C $$(@D) $$(@F)
 
  clean-libxen$(1):
-	[ ! -e libs-$$(XEN_TARGET_ARCH)/$(1)/Makefile ] || $$(MAKE) DESTDIR= -C libs-$$(XEN_TARGET_ARCH)/$(1) clean
+	if [ -e libs-$$(XEN_TARGET_ARCH)/$(1)/Makefile.common ]; then \
+	    $$(MAKE) -f $(CURDIR)/xenlibs.mk -C libs-$$(XEN_TARGET_ARCH)/$(1) clean; \
+	elif [ -e libs-$$(XEN_TARGET_ARCH)/$(1)/Makefile ]; then \
+	    $$(MAKE) -C libs-$$(XEN_TARGET_ARCH)/$(1) clean; \
+	fi
 
  libs-$$(XEN_TARGET_ARCH)/$(1)/stamp: $$(XEN_ROOT)/tools/libs/$(1)/Makefile
 	$$(do_links)
-- 
Anthony PERARD



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

* [XEN PATCH 54/57] tools/libs: create Makefile.common to be used by stubdom build system
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (52 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 53/57] stubdom: introduce xenlibs.mk Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-07 14:57   ` Juergen Gross
  2021-12-06 17:02 ` [XEN PATCH 55/57] tools/xenstore: introduce Makefile.common to be used by stubdom Anthony PERARD
                   ` (2 subsequent siblings)
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu,
	Samuel Thibault, Juergen Gross

This new "Makefile.common" is intended to be used by both tools/ and
stubdom/ build system without stubdom needed to use tools/ build
system.

It should contain the necessary list of objects and CFLAGS needed to
build a static library.

Change stubdom/ to check Makefile.common, for the linkfarm.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 stubdom/Makefile                         |  2 +-
 tools/libs/call/Makefile                 |  7 +-
 tools/libs/call/Makefile.common          |  6 ++
 tools/libs/ctrl/Makefile                 | 45 +-----------
 tools/libs/ctrl/Makefile.common          | 44 ++++++++++++
 tools/libs/devicemodel/Makefile          |  7 +-
 tools/libs/devicemodel/Makefile.common   |  6 ++
 tools/libs/evtchn/Makefile               |  7 +-
 tools/libs/evtchn/Makefile.common        |  6 ++
 tools/libs/foreignmemory/Makefile        |  7 +-
 tools/libs/foreignmemory/Makefile.common |  6 ++
 tools/libs/gnttab/Makefile               |  9 +--
 tools/libs/gnttab/Makefile.common        |  8 +++
 tools/libs/guest/Makefile                | 90 +-----------------------
 tools/libs/guest/Makefile.common         | 84 ++++++++++++++++++++++
 tools/libs/toolcore/Makefile             |  8 +--
 tools/libs/toolcore/Makefile.common      |  9 +++
 tools/libs/toollog/Makefile              |  3 +-
 tools/libs/toollog/Makefile.common       |  2 +
 19 files changed, 182 insertions(+), 174 deletions(-)
 create mode 100644 tools/libs/call/Makefile.common
 create mode 100644 tools/libs/ctrl/Makefile.common
 create mode 100644 tools/libs/devicemodel/Makefile.common
 create mode 100644 tools/libs/evtchn/Makefile.common
 create mode 100644 tools/libs/foreignmemory/Makefile.common
 create mode 100644 tools/libs/gnttab/Makefile.common
 create mode 100644 tools/libs/guest/Makefile.common
 create mode 100644 tools/libs/toolcore/Makefile.common
 create mode 100644 tools/libs/toollog/Makefile.common

diff --git a/stubdom/Makefile b/stubdom/Makefile
index fba4c977ef..fbc63a5063 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -365,7 +365,7 @@ define BUILD_lib
 	    $$(MAKE) -C libs-$$(XEN_TARGET_ARCH)/$(1) clean; \
 	fi
 
- libs-$$(XEN_TARGET_ARCH)/$(1)/stamp: $$(XEN_ROOT)/tools/libs/$(1)/Makefile
+ libs-$$(XEN_TARGET_ARCH)/$(1)/stamp: $$(XEN_ROOT)/tools/libs/$(1)/Makefile.common
 	$$(do_links)
 endef
 
diff --git a/tools/libs/call/Makefile b/tools/libs/call/Makefile
index e5cb7c937c..103f5ad360 100644
--- a/tools/libs/call/Makefile
+++ b/tools/libs/call/Makefile
@@ -4,11 +4,6 @@ include $(XEN_ROOT)/tools/Rules.mk
 MAJOR    = 1
 MINOR    = 3
 
-OBJS-y                 += core.o buffer.o
-OBJS-$(CONFIG_Linux)   += linux.o
-OBJS-$(CONFIG_FreeBSD) += freebsd.o
-OBJS-$(CONFIG_SunOS)   += solaris.o
-OBJS-$(CONFIG_NetBSD)  += netbsd.o
-OBJS-$(CONFIG_MiniOS)  += minios.o
+include Makefile.common
 
 include $(XEN_ROOT)/tools/libs/libs.mk
diff --git a/tools/libs/call/Makefile.common b/tools/libs/call/Makefile.common
new file mode 100644
index 0000000000..85e608f8ad
--- /dev/null
+++ b/tools/libs/call/Makefile.common
@@ -0,0 +1,6 @@
+OBJS-y                 += core.o buffer.o
+OBJS-$(CONFIG_Linux)   += linux.o
+OBJS-$(CONFIG_FreeBSD) += freebsd.o
+OBJS-$(CONFIG_SunOS)   += solaris.o
+OBJS-$(CONFIG_NetBSD)  += netbsd.o
+OBJS-$(CONFIG_MiniOS)  += minios.o
diff --git a/tools/libs/ctrl/Makefile b/tools/libs/ctrl/Makefile
index df145ba8ec..7bcac0d4b6 100644
--- a/tools/libs/ctrl/Makefile
+++ b/tools/libs/ctrl/Makefile
@@ -1,50 +1,7 @@
 XEN_ROOT = $(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-OBJS-y       += xc_altp2m.o
-OBJS-y       += xc_cpupool.o
-OBJS-y       += xc_domain.o
-OBJS-y       += xc_evtchn.o
-OBJS-y       += xc_gnttab.o
-OBJS-y       += xc_misc.o
-OBJS-y       += xc_flask.o
-OBJS-y       += xc_physdev.o
-OBJS-y       += xc_private.o
-OBJS-y       += xc_csched.o
-OBJS-y       += xc_csched2.o
-OBJS-y       += xc_arinc653.o
-OBJS-y       += xc_rt.o
-OBJS-y       += xc_tbuf.o
-OBJS-y       += xc_pm.o
-OBJS-y       += xc_cpu_hotplug.o
-OBJS-y       += xc_vm_event.o
-OBJS-y       += xc_vmtrace.o
-OBJS-y       += xc_monitor.o
-OBJS-y       += xc_mem_paging.o
-OBJS-y       += xc_mem_access.o
-OBJS-y       += xc_memshr.o
-OBJS-y       += xc_hcall_buf.o
-OBJS-y       += xc_foreign_memory.o
-OBJS-y       += xc_kexec.o
-OBJS-y       += xc_resource.o
-OBJS-$(CONFIG_X86) += xc_psr.o
-OBJS-$(CONFIG_X86) += xc_pagetab.o
-OBJS-$(CONFIG_Linux) += xc_linux.o
-OBJS-$(CONFIG_FreeBSD) += xc_freebsd.o
-OBJS-$(CONFIG_SunOS) += xc_solaris.o
-OBJS-$(CONFIG_NetBSD) += xc_netbsd.o
-OBJS-$(CONFIG_NetBSDRump) += xc_netbsd.o
-OBJS-$(CONFIG_MiniOS) += xc_minios.o
-OBJS-y       += xc_evtchn_compat.o
-OBJS-y       += xc_gnttab_compat.o
-OBJS-y       += xc_devicemodel_compat.o
-
-CFLAGS   += -D__XEN_TOOLS__
-CFLAGS	+= $(PTHREAD_CFLAGS)
-CFLAGS += -include $(XEN_ROOT)/tools/config.h
-
-# Needed for posix_fadvise64() in xc_linux.c
-CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE
+include Makefile.common
 
 LIBHEADER := xenctrl.h xenctrl_compat.h
 PKG_CONFIG := xencontrol.pc
diff --git a/tools/libs/ctrl/Makefile.common b/tools/libs/ctrl/Makefile.common
new file mode 100644
index 0000000000..0a09c28fd3
--- /dev/null
+++ b/tools/libs/ctrl/Makefile.common
@@ -0,0 +1,44 @@
+OBJS-y       += xc_altp2m.o
+OBJS-y       += xc_cpupool.o
+OBJS-y       += xc_domain.o
+OBJS-y       += xc_evtchn.o
+OBJS-y       += xc_gnttab.o
+OBJS-y       += xc_misc.o
+OBJS-y       += xc_flask.o
+OBJS-y       += xc_physdev.o
+OBJS-y       += xc_private.o
+OBJS-y       += xc_csched.o
+OBJS-y       += xc_csched2.o
+OBJS-y       += xc_arinc653.o
+OBJS-y       += xc_rt.o
+OBJS-y       += xc_tbuf.o
+OBJS-y       += xc_pm.o
+OBJS-y       += xc_cpu_hotplug.o
+OBJS-y       += xc_vm_event.o
+OBJS-y       += xc_vmtrace.o
+OBJS-y       += xc_monitor.o
+OBJS-y       += xc_mem_paging.o
+OBJS-y       += xc_mem_access.o
+OBJS-y       += xc_memshr.o
+OBJS-y       += xc_hcall_buf.o
+OBJS-y       += xc_foreign_memory.o
+OBJS-y       += xc_kexec.o
+OBJS-y       += xc_resource.o
+OBJS-$(CONFIG_X86) += xc_psr.o
+OBJS-$(CONFIG_X86) += xc_pagetab.o
+OBJS-$(CONFIG_Linux) += xc_linux.o
+OBJS-$(CONFIG_FreeBSD) += xc_freebsd.o
+OBJS-$(CONFIG_SunOS) += xc_solaris.o
+OBJS-$(CONFIG_NetBSD) += xc_netbsd.o
+OBJS-$(CONFIG_NetBSDRump) += xc_netbsd.o
+OBJS-$(CONFIG_MiniOS) += xc_minios.o
+OBJS-y       += xc_evtchn_compat.o
+OBJS-y       += xc_gnttab_compat.o
+OBJS-y       += xc_devicemodel_compat.o
+
+CFLAGS   += -D__XEN_TOOLS__
+CFLAGS	+= $(PTHREAD_CFLAGS)
+CFLAGS += -include $(XEN_ROOT)/tools/config.h
+
+# Needed for posix_fadvise64() in xc_linux.c
+CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE
diff --git a/tools/libs/devicemodel/Makefile b/tools/libs/devicemodel/Makefile
index a0a2d24f99..b70dd774e4 100644
--- a/tools/libs/devicemodel/Makefile
+++ b/tools/libs/devicemodel/Makefile
@@ -4,11 +4,6 @@ include $(XEN_ROOT)/tools/Rules.mk
 MAJOR    = 1
 MINOR    = 4
 
-OBJS-y                 += core.o
-OBJS-$(CONFIG_Linux)   += common.o
-OBJS-$(CONFIG_FreeBSD) += common.o
-OBJS-$(CONFIG_SunOS)   += compat.o
-OBJS-$(CONFIG_NetBSD)  += compat.o
-OBJS-$(CONFIG_MiniOS)  += compat.o
+include Makefile.common
 
 include $(XEN_ROOT)/tools/libs/libs.mk
diff --git a/tools/libs/devicemodel/Makefile.common b/tools/libs/devicemodel/Makefile.common
new file mode 100644
index 0000000000..a7bf7c35bb
--- /dev/null
+++ b/tools/libs/devicemodel/Makefile.common
@@ -0,0 +1,6 @@
+OBJS-y                 += core.o
+OBJS-$(CONFIG_Linux)   += common.o
+OBJS-$(CONFIG_FreeBSD) += common.o
+OBJS-$(CONFIG_SunOS)   += compat.o
+OBJS-$(CONFIG_NetBSD)  += compat.o
+OBJS-$(CONFIG_MiniOS)  += compat.o
diff --git a/tools/libs/evtchn/Makefile b/tools/libs/evtchn/Makefile
index 8208ecf650..3dad3840c6 100644
--- a/tools/libs/evtchn/Makefile
+++ b/tools/libs/evtchn/Makefile
@@ -4,11 +4,6 @@ include $(XEN_ROOT)/tools/Rules.mk
 MAJOR    = 1
 MINOR    = 2
 
-OBJS-y                 += core.o
-OBJS-$(CONFIG_Linux)   += linux.o
-OBJS-$(CONFIG_FreeBSD) += freebsd.o
-OBJS-$(CONFIG_SunOS)   += solaris.o
-OBJS-$(CONFIG_NetBSD)  += netbsd.o
-OBJS-$(CONFIG_MiniOS)  += minios.o
+include Makefile.common
 
 include $(XEN_ROOT)/tools/libs/libs.mk
diff --git a/tools/libs/evtchn/Makefile.common b/tools/libs/evtchn/Makefile.common
new file mode 100644
index 0000000000..20629f521a
--- /dev/null
+++ b/tools/libs/evtchn/Makefile.common
@@ -0,0 +1,6 @@
+OBJS-y                 += core.o
+OBJS-$(CONFIG_Linux)   += linux.o
+OBJS-$(CONFIG_FreeBSD) += freebsd.o
+OBJS-$(CONFIG_SunOS)   += solaris.o
+OBJS-$(CONFIG_NetBSD)  += netbsd.o
+OBJS-$(CONFIG_MiniOS)  += minios.o
diff --git a/tools/libs/foreignmemory/Makefile b/tools/libs/foreignmemory/Makefile
index 4427435932..b70dd774e4 100644
--- a/tools/libs/foreignmemory/Makefile
+++ b/tools/libs/foreignmemory/Makefile
@@ -4,11 +4,6 @@ include $(XEN_ROOT)/tools/Rules.mk
 MAJOR    = 1
 MINOR    = 4
 
-OBJS-y                 += core.o
-OBJS-$(CONFIG_Linux)   += linux.o
-OBJS-$(CONFIG_FreeBSD) += freebsd.o
-OBJS-$(CONFIG_SunOS)   += compat.o solaris.o
-OBJS-$(CONFIG_NetBSD)  += netbsd.o
-OBJS-$(CONFIG_MiniOS)  += minios.o
+include Makefile.common
 
 include $(XEN_ROOT)/tools/libs/libs.mk
diff --git a/tools/libs/foreignmemory/Makefile.common b/tools/libs/foreignmemory/Makefile.common
new file mode 100644
index 0000000000..ff3b1d4f3e
--- /dev/null
+++ b/tools/libs/foreignmemory/Makefile.common
@@ -0,0 +1,6 @@
+OBJS-y                 += core.o
+OBJS-$(CONFIG_Linux)   += linux.o
+OBJS-$(CONFIG_FreeBSD) += freebsd.o
+OBJS-$(CONFIG_SunOS)   += compat.o solaris.o
+OBJS-$(CONFIG_NetBSD)  += netbsd.o
+OBJS-$(CONFIG_MiniOS)  += minios.o
diff --git a/tools/libs/gnttab/Makefile b/tools/libs/gnttab/Makefile
index 7d7aeeadff..3dad3840c6 100644
--- a/tools/libs/gnttab/Makefile
+++ b/tools/libs/gnttab/Makefile
@@ -4,13 +4,6 @@ include $(XEN_ROOT)/tools/Rules.mk
 MAJOR    = 1
 MINOR    = 2
 
-OBJS-GNTTAB            += gnttab_core.o
-OBJS-GNTSHR            += gntshr_core.o
-
-OBJS-$(CONFIG_Linux)   += $(OBJS-GNTTAB) $(OBJS-GNTSHR) linux.o
-OBJS-$(CONFIG_MiniOS)  += $(OBJS-GNTTAB) gntshr_unimp.o minios.o
-OBJS-$(CONFIG_FreeBSD) += $(OBJS-GNTTAB) $(OBJS-GNTSHR) freebsd.o
-OBJS-$(CONFIG_NetBSD)  += $(OBJS-GNTTAB) $(OBJS-GNTSHR) netbsd.o
-OBJS-$(CONFIG_SunOS)   += gnttab_unimp.o gntshr_unimp.o
+include Makefile.common
 
 include $(XEN_ROOT)/tools/libs/libs.mk
diff --git a/tools/libs/gnttab/Makefile.common b/tools/libs/gnttab/Makefile.common
new file mode 100644
index 0000000000..759e36e1cb
--- /dev/null
+++ b/tools/libs/gnttab/Makefile.common
@@ -0,0 +1,8 @@
+OBJS-GNTTAB            += gnttab_core.o
+OBJS-GNTSHR            += gntshr_core.o
+
+OBJS-$(CONFIG_Linux)   += $(OBJS-GNTTAB) $(OBJS-GNTSHR) linux.o
+OBJS-$(CONFIG_MiniOS)  += $(OBJS-GNTTAB) gntshr_unimp.o minios.o
+OBJS-$(CONFIG_FreeBSD) += $(OBJS-GNTTAB) $(OBJS-GNTSHR) freebsd.o
+OBJS-$(CONFIG_NetBSD)  += $(OBJS-GNTTAB) $(OBJS-GNTSHR) netbsd.o
+OBJS-$(CONFIG_SunOS)   += gnttab_unimp.o gntshr_unimp.o
diff --git a/tools/libs/guest/Makefile b/tools/libs/guest/Makefile
index 62b8fead86..86b2b59650 100644
--- a/tools/libs/guest/Makefile
+++ b/tools/libs/guest/Makefile
@@ -1,97 +1,11 @@
 XEN_ROOT = $(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-ifeq ($(CONFIG_LIBXC_MINIOS),y)
-# Save/restore of a domain is currently incompatible with a stubdom environment
-override CONFIG_MIGRATE := n
-endif
-
-OBJS-y += xg_private.o
-OBJS-y += xg_domain.o
-OBJS-y += xg_suspend.o
-OBJS-y += xg_resume.o
-ifeq ($(CONFIG_MIGRATE),y)
-OBJS-y += xg_sr_common.o
-OBJS-$(CONFIG_X86) += xg_sr_common_x86.o
-OBJS-$(CONFIG_X86) += xg_sr_common_x86_pv.o
-OBJS-$(CONFIG_X86) += xg_sr_restore_x86_pv.o
-OBJS-$(CONFIG_X86) += xg_sr_restore_x86_hvm.o
-OBJS-$(CONFIG_X86) += xg_sr_save_x86_pv.o
-OBJS-$(CONFIG_X86) += xg_sr_save_x86_hvm.o
-OBJS-y += xg_sr_restore.o
-OBJS-y += xg_sr_save.o
-OBJS-y += xg_offline_page.o
-else
-OBJS-y += xg_nomigrate.o
-endif
-OBJS-y       += xg_core.o
-OBJS-$(CONFIG_X86) += xg_core_x86.o
-OBJS-$(CONFIG_ARM) += xg_core_arm.o
-
-vpath %.c ../../../xen/common/libelf
-
-LIBELF_OBJS += libelf-tools.o libelf-loader.o
-LIBELF_OBJS += libelf-dominfo.o
-
-OBJS-y += $(LIBELF_OBJS)
-
-ifeq ($(CONFIG_X86),y) # Add libx86 to the build
-vpath %.c ../../../xen/lib/x86
-
-OBJS-y                 += cpuid.o msr.o policy.o
-endif
-
-# new domain builder
-OBJS-y                 += xg_dom_core.o
-OBJS-y                 += xg_dom_boot.o
-OBJS-y                 += xg_dom_elfloader.o
-OBJS-$(CONFIG_X86)     += xg_dom_bzimageloader.o
-OBJS-$(CONFIG_X86)     += xg_dom_decompress_lz4.o
-OBJS-$(CONFIG_X86)     += xg_dom_hvmloader.o
-OBJS-$(CONFIG_ARM)     += xg_dom_armzimageloader.o
-OBJS-y                 += xg_dom_binloader.o
-OBJS-y                 += xg_dom_compat_linux.o
-
-OBJS-$(CONFIG_X86)     += xg_dom_x86.o
-OBJS-$(CONFIG_X86)     += xg_cpuid_x86.o
-OBJS-$(CONFIG_ARM)     += xg_dom_arm.o
-
-ifeq ($(CONFIG_LIBXC_MINIOS),y)
-OBJS-y                 += xg_dom_decompress_unsafe.o
-OBJS-y                 += xg_dom_decompress_unsafe_bzip2.o
-OBJS-y                 += xg_dom_decompress_unsafe_lzma.o
-OBJS-y                 += xg_dom_decompress_unsafe_lzo1x.o
-OBJS-y                 += xg_dom_decompress_unsafe_xz.o
-OBJS-y                 += xg_dom_decompress_unsafe_zstd.o
-endif
-
-CFLAGS += -D__XEN_TOOLS__
-CFLAGS += -include $(XEN_ROOT)/tools/config.h
-CFLAGS += -iquote ../../../xen/common/libelf
-
-# To be able to include xc_private.h
-CFLAGS += -iquote $(XEN_libxenctrl)
-
-# Needed for posix_fadvise64() in xc_linux.c
-CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE
-
-CFLAGS	+= $(PTHREAD_CFLAGS)
-CFLAGS	+= $(CFLAGS_libxentoollog)
-CFLAGS	+= $(CFLAGS_libxenevtchn)
-CFLAGS	+= $(CFLAGS_libxendevicemodel)
-
-# libxenguest includes xc_private.h, so needs this despite not using
-# this functionality directly.
-CFLAGS += $(CFLAGS_libxencall) $(CFLAGS_libxenforeignmemory)
-
-ifeq ($(CONFIG_MiniOS),y)
-ZLIB_CFLAGS :=
-ZLIB_LIBS :=
-endif
+include Makefile.common
 
 xg_dom_bzimageloader.o xg_dom_bzimageloader.opic: CFLAGS += $(ZLIB_CFLAGS)
 
-$(LIBELF_OBJS) $(LIBELF_OBJS:.o=.opic): CFLAGS += -Wno-pointer-sign
+$(LIBELF_OBJS:.o=.opic): CFLAGS += -Wno-pointer-sign
 
 LIBHEADER := xenguest.h
 
diff --git a/tools/libs/guest/Makefile.common b/tools/libs/guest/Makefile.common
new file mode 100644
index 0000000000..a026a2f662
--- /dev/null
+++ b/tools/libs/guest/Makefile.common
@@ -0,0 +1,84 @@
+ifeq ($(CONFIG_LIBXC_MINIOS),y)
+# Save/restore of a domain is currently incompatible with a stubdom environment
+override CONFIG_MIGRATE := n
+endif
+
+OBJS-y += xg_private.o
+OBJS-y += xg_domain.o
+OBJS-y += xg_suspend.o
+OBJS-y += xg_resume.o
+ifeq ($(CONFIG_MIGRATE),y)
+OBJS-y += xg_sr_common.o
+OBJS-$(CONFIG_X86) += xg_sr_common_x86.o
+OBJS-$(CONFIG_X86) += xg_sr_common_x86_pv.o
+OBJS-$(CONFIG_X86) += xg_sr_restore_x86_pv.o
+OBJS-$(CONFIG_X86) += xg_sr_restore_x86_hvm.o
+OBJS-$(CONFIG_X86) += xg_sr_save_x86_pv.o
+OBJS-$(CONFIG_X86) += xg_sr_save_x86_hvm.o
+OBJS-y += xg_sr_restore.o
+OBJS-y += xg_sr_save.o
+OBJS-y += xg_offline_page.o
+else
+OBJS-y += xg_nomigrate.o
+endif
+OBJS-y       += xg_core.o
+OBJS-$(CONFIG_X86) += xg_core_x86.o
+OBJS-$(CONFIG_ARM) += xg_core_arm.o
+
+vpath %.c ../../../xen/common/libelf
+
+LIBELF_OBJS += libelf-tools.o libelf-loader.o
+LIBELF_OBJS += libelf-dominfo.o
+
+OBJS-y += $(LIBELF_OBJS)
+
+ifeq ($(CONFIG_X86),y) # Add libx86 to the build
+vpath %.c ../../../xen/lib/x86
+
+OBJS-y                 += cpuid.o msr.o policy.o
+endif
+
+# new domain builder
+OBJS-y                 += xg_dom_core.o
+OBJS-y                 += xg_dom_boot.o
+OBJS-y                 += xg_dom_elfloader.o
+OBJS-$(CONFIG_X86)     += xg_dom_bzimageloader.o
+OBJS-$(CONFIG_X86)     += xg_dom_decompress_lz4.o
+OBJS-$(CONFIG_X86)     += xg_dom_hvmloader.o
+OBJS-$(CONFIG_ARM)     += xg_dom_armzimageloader.o
+OBJS-y                 += xg_dom_binloader.o
+OBJS-y                 += xg_dom_compat_linux.o
+
+OBJS-$(CONFIG_X86)     += xg_dom_x86.o
+OBJS-$(CONFIG_X86)     += xg_cpuid_x86.o
+OBJS-$(CONFIG_ARM)     += xg_dom_arm.o
+
+ifeq ($(CONFIG_LIBXC_MINIOS),y)
+OBJS-y                 += xg_dom_decompress_unsafe.o
+OBJS-y                 += xg_dom_decompress_unsafe_bzip2.o
+OBJS-y                 += xg_dom_decompress_unsafe_lzma.o
+OBJS-y                 += xg_dom_decompress_unsafe_lzo1x.o
+OBJS-y                 += xg_dom_decompress_unsafe_xz.o
+OBJS-y                 += xg_dom_decompress_unsafe_zstd.o
+endif
+
+CFLAGS += -D__XEN_TOOLS__
+CFLAGS += -include $(XEN_ROOT)/tools/config.h
+CFLAGS += -iquote ../../../xen/common/libelf
+
+# To be able to include xc_private.h
+CFLAGS += -iquote $(XEN_libxenctrl)
+
+# Needed for posix_fadvise64() in xc_linux.c
+CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE
+
+CFLAGS	+= $(PTHREAD_CFLAGS)
+CFLAGS	+= $(CFLAGS_libxentoollog)
+CFLAGS	+= $(CFLAGS_libxenevtchn)
+CFLAGS	+= $(CFLAGS_libxendevicemodel)
+
+# libxenguest includes xc_private.h, so needs this despite not using
+# this functionality directly.
+CFLAGS += $(CFLAGS_libxencall) $(CFLAGS_libxenforeignmemory)
+
+$(LIBELF_OBJS): CFLAGS += -Wno-pointer-sign
diff --git a/tools/libs/toolcore/Makefile b/tools/libs/toolcore/Makefile
index 360a10e5da..5b81814e52 100644
--- a/tools/libs/toolcore/Makefile
+++ b/tools/libs/toolcore/Makefile
@@ -3,19 +3,13 @@ include $(XEN_ROOT)/tools/Rules.mk
 
 MAJOR	= 1
 MINOR	= 0
-AUTOINCS := $(XEN_INCLUDE)/_xentoolcore_list.h
 
 LIBHEADER := xentoolcore.h
 
-OBJS-y	+= handlereg.o
+include Makefile.common
 
 include $(XEN_ROOT)/tools/libs/libs.mk
 
 PKG_CONFIG_DESC := Central support for Xen Hypervisor userland libraries
 
-$(OBJS-y): $(AUTOINCS)
 $(PIC_OBJS): $(AUTOINCS)
-
-$(XEN_INCLUDE)/_xentoolcore_list.h: $(XEN_INCLUDE)/xen-external/bsd-sys-queue-h-seddery $(XEN_INCLUDE)/xen-external/bsd-sys-queue.h
-	$(PERL) $^ --prefix=xentoolcore >$(notdir $@).new
-	$(call move-if-changed,$(notdir $@).new,$@)
diff --git a/tools/libs/toolcore/Makefile.common b/tools/libs/toolcore/Makefile.common
new file mode 100644
index 0000000000..4d6c7687f8
--- /dev/null
+++ b/tools/libs/toolcore/Makefile.common
@@ -0,0 +1,9 @@
+OBJS-y	+= handlereg.o
+
+AUTOINCS := $(XEN_INCLUDE)/_xentoolcore_list.h
+
+$(OBJS-y): $(AUTOINCS)
+
+$(XEN_INCLUDE)/_xentoolcore_list.h: $(XEN_INCLUDE)/xen-external/bsd-sys-queue-h-seddery $(XEN_INCLUDE)/xen-external/bsd-sys-queue.h
+	$(PERL) $^ --prefix=xentoolcore >$(notdir $@).new
+	$(call move-if-changed,$(notdir $@).new,$@)
diff --git a/tools/libs/toollog/Makefile b/tools/libs/toollog/Makefile
index c09aa02ba5..2361b8cbf1 100644
--- a/tools/libs/toollog/Makefile
+++ b/tools/libs/toollog/Makefile
@@ -4,7 +4,6 @@ include $(XEN_ROOT)/tools/Rules.mk
 MAJOR	= 1
 MINOR	= 0
 
-OBJS-y	+= xtl_core.o
-OBJS-y	+= xtl_logger_stdio.o
+include Makefile.common
 
 include $(XEN_ROOT)/tools/libs/libs.mk
diff --git a/tools/libs/toollog/Makefile.common b/tools/libs/toollog/Makefile.common
new file mode 100644
index 0000000000..c053ac6a73
--- /dev/null
+++ b/tools/libs/toollog/Makefile.common
@@ -0,0 +1,2 @@
+OBJS-y	+= xtl_core.o
+OBJS-y	+= xtl_logger_stdio.o
-- 
Anthony PERARD



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

* [XEN PATCH 55/57] tools/xenstore: introduce Makefile.common to be used by stubdom
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (53 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 54/57] tools/libs: create Makefile.common to be used by stubdom build system Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-07 14:58   ` Juergen Gross
  2021-12-06 17:02 ` [XEN PATCH 56/57] stubdom: build xenstore*-stubdom using new Makefile.common Anthony PERARD
  2021-12-06 17:02 ` [XEN PATCH 57/57] stubdom: xenlibs linkfarm, ignore non-regular files Anthony PERARD
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu,
	Samuel Thibault, Juergen Gross

Also change stubdom to depends on Makefile.common.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 stubdom/Makefile               |  4 ++--
 tools/xenstore/Makefile        | 34 +++-------------------------------
 tools/xenstore/Makefile.common | 34 ++++++++++++++++++++++++++++++++++
 3 files changed, 39 insertions(+), 33 deletions(-)
 create mode 100644 tools/xenstore/Makefile.common

diff --git a/stubdom/Makefile b/stubdom/Makefile
index fbc63a5063..6b804824ba 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -371,10 +371,10 @@ endef
 
 $(foreach lib,$(STUB_LIBS),$(eval $(call BUILD_lib,$(lib))))
 
-xenstore/stamp: $(XEN_ROOT)/tools/xenstore/Makefile
+xenstore/stamp: $(XEN_ROOT)/tools/xenstore/Makefile.common
 	$(do_links)
 
-xenstorepvh/stamp: $(XEN_ROOT)/tools/xenstore/Makefile
+xenstorepvh/stamp: $(XEN_ROOT)/tools/xenstore/Makefile.common
 	$(do_links)
 
 LINK_DIRS := xenstore xenstorepvh $(foreach dir,$(STUB_LIBS),libs-$(XEN_TARGET_ARCH)/$(dir))
diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
index 7fe1d9c1e2..a6fc917b81 100644
--- a/tools/xenstore/Makefile
+++ b/tools/xenstore/Makefile
@@ -1,36 +1,11 @@
 XEN_ROOT=$(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
+include Makefile.common
+
 MAJOR = 3.0
 MINOR = 3
 
-CFLAGS += -Werror
-# Include configure output (config.h)
-CFLAGS += -include $(XEN_ROOT)/tools/config.h
-CFLAGS += -I./include
-CFLAGS += $(CFLAGS_libxenevtchn)
-CFLAGS += $(CFLAGS_libxenctrl)
-CFLAGS += $(CFLAGS_libxenguest)
-CFLAGS += $(CFLAGS_libxentoolcore)
-CFLAGS += -DXEN_LIB_STORED="\"$(XEN_LIB_STORED)\""
-CFLAGS += -DXEN_RUN_STORED="\"$(XEN_RUN_STORED)\""
-
-ifdef CONFIG_STUBDOM
-CFLAGS += -DNO_SOCKETS=1
-endif
-
-XENSTORED_OBJS-y := xenstored_core.o xenstored_watch.o xenstored_domain.o
-XENSTORED_OBJS-y += xenstored_transaction.o xenstored_control.o
-XENSTORED_OBJS-y += xs_lib.o talloc.o utils.o tdb.o hashtable.o
-
-XENSTORED_OBJS-$(CONFIG_Linux) += xenstored_posix.o
-XENSTORED_OBJS-$(CONFIG_SunOS) += xenstored_solaris.o xenstored_posix.o xenstored_probes.o
-XENSTORED_OBJS-$(CONFIG_NetBSD) += xenstored_posix.o
-XENSTORED_OBJS-$(CONFIG_FreeBSD) += xenstored_posix.o
-XENSTORED_OBJS-$(CONFIG_MiniOS) += xenstored_minios.o
-
-$(XENSTORED_OBJS-y): CFLAGS += $(CFLAGS_libxengnttab)
-
 xenstored: LDLIBS += $(LDLIBS_libxenevtchn)
 xenstored: LDLIBS += $(LDLIBS_libxengnttab)
 xenstored: LDLIBS += $(LDLIBS_libxenctrl)
@@ -81,9 +56,6 @@ endif
 xenstored: $(XENSTORED_OBJS-y)
 	$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@ $(APPEND_LDFLAGS)
 
-xenstored.a: $(XENSTORED_OBJS-y)
-	$(AR) cr $@ $^
-
 $(CLIENTS): xenstore
 	ln -f xenstore $@
 
@@ -97,7 +69,7 @@ xs_tdb_dump: xs_tdb_dump.o utils.o tdb.o talloc.o
 	$(CC) $(LDFLAGS) $^ -o $@ $(APPEND_LDFLAGS)
 
 .PHONY: clean
-clean:
+clean::
 	rm -f *.a *.o xenstored_probes.h
 	rm -f $(TARGETS)
 	$(RM) $(DEPS_RM)
diff --git a/tools/xenstore/Makefile.common b/tools/xenstore/Makefile.common
new file mode 100644
index 0000000000..49002651a1
--- /dev/null
+++ b/tools/xenstore/Makefile.common
@@ -0,0 +1,34 @@
+# Makefile shared with stubdom
+
+XENSTORED_OBJS-y := xenstored_core.o xenstored_watch.o xenstored_domain.o
+XENSTORED_OBJS-y += xenstored_transaction.o xenstored_control.o
+XENSTORED_OBJS-y += xs_lib.o talloc.o utils.o tdb.o hashtable.o
+
+XENSTORED_OBJS-$(CONFIG_Linux) += xenstored_posix.o
+XENSTORED_OBJS-$(CONFIG_SunOS) += xenstored_solaris.o xenstored_posix.o xenstored_probes.o
+XENSTORED_OBJS-$(CONFIG_NetBSD) += xenstored_posix.o
+XENSTORED_OBJS-$(CONFIG_FreeBSD) += xenstored_posix.o
+XENSTORED_OBJS-$(CONFIG_MiniOS) += xenstored_minios.o
+
+CFLAGS += -Werror
+# Include configure output (config.h)
+CFLAGS += -include $(XEN_ROOT)/tools/config.h
+CFLAGS += -I./include
+CFLAGS += $(CFLAGS_libxenevtchn)
+CFLAGS += $(CFLAGS_libxenctrl)
+CFLAGS += $(CFLAGS_libxenguest)
+CFLAGS += $(CFLAGS_libxentoolcore)
+CFLAGS += -DXEN_LIB_STORED="\"$(XEN_LIB_STORED)\""
+CFLAGS += -DXEN_RUN_STORED="\"$(XEN_RUN_STORED)\""
+
+ifdef CONFIG_STUBDOM
+CFLAGS += -DNO_SOCKETS=1
+endif
+
+$(XENSTORED_OBJS-y): CFLAGS += $(CFLAGS_libxengnttab)
+
+xenstored.a: $(XENSTORED_OBJS-y)
+	$(AR) cr $@ $^
+
+clean::
+	rm -f *.a *.o
-- 
Anthony PERARD



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

* [XEN PATCH 56/57] stubdom: build xenstore*-stubdom using new Makefile.common
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (54 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 55/57] tools/xenstore: introduce Makefile.common to be used by stubdom Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-11 23:51   ` Samuel Thibault
  2021-12-06 17:02 ` [XEN PATCH 57/57] stubdom: xenlibs linkfarm, ignore non-regular files Anthony PERARD
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu, Samuel Thibault

Makefile.common have everything needed by stubdom, when used with
xenlibs.mk, so we don't need "Makefile" anymore.

Also, remove DESTDIR for "xenstore" related targets, "xenlibs.mk"
doesn't use DESTDIR so its value doesn't matter.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 stubdom/Makefile | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 6b804824ba..1fa075b9ad 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -346,8 +346,7 @@ define do_links
   cd $(dir $@); \
   ln -sf $(dir $<)include/*.h include/; \
   ln -sf $(dir $<)*.[ch] .; \
-  [ -e $(dir $<)Makefile.common ] && ln -sf $(dir $<)Makefile.common . ||:; \
-  ln -sf $(dir $<)Makefile .
+  ln -sf $(dir $<)Makefile.common .
   touch $@
 endef
 
@@ -356,13 +355,11 @@ define BUILD_lib
  libxen$(1): libs-$$(XEN_TARGET_ARCH)/$(1)/libxen$(1).a
  libs-$$(XEN_TARGET_ARCH)/$(1)/libxen$(1).a: $$(LIBDEPS_$(1)) $$(LIBDEP_$(1))
  libs-$$(XEN_TARGET_ARCH)/$(1)/libxen$(1).a: mk-headers-$$(XEN_TARGET_ARCH) $$(NEWLIB_STAMPFILE) .phony
-	CPPFLAGS="$$(TARGET_CPPFLAGS)" CFLAGS="$$(TARGET_CFLAGS)" $$(MAKE) CONFIG_LIBXC_MINIOS=y $$(if $$(wildcard $$(@D)/Makefile.common),-f $(CURDIR)/xenlibs.mk) -C $$(@D) $$(@F)
+	CPPFLAGS="$$(TARGET_CPPFLAGS)" CFLAGS="$$(TARGET_CFLAGS)" $$(MAKE) CONFIG_LIBXC_MINIOS=y -f $(CURDIR)/xenlibs.mk -C $$(@D) $$(@F)
 
  clean-libxen$(1):
 	if [ -e libs-$$(XEN_TARGET_ARCH)/$(1)/Makefile.common ]; then \
 	    $$(MAKE) -f $(CURDIR)/xenlibs.mk -C libs-$$(XEN_TARGET_ARCH)/$(1) clean; \
-	elif [ -e libs-$$(XEN_TARGET_ARCH)/$(1)/Makefile ]; then \
-	    $$(MAKE) -C libs-$$(XEN_TARGET_ARCH)/$(1) clean; \
 	fi
 
  libs-$$(XEN_TARGET_ARCH)/$(1)/stamp: $$(XEN_ROOT)/tools/libs/$(1)/Makefile.common
@@ -494,7 +491,7 @@ xenstore-minios-config.mk: $(CURDIR)/xenstore-minios.cfg
 
 .PHONY: xenstore
 xenstore: $(CROSS_ROOT) xenstore-minios-config.mk
-	CPPFLAGS="$(TARGET_CPPFLAGS) $(shell cat xenstore-minios-config.mk)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ xenstored.a CONFIG_STUBDOM=y
+	CPPFLAGS="$(TARGET_CPPFLAGS) $(shell cat xenstore-minios-config.mk)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -f $(CURDIR)/xenlibs.mk -C $@ xenstored.a CONFIG_STUBDOM=y
 
 #############
 # xenstorepvh
@@ -505,7 +502,7 @@ xenstorepvh-minios-config.mk: $(CURDIR)/xenstorepvh-minios.cfg
 
 .PHONY: xenstorepvh
 xenstorepvh: $(CROSS_ROOT) xenstorepvh-minios-config.mk
-	CPPFLAGS="$(TARGET_CPPFLAGS) $(shell cat xenstorepvh-minios-config.mk)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ xenstored.a CONFIG_STUBDOM=y
+	CPPFLAGS="$(TARGET_CPPFLAGS) $(shell cat xenstorepvh-minios-config.mk)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -f $(CURDIR)/xenlibs.mk -C $@ xenstored.a CONFIG_STUBDOM=y
 
 ########
 # minios
@@ -657,8 +654,8 @@ clean:
 	rm -f *-minios-config.mk
 	rm -fr pkg-config
 	-[ ! -d ioemu ] || $(MAKE) DESTDIR= -C ioemu clean
-	-[ ! -d xenstore ] || $(MAKE) DESTDIR= -C xenstore clean
-	-[ ! -d xenstorepvh ] || $(MAKE) DESTDIR= -C xenstorepvh clean
+	-[ ! -d xenstore ] || $(MAKE) -f $(CURDIR)/xenlibs.mk -C xenstore clean
+	-[ ! -d xenstorepvh ] || $(MAKE) -f $(CURDIR)/xenlibs.mk -C xenstorepvh clean
 
 # clean the cross-compilation result
 .PHONY: crossclean
-- 
Anthony PERARD



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

* [XEN PATCH 57/57] stubdom: xenlibs linkfarm, ignore non-regular files
  2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
                   ` (55 preceding siblings ...)
  2021-12-06 17:02 ` [XEN PATCH 56/57] stubdom: build xenstore*-stubdom using new Makefile.common Anthony PERARD
@ 2021-12-06 17:02 ` Anthony PERARD
  2021-12-11 23:53   ` Samuel Thibault
  56 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-06 17:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Anthony PERARD, Ian Jackson, Wei Liu, Samuel Thibault

When we will convert tools/ build system, their will be a need to
replace some use of "vpath". This will done making symbolic links.
Those symlinks are not wanted by stubdom build system when making a
linkfarm for the Xen libraries. To avoid them, we will use `find`
instead of plain shell globbing.

For example, there will be a link to "xen/lib/x86/cpuid.o" in
"tools/libs/guest/".

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 stubdom/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 1fa075b9ad..b312f710cd 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -345,7 +345,7 @@ define do_links
   mkdir -p $(dir $@)include
   cd $(dir $@); \
   ln -sf $(dir $<)include/*.h include/; \
-  ln -sf $(dir $<)*.[ch] .; \
+  find $(dir $<) -maxdepth 1 -type f -name '*.[ch]' -exec ln -sf {} . \; ; \
   ln -sf $(dir $<)Makefile.common .
   touch $@
 endef
-- 
Anthony PERARD



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

* Re: [XEN PATCH 04/57] libs: Remove _paths.h from libs ctrl and util.
  2021-12-06 17:01 ` [XEN PATCH 04/57] libs: Remove _paths.h from libs ctrl and util Anthony PERARD
@ 2021-12-07  7:43   ` Juergen Gross
  0 siblings, 0 replies; 115+ messages in thread
From: Juergen Gross @ 2021-12-07  7:43 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel
  Cc: Anthony PERARD, Andrew Cooper, George Dunlap, Ian Jackson,
	Jan Beulich, Julien Grall, Stefano Stabellini, Wei Liu


[-- Attachment #1.1.1: Type: text/plain, Size: 390 bytes --]

On 06.12.21 18:01, Anthony PERARD wrote:
> libxenutil doesn't include _paths.h so no need to generate it.
> 
> libxenctrl doesn't use macros from _paths.h so can be removed.
> Fix libxenguest to include _paths.h properly instead of relying on
> xc_private.h
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [XEN PATCH 05/57] libs: Remove -Iinclude from CFLAGS
  2021-12-06 17:01 ` [XEN PATCH 05/57] libs: Remove -Iinclude from CFLAGS Anthony PERARD
@ 2021-12-07  7:44   ` Juergen Gross
  0 siblings, 0 replies; 115+ messages in thread
From: Juergen Gross @ 2021-12-07  7:44 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel; +Cc: Anthony PERARD, Ian Jackson, Wei Liu


[-- Attachment #1.1.1: Type: text/plain, Size: 214 bytes --]

On 06.12.21 18:01, Anthony PERARD wrote:
> They are no more directory libs/*/include.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [XEN PATCH 06/57] libs/libs.mk: Remove generic variable that already exist
  2021-12-06 17:01 ` [XEN PATCH 06/57] libs/libs.mk: Remove generic variable that already exist Anthony PERARD
@ 2021-12-07  7:46   ` Juergen Gross
  0 siblings, 0 replies; 115+ messages in thread
From: Juergen Gross @ 2021-12-07  7:46 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel; +Cc: Anthony PERARD, Ian Jackson, Wei Liu


[-- Attachment #1.1.1: Type: text/plain, Size: 227 bytes --]

On 06.12.21 18:01, Anthony PERARD wrote:
> comma, empty, space are already defined in "Config.mk".
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [XEN PATCH 07/57] libs/guest: Drop spurious include in Makefile
  2021-12-06 17:01 ` [XEN PATCH 07/57] libs/guest: Drop spurious include in Makefile Anthony PERARD
@ 2021-12-07  7:48   ` Juergen Gross
  0 siblings, 0 replies; 115+ messages in thread
From: Juergen Gross @ 2021-12-07  7:48 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel; +Cc: Anthony PERARD, Ian Jackson, Wei Liu


[-- Attachment #1.1.1: Type: text/plain, Size: 251 bytes --]

On 06.12.21 18:01, Anthony PERARD wrote:
> This include hasn't been useful since e567964a54 (tools: drop ia64
> support).
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [XEN PATCH 08/57] libs/light: Remove non-existing CFLAGS_libxl.o var
  2021-12-06 17:01 ` [XEN PATCH 08/57] libs/light: Remove non-existing CFLAGS_libxl.o var Anthony PERARD
@ 2021-12-07  7:49   ` Juergen Gross
  0 siblings, 0 replies; 115+ messages in thread
From: Juergen Gross @ 2021-12-07  7:49 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel; +Cc: Anthony PERARD, Ian Jackson, Wei Liu


[-- Attachment #1.1.1: Type: text/plain, Size: 322 bytes --]

On 06.12.21 18:01, Anthony PERARD wrote:
> This var was originally $(CFLAGS_$*.o), and probably was copied from
> the generic %.o:%.c rules.
> 
> Nothing sets CFLAGS_libxl.o, so remove it.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [XEN PATCH 09/57] libs/light: Remove -I.
  2021-12-06 17:01 ` [XEN PATCH 09/57] libs/light: Remove -I Anthony PERARD
@ 2021-12-07  7:59   ` Juergen Gross
  0 siblings, 0 replies; 115+ messages in thread
From: Juergen Gross @ 2021-12-07  7:59 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel; +Cc: Anthony PERARD, Ian Jackson, Wei Liu


[-- Attachment #1.1.1: Type: text/plain, Size: 220 bytes --]

On 06.12.21 18:01, Anthony PERARD wrote:
> There is no need to include current directory.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [XEN PATCH 10/57] libs/stat: Remove duplicated CFLAGS from deps
  2021-12-06 17:01 ` [XEN PATCH 10/57] libs/stat: Remove duplicated CFLAGS from deps Anthony PERARD
@ 2021-12-07  8:01   ` Juergen Gross
  0 siblings, 0 replies; 115+ messages in thread
From: Juergen Gross @ 2021-12-07  8:01 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel; +Cc: Anthony PERARD, Ian Jackson, Wei Liu


[-- Attachment #1.1.1: Type: text/plain, Size: 233 bytes --]

On 06.12.21 18:01, Anthony PERARD wrote:
> Those CFLAGS_* are already added in libs.mk via USELIBS_stat.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [XEN PATCH 11/57] libs/store: Remove PKG_CONFIG_REMOVE
  2021-12-06 17:01 ` [XEN PATCH 11/57] libs/store: Remove PKG_CONFIG_REMOVE Anthony PERARD
@ 2021-12-07  8:05   ` Juergen Gross
  0 siblings, 0 replies; 115+ messages in thread
From: Juergen Gross @ 2021-12-07  8:05 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel; +Cc: Anthony PERARD, Ian Jackson, Wei Liu


[-- Attachment #1.1.1: Type: text/plain, Size: 345 bytes --]

On 06.12.21 18:01, Anthony PERARD wrote:
> PKG_CONFIG_REMOVE doesn't do anything anymore. Commit dd33fd2e81
> (tools: split libxenstore into new tools/libs/store directory) had
> reintroduced it without saying why.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [XEN PATCH 18/57] tools: Use config.h from autoconf instead of "buildmakevars2header"
  2021-12-06 17:02 ` [XEN PATCH 18/57] tools: Use config.h from autoconf instead of "buildmakevars2header" Anthony PERARD
@ 2021-12-07 10:08   ` Juergen Gross
  2021-12-07 10:49     ` Anthony PERARD
  0 siblings, 1 reply; 115+ messages in thread
From: Juergen Gross @ 2021-12-07 10:08 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel
  Cc: Anthony PERARD, Andrew Cooper, George Dunlap, Ian Jackson,
	Jan Beulich, Julien Grall, Stefano Stabellini, Wei Liu


[-- Attachment #1.1.1: Type: text/plain, Size: 554 bytes --]

On 06.12.21 18:02, Anthony PERARD wrote:
> This avoid the need to generate the _paths.h header when the
> information is from autoconf anyway.
> 
> They are no more users of the "buildmakevars2header" macro, so it can
> be removed from "Config.mk".
> 
> Also removed the extra "-f" flag where "$(RM)" is used (xl/Makefile).
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

The changes for configure should be done in the respective configure.ac
files and then configure can be generated via a call of "autoconf".


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [XEN PATCH 19/57] tools/configure.ac: Create ZLIB_LIBS and ZLIB_CFLAGS
  2021-12-06 17:02 ` [XEN PATCH 19/57] tools/configure.ac: Create ZLIB_LIBS and ZLIB_CFLAGS Anthony PERARD
@ 2021-12-07 10:20   ` Juergen Gross
  2021-12-16 17:16   ` Andrew Cooper
  1 sibling, 0 replies; 115+ messages in thread
From: Juergen Gross @ 2021-12-07 10:20 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel; +Cc: Anthony PERARD, Ian Jackson, Wei Liu


[-- Attachment #1.1.1: Type: text/plain, Size: 272 bytes --]

On 06.12.21 18:02, Anthony PERARD wrote:
> Use both ZLIB_CFLAGS and ZLIB_LIBS instead of cherry-picking flags
> from a single "ZLIB" variable.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [XEN PATCH 18/57] tools: Use config.h from autoconf instead of "buildmakevars2header"
  2021-12-07 10:08   ` Juergen Gross
@ 2021-12-07 10:49     ` Anthony PERARD
  2021-12-07 10:53       ` Juergen Gross
  0 siblings, 1 reply; 115+ messages in thread
From: Anthony PERARD @ 2021-12-07 10:49 UTC (permalink / raw)
  To: Juergen Gross
  Cc: xen-devel, Anthony PERARD, Andrew Cooper, George Dunlap,
	Ian Jackson, Jan Beulich, Julien Grall, Stefano Stabellini,
	Wei Liu

On Tue, Dec 07, 2021 at 11:08:55AM +0100, Juergen Gross wrote:
> On 06.12.21 18:02, Anthony PERARD wrote:
> > This avoid the need to generate the _paths.h header when the
> > information is from autoconf anyway.
> > 
> > They are no more users of the "buildmakevars2header" macro, so it can
> > be removed from "Config.mk".
> > 
> > Also removed the extra "-f" flag where "$(RM)" is used (xl/Makefile).
> > 
> > Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> 
> The changes for configure should be done in the respective configure.ac
> files and then configure can be generated via a call of "autoconf".

This is what this patch does, via changes in "m4/paths.m4" ;-).
All the respective "configure.ac" have "m4_include([m4/paths.m4])", so
nearly any modification to "paths.m4" will change the generated
"configure" script.

Cheers,

-- 
Anthony PERARD


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

* Re: [XEN PATCH 18/57] tools: Use config.h from autoconf instead of "buildmakevars2header"
  2021-12-07 10:49     ` Anthony PERARD
@ 2021-12-07 10:53       ` Juergen Gross
  0 siblings, 0 replies; 115+ messages in thread
From: Juergen Gross @ 2021-12-07 10:53 UTC (permalink / raw)
  To: Anthony PERARD
  Cc: xen-devel, Anthony PERARD, Andrew Cooper, George Dunlap,
	Ian Jackson, Jan Beulich, Julien Grall, Stefano Stabellini,
	Wei Liu


[-- Attachment #1.1.1: Type: text/plain, Size: 1179 bytes --]

On 07.12.21 11:49, Anthony PERARD wrote:
> On Tue, Dec 07, 2021 at 11:08:55AM +0100, Juergen Gross wrote:
>> On 06.12.21 18:02, Anthony PERARD wrote:
>>> This avoid the need to generate the _paths.h header when the
>>> information is from autoconf anyway.
>>>
>>> They are no more users of the "buildmakevars2header" macro, so it can
>>> be removed from "Config.mk".
>>>
>>> Also removed the extra "-f" flag where "$(RM)" is used (xl/Makefile).
>>>
>>> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
>>
>> The changes for configure should be done in the respective configure.ac
>> files and then configure can be generated via a call of "autoconf".
> 
> This is what this patch does, via changes in "m4/paths.m4" ;-).
> All the respective "configure.ac" have "m4_include([m4/paths.m4])", so
> nearly any modification to "paths.m4" will change the generated
> "configure" script.

Oh, I just looked at the modified files and didn't see any *.ac ones.

I was already wondering how you could miss that, especially as you did
it correctly in the next patch. :-)

You can then add my:

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [XEN PATCH 20/57] tools/Rules.mk: introduce FORCE target
  2021-12-06 17:02 ` [XEN PATCH 20/57] tools/Rules.mk: introduce FORCE target Anthony PERARD
@ 2021-12-07 10:54   ` Juergen Gross
  0 siblings, 0 replies; 115+ messages in thread
From: Juergen Gross @ 2021-12-07 10:54 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel; +Cc: Anthony PERARD, Ian Jackson, Wei Liu


[-- Attachment #1.1.1: Type: text/plain, Size: 211 bytes --]

On 06.12.21 18:02, Anthony PERARD wrote:
> And replace the one defined in libs.mk.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [XEN PATCH 36/57] tools/xenstore: Cleanup makefile
  2021-12-06 17:02 ` [XEN PATCH 36/57] tools/xenstore: Cleanup makefile Anthony PERARD
@ 2021-12-07 11:21   ` Juergen Gross
  2021-12-16 17:19   ` Andrew Cooper
  2021-12-16 18:34   ` Andrew Cooper
  2 siblings, 0 replies; 115+ messages in thread
From: Juergen Gross @ 2021-12-07 11:21 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel
  Cc: Anthony PERARD, Ian Jackson, Wei Liu, Julien Grall


[-- Attachment #1.1.1: Type: text/plain, Size: 1033 bytes --]

On 06.12.21 18:02, Anthony PERARD wrote:
> Regroup *FLAGS together, use $(LDLIBS).
> 
> Remove $(LDLIBS_xenstored) which was the wrong name name as it doesn't
> decribe how to link to a potential libxenstored.so, instead add the
> value to $(LDLIBS) of xenstored.
> 
> Add SYSTEMD_LIBS into $(LDLIBS) instead of $(LDFLAGS).
> 
> Remove the "-I." from $(CFLAGS), it shouldn't be needed.
> 
> Removed $(CFLAGS-y) and $(LDFLAGS-y). $(CFLAGS-y) is already included
> in $(CFLAGS) and both aren't used anyway.
> 
> Rename ALL_TARGETS to TARGETS.
> Only add programmes we want to build in $(TARGETS), not phony-targets
> (replace "clients").
> 
> Store all `xenstored` objs into $(XENSTORED_OBJS-y).
> 
> Replace one $< by $^ even if there's only one dependency,
> (xenstore-control).
> 
> clean: "init-xenstore-domain" isn't built here, so stop trying to
> remove it, remove $(TARGETS).
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [XEN PATCH 39/57] libs: Remove both "libs" and "build" target
  2021-12-06 17:02 ` [XEN PATCH 39/57] libs: Remove both "libs" and "build" target Anthony PERARD
@ 2021-12-07 12:14   ` Juergen Gross
  0 siblings, 0 replies; 115+ messages in thread
From: Juergen Gross @ 2021-12-07 12:14 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel; +Cc: Anthony PERARD, Ian Jackson, Wei Liu


[-- Attachment #1.1.1: Type: text/plain, Size: 394 bytes --]

On 06.12.21 18:02, Anthony PERARD wrote:
> "libs" is odd and has been introduced without a reason by c7d3afbb44.
> Instead, only use "all".
> 
> Also remove "build" target as "all" is more appropriate and nothing is
> using "build" in libs/ in the xen.git repo.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [XEN PATCH 40/57] libs: rename LDUSELIBS to LDLIBS and use it instead of APPEND_LDFLAGS
  2021-12-06 17:02 ` [XEN PATCH 40/57] libs: rename LDUSELIBS to LDLIBS and use it instead of APPEND_LDFLAGS Anthony PERARD
@ 2021-12-07 12:17   ` Juergen Gross
  0 siblings, 0 replies; 115+ messages in thread
From: Juergen Gross @ 2021-12-07 12:17 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel; +Cc: Anthony PERARD, Ian Jackson, Wei Liu


[-- Attachment #1.1.1: Type: text/plain, Size: 323 bytes --]

On 06.12.21 18:02, Anthony PERARD wrote:
> LDLIBS is more appropriate and intended to be used to add library
> dependencies. APPEND_LDFLAGS wasn't intended to be changed by the
> build system.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [XEN PATCH 41/57] libs: Remove need for *installlocal targets
  2021-12-06 17:02 ` [XEN PATCH 41/57] libs: Remove need for *installlocal targets Anthony PERARD
@ 2021-12-07 13:20   ` Juergen Gross
  2021-12-21 17:59     ` Anthony PERARD
  0 siblings, 1 reply; 115+ messages in thread
From: Juergen Gross @ 2021-12-07 13:20 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel; +Cc: Anthony PERARD, Ian Jackson, Wei Liu


[-- Attachment #1.1.1: Type: text/plain, Size: 829 bytes --]

On 06.12.21 18:02, Anthony PERARD wrote:
> There is no need for an extra "installlocal" target, we can use
> double-colon rules instead.

Doesn't that mean that with the ultimate goal of including all
Makefiles of the tree that all "install" and "uninstall" rules in the
tree will have to be double-colon rules? Citing from the make manual:

   When a target appears in multiple rules, all the rules must be the
   same type: all ordinary, or all double-colon.

> 
> "install-headers" in "libs/store" was introduced for the same reason
> that "installlocal" exist, so it is replaced as well.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

With above remark I don't see how tools/libs/stat/Makefile can be left
unmodified, as it includes libs.mk and it contains an "intall:" rule.


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [XEN PATCH 42/57] libs,tools/include: Clean "clean" targets
  2021-12-06 17:02 ` [XEN PATCH 42/57] libs,tools/include: Clean "clean" targets Anthony PERARD
@ 2021-12-07 13:21   ` Juergen Gross
  0 siblings, 0 replies; 115+ messages in thread
From: Juergen Gross @ 2021-12-07 13:21 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel; +Cc: Anthony PERARD, Ian Jackson, Wei Liu


[-- Attachment #1.1.1: Type: text/plain, Size: 712 bytes --]

On 06.12.21 18:02, Anthony PERARD wrote:
> There is no need for an extra "cleanlocal" target, we can use
> double-colon rules instead.
> 
> Generated headers are now in tools/include/, so remove those file
> there.
> 
> Remove -f flag as it's already in $(RM).
> 
> libs.mk:
>    - don't try to remove "*.rpm" anymore.
> 
> libs/light:
>    - "_paths.*.tmp" isn't created anymore.
>    - clean "libxenlight_test.so" and "libxl_test_*.opic".
> 
> libs/util:
>    - fix clean of version-script file.
> 
> include/xen-foreign:
>    - remove __pycache__
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Same remark regarding double-colon rules as for last patch.


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [XEN PATCH 43/57] libs: Rename $(SRCS-y) to $(OBJS-y)
  2021-12-06 17:02 ` [XEN PATCH 43/57] libs: Rename $(SRCS-y) to $(OBJS-y) Anthony PERARD
@ 2021-12-07 13:24   ` Juergen Gross
  0 siblings, 0 replies; 115+ messages in thread
From: Juergen Gross @ 2021-12-07 13:24 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel; +Cc: Anthony PERARD, Ian Jackson, Wei Liu


[-- Attachment #1.1.1: Type: text/plain, Size: 380 bytes --]

On 06.12.21 18:02, Anthony PERARD wrote:
> The only thing done thing done with $(SRCS-y) is to replace ".c" by
> ".o". It is more useful to collect which object we want to build as
> make will figure out how to build it and from which source file.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [XEN PATCH 44/57] libs/guest: rename ELF_OBJS to LIBELF_OBJS
  2021-12-06 17:02 ` [XEN PATCH 44/57] libs/guest: rename ELF_OBJS to LIBELF_OBJS Anthony PERARD
@ 2021-12-07 13:26   ` Juergen Gross
  0 siblings, 0 replies; 115+ messages in thread
From: Juergen Gross @ 2021-12-07 13:26 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel; +Cc: Anthony PERARD, Ian Jackson, Wei Liu


[-- Attachment #1.1.1: Type: text/plain, Size: 287 bytes --]

On 06.12.21 18:02, Anthony PERARD wrote:
> It seems a better name. Latter, we will introduce LIBX86_OBJS to

s/Latter/Later/

> collect lib/x86/* objects.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [XEN PATCH 45/57] libs/guest: rework CFLAGS
  2021-12-06 17:02 ` [XEN PATCH 45/57] libs/guest: rework CFLAGS Anthony PERARD
@ 2021-12-07 13:29   ` Juergen Gross
  0 siblings, 0 replies; 115+ messages in thread
From: Juergen Gross @ 2021-12-07 13:29 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel; +Cc: Anthony PERARD, Ian Jackson, Wei Liu


[-- Attachment #1.1.1: Type: text/plain, Size: 571 bytes --]

On 06.12.21 18:02, Anthony PERARD wrote:
> Remove '-Werror -Wmissing-progress -I./include $(CFLAGS_xeninclude)',
> those flags are already added via "libs.mk".
> 
> Flag "-I." isn't needed, we just need to fix the #include of
> "xg_core.h" as this header isn't expected to be installed.
> 
> Make use of "-iquote" instead of '-I' for double-quote included
> headers.
> 
> Also, regroup the CFLAGS into the same place in the makefile.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [XEN PATCH 46/57] libs/store: use of -iquote instead of -I
  2021-12-06 17:02 ` [XEN PATCH 46/57] libs/store: use of -iquote instead of -I Anthony PERARD
@ 2021-12-07 13:30   ` Juergen Gross
  0 siblings, 0 replies; 115+ messages in thread
From: Juergen Gross @ 2021-12-07 13:30 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel; +Cc: Anthony PERARD, Ian Jackson, Wei Liu


[-- Attachment #1.1.1: Type: text/plain, Size: 164 bytes --]

On 06.12.21 18:02, Anthony PERARD wrote:
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [XEN PATCH 47/57] libs/stat: Fix and rework python-bindings build
  2021-12-06 17:02 ` [XEN PATCH 47/57] libs/stat: Fix and rework python-bindings build Anthony PERARD
@ 2021-12-07 14:45   ` Juergen Gross
  2021-12-16 18:47   ` Andrew Cooper
  1 sibling, 0 replies; 115+ messages in thread
From: Juergen Gross @ 2021-12-07 14:45 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel; +Cc: Anthony PERARD, Ian Jackson, Wei Liu


[-- Attachment #1.1.1: Type: text/plain, Size: 1215 bytes --]

On 06.12.21 18:02, Anthony PERARD wrote:
> Fix the dependency on the library, $(SHLIB) variable doesn't exist
> anymore.
> 
> Rework dependency on the include file, we can let `swig` generate the
> dependency for us with the use of "-M*" flags.
> 
> The xenstat.h file has moved so we need to fix the include location.
> 
> Rather than relaying on the VCS to create an empty directory for us,
> we can create one before generating the *.c file for the bindings.
> 
> Make use of generic variable names to build a shared library from a
> source file: CFLAGS, LDFLAGS, and LDLIBS.
> 
> Fix python's specific *flags by using python-config, and add them to
> generic flags variables: CFLAGS, LDLIBS.
> 
> To build a shared library, we need to build the source file with
> "-fPIC", which was drop by 6d0ec05390 (tools: split libxenstat into
> new tools/libs/stat directory).
> 
> The source file generated by swig seems to be missing a prototype for
> the "init" function, so we need "-Wno-missing-prototypes" in order to
> build it.
> 
> Add some targets to .PHONY.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [XEN PATCH 48/57] libs/stat: Fix and rework perl-binding build
  2021-12-06 17:02 ` [XEN PATCH 48/57] libs/stat: Fix and rework perl-binding build Anthony PERARD
@ 2021-12-07 14:46   ` Juergen Gross
  0 siblings, 0 replies; 115+ messages in thread
From: Juergen Gross @ 2021-12-07 14:46 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel; +Cc: Anthony PERARD, Ian Jackson, Wei Liu


[-- Attachment #1.1.1: Type: text/plain, Size: 926 bytes --]

On 06.12.21 18:02, Anthony PERARD wrote:
> For PERL_FLAGS, use make's shell rather than a backquote.
> 
> Rather than relying on the VCS to create an empty directory for us,
> we can create one before generating the *.c file for the bindings.
> 
> Make use of generic variable names to build a shared library from a
> source file: CFLAGS, LDFLAGS, and LDLIBS.
> 
> To build a shared library, we need to build the source file with
> "-fPIC", which was drop by 6d0ec05390 (tools: split libxenstat into
> new tools/libs/stat directory).
> 
> The source file generated by swig seems to be missing many prototype for
> many functions, so we need "-Wno-missing-prototypes" in order to
> build it. Also, one of the prototype is deemed malformed, so we also
> need "-Wno-strict-prototypes".
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [XEN PATCH 49/57] libs/toolcore: don't install xentoolcore_internal.h anymore
  2021-12-06 17:02 ` [XEN PATCH 49/57] libs/toolcore: don't install xentoolcore_internal.h anymore Anthony PERARD
@ 2021-12-07 14:47   ` Juergen Gross
  0 siblings, 0 replies; 115+ messages in thread
From: Juergen Gross @ 2021-12-07 14:47 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel; +Cc: Anthony PERARD, Ian Jackson, Wei Liu


[-- Attachment #1.1.1: Type: text/plain, Size: 436 bytes --]

On 06.12.21 18:02, Anthony PERARD wrote:
> With "xentoolcore_internal.h" been in LIBHEADER, it was installed. But
> its dependency "_xentoolcore_list.h" wasn't installed so the header
> couldn't be used anyway.
> 
> This patch also mean that the rule "headers.chk" doesn't check it
> anymore as well.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [XEN PATCH 54/57] tools/libs: create Makefile.common to be used by stubdom build system
  2021-12-06 17:02 ` [XEN PATCH 54/57] tools/libs: create Makefile.common to be used by stubdom build system Anthony PERARD
@ 2021-12-07 14:57   ` Juergen Gross
  0 siblings, 0 replies; 115+ messages in thread
From: Juergen Gross @ 2021-12-07 14:57 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel
  Cc: Anthony PERARD, Ian Jackson, Wei Liu, Samuel Thibault


[-- Attachment #1.1.1: Type: text/plain, Size: 491 bytes --]

On 06.12.21 18:02, Anthony PERARD wrote:
> This new "Makefile.common" is intended to be used by both tools/ and
> stubdom/ build system without stubdom needed to use tools/ build
> system.
> 
> It should contain the necessary list of objects and CFLAGS needed to
> build a static library.
> 
> Change stubdom/ to check Makefile.common, for the linkfarm.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [XEN PATCH 55/57] tools/xenstore: introduce Makefile.common to be used by stubdom
  2021-12-06 17:02 ` [XEN PATCH 55/57] tools/xenstore: introduce Makefile.common to be used by stubdom Anthony PERARD
@ 2021-12-07 14:58   ` Juergen Gross
  0 siblings, 0 replies; 115+ messages in thread
From: Juergen Gross @ 2021-12-07 14:58 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel
  Cc: Anthony PERARD, Ian Jackson, Wei Liu, Samuel Thibault


[-- Attachment #1.1.1: Type: text/plain, Size: 222 bytes --]

On 06.12.21 18:02, Anthony PERARD wrote:
> Also change stubdom to depends on Makefile.common.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [XEN PATCH 52/57] stubdom: only build libxen*.a from tools/libs/
  2021-12-06 17:02 ` [XEN PATCH 52/57] stubdom: only build libxen*.a from tools/libs/ Anthony PERARD
@ 2021-12-11 23:47   ` Samuel Thibault
  0 siblings, 0 replies; 115+ messages in thread
From: Samuel Thibault @ 2021-12-11 23:47 UTC (permalink / raw)
  To: Anthony PERARD; +Cc: xen-devel, Anthony PERARD, Ian Jackson, Wei Liu

Anthony PERARD, le lun. 06 déc. 2021 17:02:35 +0000, a ecrit:
> Avoid generating *.map files or running headers.chk when all we need
> is the libxen*.a.
> 
> Also, allow force make to check again if libxen*.a needs rebuilt by
> adding a '.PHONY' prerequisite.
> 
> Also, remove DESTDIR= as we don't do installation in this target, so
> the value of DESTDIR doesn't matter.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

> ---
>  stubdom/Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/stubdom/Makefile b/stubdom/Makefile
> index ccfcf5b75f..5fb5dbc341 100644
> --- a/stubdom/Makefile
> +++ b/stubdom/Makefile
> @@ -354,8 +354,8 @@ define BUILD_lib
>   .PHONY: libxen$(1) clean-libxen$(1)
>   libxen$(1): libs-$$(XEN_TARGET_ARCH)/$(1)/libxen$(1).a
>   libs-$$(XEN_TARGET_ARCH)/$(1)/libxen$(1).a: $$(LIBDEPS_$(1)) $$(LIBDEP_$(1))
> - libs-$$(XEN_TARGET_ARCH)/$(1)/libxen$(1).a: mk-headers-$$(XEN_TARGET_ARCH) $$(NEWLIB_STAMPFILE)
> -	CPPFLAGS="$$(TARGET_CPPFLAGS)" CFLAGS="$$(TARGET_CFLAGS)" $$(MAKE) DESTDIR= CONFIG_LIBXC_MINIOS=y -C libs-$$(XEN_TARGET_ARCH)/$(1)
> + libs-$$(XEN_TARGET_ARCH)/$(1)/libxen$(1).a: mk-headers-$$(XEN_TARGET_ARCH) $$(NEWLIB_STAMPFILE) .phony
> +	CPPFLAGS="$$(TARGET_CPPFLAGS)" CFLAGS="$$(TARGET_CFLAGS)" $$(MAKE) CONFIG_LIBXC_MINIOS=y -C $$(@D) $$(@F)
>  
>   clean-libxen$(1):
>  	[ ! -e libs-$$(XEN_TARGET_ARCH)/$(1)/Makefile ] || $$(MAKE) DESTDIR= -C libs-$$(XEN_TARGET_ARCH)/$(1) clean
> -- 
> Anthony PERARD
> 


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

* Re: [XEN PATCH 53/57] stubdom: introduce xenlibs.mk
  2021-12-06 17:02 ` [XEN PATCH 53/57] stubdom: introduce xenlibs.mk Anthony PERARD
@ 2021-12-11 23:49   ` Samuel Thibault
  0 siblings, 0 replies; 115+ messages in thread
From: Samuel Thibault @ 2021-12-11 23:49 UTC (permalink / raw)
  To: Anthony PERARD; +Cc: xen-devel, Anthony PERARD, Ian Jackson, Wei Liu

Anthony PERARD, le lun. 06 déc. 2021 17:02:36 +0000, a ecrit:
> This new makefile will be used to build libraries that provides
> "Makefile.common".
> 
> At some point, we will be converting Makefile in tools/ to "subdirmk"
> and stubdom build will not be able to use those new makefiles, so we
> will put the necessary information for stubdom to build the xen
> libraries into a new Makefile.common and xenlibs.mk will use it.
> We only need to build static libraries and don't need anything else.
> 
> The check for the presence of "Makefile.common" will go aways once
> there is one for all libraries used by stubdom build.
> 
> Also remove DESTDIR= from "clean" targets, we don't do installation in
> this recipe so the value of DESTDIR doesn't matter.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

> ---
>  stubdom/xenlibs.mk | 13 +++++++++++++
>  stubdom/Makefile   |  9 +++++++--
>  2 files changed, 20 insertions(+), 2 deletions(-)
>  create mode 100644 stubdom/xenlibs.mk
> 
> diff --git a/stubdom/xenlibs.mk b/stubdom/xenlibs.mk
> new file mode 100644
> index 0000000000..5c8742ccf9
> --- /dev/null
> +++ b/stubdom/xenlibs.mk
> @@ -0,0 +1,13 @@
> +include $(XEN_ROOT)/tools/Rules.mk
> +
> +include Makefile.common
> +
> +LIBNAME := $(notdir $(CURDIR))
> +FILENAME_$(LIBNAME) ?= xen$(LIBNAME)
> +LIB_FILE_NAME = $(FILENAME_$(LIBNAME))
> +
> +lib$(LIB_FILE_NAME).a: $(OBJS-y)
> +	$(AR) rc $@ $^
> +
> +clean::
> +	rm -f $(OBJS-y) lib$(LIB_FILE_NAME).a
> diff --git a/stubdom/Makefile b/stubdom/Makefile
> index 5fb5dbc341..fba4c977ef 100644
> --- a/stubdom/Makefile
> +++ b/stubdom/Makefile
> @@ -346,6 +346,7 @@ define do_links
>    cd $(dir $@); \
>    ln -sf $(dir $<)include/*.h include/; \
>    ln -sf $(dir $<)*.[ch] .; \
> +  [ -e $(dir $<)Makefile.common ] && ln -sf $(dir $<)Makefile.common . ||:; \
>    ln -sf $(dir $<)Makefile .
>    touch $@
>  endef
> @@ -355,10 +356,14 @@ define BUILD_lib
>   libxen$(1): libs-$$(XEN_TARGET_ARCH)/$(1)/libxen$(1).a
>   libs-$$(XEN_TARGET_ARCH)/$(1)/libxen$(1).a: $$(LIBDEPS_$(1)) $$(LIBDEP_$(1))
>   libs-$$(XEN_TARGET_ARCH)/$(1)/libxen$(1).a: mk-headers-$$(XEN_TARGET_ARCH) $$(NEWLIB_STAMPFILE) .phony
> -	CPPFLAGS="$$(TARGET_CPPFLAGS)" CFLAGS="$$(TARGET_CFLAGS)" $$(MAKE) CONFIG_LIBXC_MINIOS=y -C $$(@D) $$(@F)
> +	CPPFLAGS="$$(TARGET_CPPFLAGS)" CFLAGS="$$(TARGET_CFLAGS)" $$(MAKE) CONFIG_LIBXC_MINIOS=y $$(if $$(wildcard $$(@D)/Makefile.common),-f $(CURDIR)/xenlibs.mk) -C $$(@D) $$(@F)
>  
>   clean-libxen$(1):
> -	[ ! -e libs-$$(XEN_TARGET_ARCH)/$(1)/Makefile ] || $$(MAKE) DESTDIR= -C libs-$$(XEN_TARGET_ARCH)/$(1) clean
> +	if [ -e libs-$$(XEN_TARGET_ARCH)/$(1)/Makefile.common ]; then \
> +	    $$(MAKE) -f $(CURDIR)/xenlibs.mk -C libs-$$(XEN_TARGET_ARCH)/$(1) clean; \
> +	elif [ -e libs-$$(XEN_TARGET_ARCH)/$(1)/Makefile ]; then \
> +	    $$(MAKE) -C libs-$$(XEN_TARGET_ARCH)/$(1) clean; \
> +	fi
>  
>   libs-$$(XEN_TARGET_ARCH)/$(1)/stamp: $$(XEN_ROOT)/tools/libs/$(1)/Makefile
>  	$$(do_links)
> -- 
> Anthony PERARD
> 

-- 
Samuel
<y> update-menus: relocation error: update-menus: symbol _ZNSt9basic_iosIcSt11char_traitsIcEE4initEPSt15basic_streambufIcS1_E, version GLIBCPP_3.2 not defined in file libstdc++.so.5 with link time reference
<y> quoi que ça peut bien vouloir dire ?
<D> N a eu la meme merde
<y> c ça que ça veut dire ? wow, c'est bien crypté :)
 -+- #ens-mim s'entraide -+-


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

* Re: [XEN PATCH 56/57] stubdom: build xenstore*-stubdom using new Makefile.common
  2021-12-06 17:02 ` [XEN PATCH 56/57] stubdom: build xenstore*-stubdom using new Makefile.common Anthony PERARD
@ 2021-12-11 23:51   ` Samuel Thibault
  0 siblings, 0 replies; 115+ messages in thread
From: Samuel Thibault @ 2021-12-11 23:51 UTC (permalink / raw)
  To: Anthony PERARD; +Cc: xen-devel, Anthony PERARD, Ian Jackson, Wei Liu

Anthony PERARD, le lun. 06 déc. 2021 17:02:39 +0000, a ecrit:
> Makefile.common have everything needed by stubdom, when used with
> xenlibs.mk, so we don't need "Makefile" anymore.
> 
> Also, remove DESTDIR for "xenstore" related targets, "xenlibs.mk"
> doesn't use DESTDIR so its value doesn't matter.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

> ---
>  stubdom/Makefile | 15 ++++++---------
>  1 file changed, 6 insertions(+), 9 deletions(-)
> 
> diff --git a/stubdom/Makefile b/stubdom/Makefile
> index 6b804824ba..1fa075b9ad 100644
> --- a/stubdom/Makefile
> +++ b/stubdom/Makefile
> @@ -346,8 +346,7 @@ define do_links
>    cd $(dir $@); \
>    ln -sf $(dir $<)include/*.h include/; \
>    ln -sf $(dir $<)*.[ch] .; \
> -  [ -e $(dir $<)Makefile.common ] && ln -sf $(dir $<)Makefile.common . ||:; \
> -  ln -sf $(dir $<)Makefile .
> +  ln -sf $(dir $<)Makefile.common .
>    touch $@
>  endef
>  
> @@ -356,13 +355,11 @@ define BUILD_lib
>   libxen$(1): libs-$$(XEN_TARGET_ARCH)/$(1)/libxen$(1).a
>   libs-$$(XEN_TARGET_ARCH)/$(1)/libxen$(1).a: $$(LIBDEPS_$(1)) $$(LIBDEP_$(1))
>   libs-$$(XEN_TARGET_ARCH)/$(1)/libxen$(1).a: mk-headers-$$(XEN_TARGET_ARCH) $$(NEWLIB_STAMPFILE) .phony
> -	CPPFLAGS="$$(TARGET_CPPFLAGS)" CFLAGS="$$(TARGET_CFLAGS)" $$(MAKE) CONFIG_LIBXC_MINIOS=y $$(if $$(wildcard $$(@D)/Makefile.common),-f $(CURDIR)/xenlibs.mk) -C $$(@D) $$(@F)
> +	CPPFLAGS="$$(TARGET_CPPFLAGS)" CFLAGS="$$(TARGET_CFLAGS)" $$(MAKE) CONFIG_LIBXC_MINIOS=y -f $(CURDIR)/xenlibs.mk -C $$(@D) $$(@F)
>  
>   clean-libxen$(1):
>  	if [ -e libs-$$(XEN_TARGET_ARCH)/$(1)/Makefile.common ]; then \
>  	    $$(MAKE) -f $(CURDIR)/xenlibs.mk -C libs-$$(XEN_TARGET_ARCH)/$(1) clean; \
> -	elif [ -e libs-$$(XEN_TARGET_ARCH)/$(1)/Makefile ]; then \
> -	    $$(MAKE) -C libs-$$(XEN_TARGET_ARCH)/$(1) clean; \
>  	fi
>  
>   libs-$$(XEN_TARGET_ARCH)/$(1)/stamp: $$(XEN_ROOT)/tools/libs/$(1)/Makefile.common
> @@ -494,7 +491,7 @@ xenstore-minios-config.mk: $(CURDIR)/xenstore-minios.cfg
>  
>  .PHONY: xenstore
>  xenstore: $(CROSS_ROOT) xenstore-minios-config.mk
> -	CPPFLAGS="$(TARGET_CPPFLAGS) $(shell cat xenstore-minios-config.mk)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ xenstored.a CONFIG_STUBDOM=y
> +	CPPFLAGS="$(TARGET_CPPFLAGS) $(shell cat xenstore-minios-config.mk)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -f $(CURDIR)/xenlibs.mk -C $@ xenstored.a CONFIG_STUBDOM=y
>  
>  #############
>  # xenstorepvh
> @@ -505,7 +502,7 @@ xenstorepvh-minios-config.mk: $(CURDIR)/xenstorepvh-minios.cfg
>  
>  .PHONY: xenstorepvh
>  xenstorepvh: $(CROSS_ROOT) xenstorepvh-minios-config.mk
> -	CPPFLAGS="$(TARGET_CPPFLAGS) $(shell cat xenstorepvh-minios-config.mk)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ xenstored.a CONFIG_STUBDOM=y
> +	CPPFLAGS="$(TARGET_CPPFLAGS) $(shell cat xenstorepvh-minios-config.mk)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -f $(CURDIR)/xenlibs.mk -C $@ xenstored.a CONFIG_STUBDOM=y
>  
>  ########
>  # minios
> @@ -657,8 +654,8 @@ clean:
>  	rm -f *-minios-config.mk
>  	rm -fr pkg-config
>  	-[ ! -d ioemu ] || $(MAKE) DESTDIR= -C ioemu clean
> -	-[ ! -d xenstore ] || $(MAKE) DESTDIR= -C xenstore clean
> -	-[ ! -d xenstorepvh ] || $(MAKE) DESTDIR= -C xenstorepvh clean
> +	-[ ! -d xenstore ] || $(MAKE) -f $(CURDIR)/xenlibs.mk -C xenstore clean
> +	-[ ! -d xenstorepvh ] || $(MAKE) -f $(CURDIR)/xenlibs.mk -C xenstorepvh clean
>  
>  # clean the cross-compilation result
>  .PHONY: crossclean
> -- 
> Anthony PERARD
> 

-- 
Samuel
Now I know someone out there is going to claim, "Well then, UNIX is intuitive,
because you only need to learn 5000 commands, and then everything else follows
from that! Har har har!"
(Andy Bates in comp.os.linux.misc, on "intuitive interfaces", slightly
defending Macs.)


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

* Re: [XEN PATCH 57/57] stubdom: xenlibs linkfarm, ignore non-regular files
  2021-12-06 17:02 ` [XEN PATCH 57/57] stubdom: xenlibs linkfarm, ignore non-regular files Anthony PERARD
@ 2021-12-11 23:53   ` Samuel Thibault
  0 siblings, 0 replies; 115+ messages in thread
From: Samuel Thibault @ 2021-12-11 23:53 UTC (permalink / raw)
  To: Anthony PERARD; +Cc: xen-devel, Anthony PERARD, Ian Jackson, Wei Liu

Anthony PERARD, le lun. 06 déc. 2021 17:02:40 +0000, a ecrit:
> When we will convert tools/ build system, their will be a need to
> replace some use of "vpath". This will done making symbolic links.
> Those symlinks are not wanted by stubdom build system when making a
> linkfarm for the Xen libraries. To avoid them, we will use `find`
> instead of plain shell globbing.
> 
> For example, there will be a link to "xen/lib/x86/cpuid.o" in
> "tools/libs/guest/".
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

> ---
>  stubdom/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/stubdom/Makefile b/stubdom/Makefile
> index 1fa075b9ad..b312f710cd 100644
> --- a/stubdom/Makefile
> +++ b/stubdom/Makefile
> @@ -345,7 +345,7 @@ define do_links
>    mkdir -p $(dir $@)include
>    cd $(dir $@); \
>    ln -sf $(dir $<)include/*.h include/; \
> -  ln -sf $(dir $<)*.[ch] .; \
> +  find $(dir $<) -maxdepth 1 -type f -name '*.[ch]' -exec ln -sf {} . \; ; \
>    ln -sf $(dir $<)Makefile.common .
>    touch $@
>  endef
> -- 
> Anthony PERARD
> 

-- 
Samuel
$ du temp.iso 
2,0T    temp.iso
$ ls temp.iso -l
-r-xr-xr-x    1 samy     thibault      16E 2003-03-22 14:44 temp.iso*
 -+- je vous dirai pas la marque de mon disque dur, na :p -+- 


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

* Re: [XEN PATCH 15/57] tools/libacpi: cleanup Makefile, don't check for iasl binary
  2021-12-06 17:01 ` [XEN PATCH 15/57] tools/libacpi: cleanup Makefile, don't check for iasl binary Anthony PERARD
@ 2021-12-16 11:47   ` Andrew Cooper
  0 siblings, 0 replies; 115+ messages in thread
From: Andrew Cooper @ 2021-12-16 11:47 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel
  Cc: Anthony PERARD, Jan Beulich, Ian Jackson, Wei Liu

On 06/12/2021 17:01, Anthony PERARD wrote:
> iasl is been check for presence by ./configure, so this Makefile
> doesn't have to do it. Also start to use $(IASL) that ./configure
> generate.
>
> iasl hasn't been download by our build system for a while and the
> dependency on iasl is in the main xen.git README.
>
> Make use of $< in one rule instead of spelling the %.asl file again.
>
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>


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

* Re: [XEN PATCH 14/57] tools/flask/utils: remove unused variables/targets from Makefile
  2021-12-06 17:01 ` [XEN PATCH 14/57] tools/flask/utils: remove unused variables/targets from Makefile Anthony PERARD
@ 2021-12-16 12:35   ` Daniel P. Smith
  2021-12-16 12:36   ` Andrew Cooper
  1 sibling, 0 replies; 115+ messages in thread
From: Daniel P. Smith @ 2021-12-16 12:35 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel
  Cc: Anthony PERARD, Daniel De Graaf, Ian Jackson, Wei Liu

On 12/6/21 12:01 PM, Anthony PERARD wrote:
> They are no *.opic or *.so in this subdir, so no need to clean them.
> 
> The TEST* variables doesn't seems to be used anywhere, and they weren't
> used by xen.git when introduced.
> Both CLIENTS_* variables aren't used.
> Both target "print-dir" and "print-end" only exist in this directory
> and are probably not used anywhere.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> ---

Reviewed-by: Daniel P. Smith <dpsmith@apertussolutions.com>


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

* Re: [XEN PATCH 14/57] tools/flask/utils: remove unused variables/targets from Makefile
  2021-12-06 17:01 ` [XEN PATCH 14/57] tools/flask/utils: remove unused variables/targets from Makefile Anthony PERARD
  2021-12-16 12:35   ` Daniel P. Smith
@ 2021-12-16 12:36   ` Andrew Cooper
  2021-12-21 17:00     ` Anthony PERARD
  1 sibling, 1 reply; 115+ messages in thread
From: Andrew Cooper @ 2021-12-16 12:36 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel
  Cc: Anthony PERARD, Daniel De Graaf, Daniel P. Smith, Ian Jackson, Wei Liu

On 06/12/2021 17:01, Anthony PERARD wrote:
> @@ -35,21 +29,13 @@ flask-set-bool: set-bool.o
>  
>  .PHONY: clean
>  clean: 
> -	rm -f *.o *.opic *.so
> +	rm -f *.o
>  	rm -f $(CLIENTS)
>  	$(RM) $(DEPS_RM)

Can we collapse this to $(RM) *.o $(CLIENTS) $(DEPS_RM) ?

Here and in plenty of subsequent patches, there's manipulation of raw
`rm -f`'s which ought to be cleaned up to $(RM)

I can fix this on commit if you're happy.

~Andrew


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

* Re: [XEN PATCH 16/57] tools/ocaml: Remove generation of _paths.h
  2021-12-06 17:01 ` [XEN PATCH 16/57] tools/ocaml: Remove generation of _paths.h Anthony PERARD
@ 2021-12-16 14:09   ` Andrew Cooper
  0 siblings, 0 replies; 115+ messages in thread
From: Andrew Cooper @ 2021-12-16 14:09 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel
  Cc: Anthony PERARD, Andrew Cooper, George Dunlap, Ian Jackson,
	Jan Beulich, Julien Grall, Stefano Stabellini, Wei Liu,
	Christian Lindig, David Scott

On 06/12/2021 17:01, Anthony PERARD wrote:
> _paths.h isn't useful anymore in systemd_stubs.
>
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

I poked Christian, who's looked at this and given it an ack.  For some
reason, he doesn't appear to have this email in his inbox.

~Andrew


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

* Re: [XEN PATCH 19/57] tools/configure.ac: Create ZLIB_LIBS and ZLIB_CFLAGS
  2021-12-06 17:02 ` [XEN PATCH 19/57] tools/configure.ac: Create ZLIB_LIBS and ZLIB_CFLAGS Anthony PERARD
  2021-12-07 10:20   ` Juergen Gross
@ 2021-12-16 17:16   ` Andrew Cooper
  2021-12-21 17:17     ` Anthony PERARD
  1 sibling, 1 reply; 115+ messages in thread
From: Andrew Cooper @ 2021-12-16 17:16 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel
  Cc: Anthony PERARD, Ian Jackson, Wei Liu, Juergen Gross

On 06/12/2021 17:02, Anthony PERARD wrote:
> diff --git a/tools/libs/guest/Makefile b/tools/libs/guest/Makefile
> index 8f5f3acd21..1f4b7f7c58 100644
> --- a/tools/libs/guest/Makefile
> +++ b/tools/libs/guest/Makefile
> @@ -103,8 +102,7 @@ NO_HEADERS_CHK := y
>  
>  include $(XEN_ROOT)/tools/libs/libs.mk
>  
> -libxenguest.so.$(MAJOR).$(MINOR): COMPRESSION_LIBS = $(filter -l%,$(zlib-options))
> -libxenguest.so.$(MAJOR).$(MINOR): APPEND_LDFLAGS += $(COMPRESSION_LIBS) -lz
> +libxenguest.so.$(MAJOR).$(MINOR): APPEND_LDFLAGS += $(ZLIB_LIBS) -lz

Looking ZLIB vs the other compression libs, shouldn't -lz be inside
$(ZLIB_LIBS) ?

Also, shouldn't this be LDLIBS rather than APPEND_LDFLAGS ?

~Andrew


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

* Re: [XEN PATCH 36/57] tools/xenstore: Cleanup makefile
  2021-12-06 17:02 ` [XEN PATCH 36/57] tools/xenstore: Cleanup makefile Anthony PERARD
  2021-12-07 11:21   ` Juergen Gross
@ 2021-12-16 17:19   ` Andrew Cooper
  2021-12-16 18:34   ` Andrew Cooper
  2 siblings, 0 replies; 115+ messages in thread
From: Andrew Cooper @ 2021-12-16 17:19 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel
  Cc: Anthony PERARD, Ian Jackson, Wei Liu, Juergen Gross, Julien Grall

On 06/12/2021 17:02, Anthony PERARD wrote:
> Regroup *FLAGS together, use $(LDLIBS).
>
> Remove $(LDLIBS_xenstored) which was the wrong name name as it doesn't
> decribe how to link to a potential libxenstored.so, instead add the
> value to $(LDLIBS) of xenstored.
>
> Add SYSTEMD_LIBS into $(LDLIBS) instead of $(LDFLAGS).
>
> Remove the "-I." from $(CFLAGS), it shouldn't be needed.
>
> Removed $(CFLAGS-y) and $(LDFLAGS-y). $(CFLAGS-y) is already included
> in $(CFLAGS) and both aren't used anyway.
>
> Rename ALL_TARGETS to TARGETS.
> Only add programmes we want to build in $(TARGETS), not phony-targets
> (replace "clients").
>
> Store all `xenstored` objs into $(XENSTORED_OBJS-y).
>
> Replace one $< by $^ even if there's only one dependency,
> (xenstore-control).
>
> clean: "init-xenstore-domain" isn't built here, so stop trying to
> remove it, remove $(TARGETS).

"isn't built here any more".  It was, until c/s 89bf86d1eb4a4

I'll tweak on commit.

~Andrew


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

* Re: [XEN PATCH 22/57] tools/console: have one Makefile per program/directory
  2021-12-06 17:02 ` [XEN PATCH 22/57] tools/console: have one Makefile per program/directory Anthony PERARD
@ 2021-12-16 17:26   ` Andrew Cooper
  2021-12-21 17:25     ` Anthony PERARD
  0 siblings, 1 reply; 115+ messages in thread
From: Andrew Cooper @ 2021-12-16 17:26 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel
  Cc: Anthony PERARD, Andrew Cooper, George Dunlap, Ian Jackson,
	Jan Beulich, Julien Grall, Stefano Stabellini, Wei Liu

On 06/12/2021 17:02, Anthony PERARD wrote:
> Sources of both xenconsoled and xenconsole are already separated into
> different directory and don't share anything in common. Having two
> different Makefile means it's easier to deal with *FLAGS.
>
> Some common changes:
> Rename $(BIN) to $(TARGETS), this will be useful later.
> Stop removing *.so *.rpm *.a as they aren't created here.
> Use $(OBJS-y) to list objects.
> Update $(CFLAGS) for the directory rather than a single object.
>
> daemon:
>     Remove the need for $(LDLIBS_xenconsoled), use $(LDLIBS) instead.
>     Remove the need for $(CONSOLE_CFLAGS-y) and use $(CFLAGS-y)
> 	instead.
>
> client:
>     Remove the unused $(LDLIBS_xenconsole)
>
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> ---
>  .gitignore                    |  4 +--
>  tools/console/Makefile        | 49 +++-------------------------------
>  tools/console/client/Makefile | 39 +++++++++++++++++++++++++++
>  tools/console/daemon/Makefile | 50 +++++++++++++++++++++++++++++++++++
>  4 files changed, 94 insertions(+), 48 deletions(-)
>  create mode 100644 tools/console/client/Makefile
>  create mode 100644 tools/console/daemon/Makefile
>
> diff --git a/.gitignore b/.gitignore
> index b39b996718..c31fa9b841 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -159,8 +159,8 @@ tools/libs/util/libxenutil.map
>  tools/libs/vchan/headers.chk
>  tools/libs/vchan/libxenvchan.map
>  tools/libs/vchan/xenvchan.pc
> -tools/console/xenconsole
> -tools/console/xenconsoled
> +tools/console/client/xenconsole
> +tools/console/daemon/xenconsoled

$ git ls-files -- :/ | grep gitignore
../.gitignore
../tools/fuzz/cpu-policy/.gitignore
../tools/libs/.gitignore
../tools/misc/.gitignore
../tools/tests/cpu-policy/.gitignore
../tools/tests/resource/.gitignore
../tools/tests/tsx/.gitignore
../tools/tests/vhpet/.gitignore
../tools/tests/xenstore/.gitignore
tools/kconfig/.gitignore
xsm/flask/.gitignore


We're starting to use per-dir gitignores, because it has far less
problematic behaviour for code movement.

I think we ought to take this opportunity to clean things up for the better.

> diff --git a/tools/console/client/Makefile b/tools/console/client/Makefile
> new file mode 100644
> index 0000000000..44176c6d93
> --- /dev/null
> +++ b/tools/console/client/Makefile
> @@ -0,0 +1,39 @@
> +XEN_ROOT=$(CURDIR)/../../..
> +include $(XEN_ROOT)/tools/Rules.mk
> +
> +CFLAGS += -Werror

-Werror really ought to come from somewhere common, seeing as we expect
it to be unilaterally set.

~Andrew


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

* Re: [XEN PATCH 24/57] tools/debugger/gdbsx: Fix and cleanup makefiles
  2021-12-06 17:02 ` [XEN PATCH 24/57] tools/debugger/gdbsx: Fix and cleanup makefiles Anthony PERARD
@ 2021-12-16 17:55   ` Andrew Cooper
  2021-12-21 17:30     ` Anthony PERARD
  0 siblings, 1 reply; 115+ messages in thread
From: Andrew Cooper @ 2021-12-16 17:55 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel
  Cc: Anthony PERARD, Elena Ufimtseva, Ian Jackson, Wei Liu

On 06/12/2021 17:02, Anthony PERARD wrote:
> diff --git a/tools/debugger/gdbsx/Makefile b/tools/debugger/gdbsx/Makefile
> index 8d7cd94a31..4aaf427c45 100644
> --- a/tools/debugger/gdbsx/Makefile
> +++ b/tools/debugger/gdbsx/Makefile
> @@ -28,7 +28,7 @@ uninstall:
>  gdbsx: gx/gx_all.a xg/xg_all.a 
>  	$(CC) $(LDFLAGS) -o $@ $^
>  
> -xg/xg_all.a:
> +xg/xg_all.a: FORCE
>  	$(MAKE) -C xg
> -gx/gx_all.a:
> +gx/gx_all.a: FORCE
>  	$(MAKE) -C gx

Shouldn't these be in the sub Make's ?

> diff --git a/tools/debugger/gdbsx/gx/Makefile b/tools/debugger/gdbsx/gx/Makefile
> index 3b8467f799..ff5c8e9e6e 100644
> --- a/tools/debugger/gdbsx/gx/Makefile
> +++ b/tools/debugger/gdbsx/gx/Makefile
> @@ -2,21 +2,20 @@ XEN_ROOT = $(CURDIR)/../../../..
>  include ../Rules.mk
>  
>  GX_OBJS := gx_comm.o gx_main.o gx_utils.o gx_local.o
> -GX_HDRS := $(wildcard *.h)
> +
> +TARGETS := gx_all.a
>  
>  .PHONY: all
> -all: gx_all.a
> +all: $(TARGETS)
>  
>  .PHONY: clean
>  clean:
> -	rm -rf gx_all.a *.o .*.d
> +	rm -f *.o $(TARGETS) $(DEPS_RM)

$(RM)

>  
>  .PHONY: distclean
>  distclean: clean
>  
> -#%.o: %.c $(GX_HDRS) Makefile
> -#	$(CC) -c $(CFLAGS) -o $@ $<
> -
> -gx_all.a: $(GX_OBJS) Makefile $(GX_HDRS)
> -	ar cr $@ $(GX_OBJS)        # problem with ld using -m32 
> +gx_all.a: $(GX_OBJS) Makefile
> +	ar cr $@ $(GX_OBJS)

There's probably an $(AR) we ought to be using.

~Andrew


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

* Re: [XEN PATCH 25/57] tools/examples: cleanup Makefile
  2021-12-06 17:02 ` [XEN PATCH 25/57] tools/examples: cleanup Makefile Anthony PERARD
@ 2021-12-16 17:57   ` Andrew Cooper
  2021-12-21 17:38     ` Anthony PERARD
  0 siblings, 1 reply; 115+ messages in thread
From: Andrew Cooper @ 2021-12-16 17:57 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel; +Cc: Anthony PERARD, Ian Jackson, Wei Liu

On 06/12/2021 17:02, Anthony PERARD wrote:
> diff --git a/tools/examples/Makefile b/tools/examples/Makefile
> index 14e24f4cb3..48b520e133 100644
> --- a/tools/examples/Makefile
> +++ b/tools/examples/Makefile
> @@ -26,10 +22,8 @@ uninstall: uninstall-readmes uninstall-configs
>  
>  .PHONY: install-readmes
>  install-readmes:
> -	[ -d $(DESTDIR)$(XEN_CONFIG_DIR) ] || \
> -		$(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)
> -	set -e; for i in $(XEN_READMES); \
> -	    do [ -e $(DESTDIR)$(XEN_CONFIG_DIR)/$$i ] || \
> +	$(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)
> +	set -e; for i in $(XEN_READMES); do \
>  	    $(INSTALL_DATA) $$i $(DESTDIR)$(XEN_CONFIG_DIR); \

Hmm.  Do we need a shell loop here at all?  Can't $(INSTALL_DATA) take
multiple $i's at the same time?

~Andrew


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

* Re: [XEN PATCH 26/57] tools/firmware/hvmloader: rework Makefile
  2021-12-06 17:02 ` [XEN PATCH 26/57] tools/firmware/hvmloader: rework Makefile Anthony PERARD
@ 2021-12-16 18:03   ` Andrew Cooper
  2021-12-21 17:45     ` Anthony PERARD
  0 siblings, 1 reply; 115+ messages in thread
From: Andrew Cooper @ 2021-12-16 18:03 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel
  Cc: Anthony PERARD, Jan Beulich, Andrew Cooper, Roger Pau Monné,
	Wei Liu, Ian Jackson

On 06/12/2021 17:02, Anthony PERARD wrote:
> Setup proper dependencies with libacpi so we don't need to run "make
> hvmloader" in the "all" target. ("build.o" new prerequisite isn't
> exactly proper but a side effect of building the $(DSDT_FILES) is to
> generate the "ssdt_*.h" needed by "build.o".)
>
> Make use if "-iquote" instead of a plain "-I".

So I've read up on what this means, but is it really that important in
the grand scheme of things?

Can't we actually make our problems go away by turning libacpi into a
real static library?  (Also, the "kill hvmloader plans" will turn
libacpi back into only having one single user, so that too)

~Andrew


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

* Re: [XEN PATCH 34/57] tools/xcutils: rework Makefile
  2021-12-06 17:02 ` [XEN PATCH 34/57] tools/xcutils: rework Makefile Anthony PERARD
@ 2021-12-16 18:20   ` Andrew Cooper
  0 siblings, 0 replies; 115+ messages in thread
From: Andrew Cooper @ 2021-12-16 18:20 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel; +Cc: Anthony PERARD, Ian Jackson, Wei Liu

On 06/12/2021 17:02, Anthony PERARD wrote:
> Use TARGETS to collect targets to build
>
> Remove "build" target.
>
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> ---
>  tools/xcutils/Makefile | 15 ++++++---------
>  1 file changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/tools/xcutils/Makefile b/tools/xcutils/Makefile
> index 82d42624c8..198be22a5a 100644
> --- a/tools/xcutils/Makefile
> +++ b/tools/xcutils/Makefile
> @@ -11,7 +11,7 @@
>  XEN_ROOT	= $(CURDIR)/../..
>  include $(XEN_ROOT)/tools/Rules.mk
>  
> -PROGRAMS = readnotes lsevtchn
> +TARGETS := readnotes lsevtchn

(For the future, because I'll commit this patch nowish)

We have at least

tools/xcutils
tools/misc
tools/helpers

of "misc random crap".  We ought to consolidate, and rethink which
binaries get installed where, because there is no coherent logic for
which end up on $PATH by default, and which don't.

~Andrew


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

* Re: [XEN PATCH 35/57] tools/xenpaging: Rework makefile
  2021-12-06 17:02 ` [XEN PATCH 35/57] tools/xenpaging: Rework makefile Anthony PERARD
@ 2021-12-16 18:25   ` Andrew Cooper
  0 siblings, 0 replies; 115+ messages in thread
From: Andrew Cooper @ 2021-12-16 18:25 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel; +Cc: Anthony PERARD, Ian Jackson, Wei Liu

On 06/12/2021 17:02, Anthony PERARD wrote:
> @@ -39,6 +39,6 @@ distclean: clean
>  
>  .PHONY: TAGS
>  TAGS:
> -	etags -t $(SRCS) *.h
> +	etags -t *.c *.h

/local/xen.git/xen$ git grep -w TAGS: -- :/
../tools/libs/libs.mk:129:TAGS:
../tools/xenpaging/Makefile:41:TAGS:
../tools/xenstore/Makefile:102:TAGS:
Makefile:487:TAGS:

Facilities like this ought to be organised by tools/Makefile, or perhaps
even the root Makefile.

~Andrew


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

* Re: [XEN PATCH 36/57] tools/xenstore: Cleanup makefile
  2021-12-06 17:02 ` [XEN PATCH 36/57] tools/xenstore: Cleanup makefile Anthony PERARD
  2021-12-07 11:21   ` Juergen Gross
  2021-12-16 17:19   ` Andrew Cooper
@ 2021-12-16 18:34   ` Andrew Cooper
  2021-12-17  5:24     ` Juergen Gross
  2 siblings, 1 reply; 115+ messages in thread
From: Andrew Cooper @ 2021-12-16 18:34 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel
  Cc: Anthony PERARD, Ian Jackson, Wei Liu, Juergen Gross, Julien Grall

On 06/12/2021 17:02, Anthony PERARD wrote:
> Regroup *FLAGS together, use $(LDLIBS).
>
> Remove $(LDLIBS_xenstored) which was the wrong name name as it doesn't
> decribe how to link to a potential libxenstored.so, instead add the
> value to $(LDLIBS) of xenstored.
>
> Add SYSTEMD_LIBS into $(LDLIBS) instead of $(LDFLAGS).
>
> Remove the "-I." from $(CFLAGS), it shouldn't be needed.
>
> Removed $(CFLAGS-y) and $(LDFLAGS-y). $(CFLAGS-y) is already included
> in $(CFLAGS) and both aren't used anyway.
>
> Rename ALL_TARGETS to TARGETS.
> Only add programmes we want to build in $(TARGETS), not phony-targets
> (replace "clients").
>
> Store all `xenstored` objs into $(XENSTORED_OBJS-y).
>
> Replace one $< by $^ even if there's only one dependency,
> (xenstore-control).
>
> clean: "init-xenstore-domain" isn't built here, so stop trying to
> remove it, remove $(TARGETS).
>
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> ---
>  tools/xenstore/Makefile | 81 ++++++++++++++++++++++-------------------
>  1 file changed, 44 insertions(+), 37 deletions(-)
>
> diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
> index 292b478fa1..7fe1d9c1e2 100644
> --- a/tools/xenstore/Makefile
> +++ b/tools/xenstore/Makefile
> @@ -5,7 +5,6 @@ MAJOR = 3.0
>  MINOR = 3

Actually, shouldn't this MAJOR/MINOR be dropped now that libxenstore
moved to tools/libs ?

It's definitely wrong now, seeing as we bumped to 4.0 for Xen 4.16.

>  
>  CFLAGS += -Werror
> -CFLAGS += -I.
>  # Include configure output (config.h)
>  CFLAGS += -include $(XEN_ROOT)/tools/config.h
>  CFLAGS += -I./include
> @@ -16,36 +15,53 @@ CFLAGS += $(CFLAGS_libxentoolcore)
>  CFLAGS += -DXEN_LIB_STORED="\"$(XEN_LIB_STORED)\""
>  CFLAGS += -DXEN_RUN_STORED="\"$(XEN_RUN_STORED)\""
>  
> -CFLAGS  += $(CFLAGS-y)
> -LDFLAGS += $(LDFLAGS-y)
> +ifdef CONFIG_STUBDOM
> +CFLAGS += -DNO_SOCKETS=1
> +endif
>  
> -CLIENTS := xenstore-exists xenstore-list xenstore-read xenstore-rm xenstore-chmod
> -CLIENTS += xenstore-write xenstore-ls xenstore-watch
> +XENSTORED_OBJS-y := xenstored_core.o xenstored_watch.o xenstored_domain.o
> +XENSTORED_OBJS-y += xenstored_transaction.o xenstored_control.o
> +XENSTORED_OBJS-y += xs_lib.o talloc.o utils.o tdb.o hashtable.o
>  
> -XENSTORED_OBJS = xenstored_core.o xenstored_watch.o xenstored_domain.o
> -XENSTORED_OBJS += xenstored_transaction.o xenstored_control.o
> -XENSTORED_OBJS += xs_lib.o talloc.o utils.o tdb.o hashtable.o
> +XENSTORED_OBJS-$(CONFIG_Linux) += xenstored_posix.o
> +XENSTORED_OBJS-$(CONFIG_SunOS) += xenstored_solaris.o xenstored_posix.o xenstored_probes.o
> +XENSTORED_OBJS-$(CONFIG_NetBSD) += xenstored_posix.o
> +XENSTORED_OBJS-$(CONFIG_FreeBSD) += xenstored_posix.o
> +XENSTORED_OBJS-$(CONFIG_MiniOS) += xenstored_minios.o
>  
> -XENSTORED_OBJS_$(CONFIG_Linux) = xenstored_posix.o
> -XENSTORED_OBJS_$(CONFIG_SunOS) = xenstored_solaris.o xenstored_posix.o xenstored_probes.o
> -XENSTORED_OBJS_$(CONFIG_NetBSD) = xenstored_posix.o
> -XENSTORED_OBJS_$(CONFIG_FreeBSD) = xenstored_posix.o
> -XENSTORED_OBJS_$(CONFIG_MiniOS) = xenstored_minios.o
> +$(XENSTORED_OBJS-y): CFLAGS += $(CFLAGS_libxengnttab)
>  
> -XENSTORED_OBJS += $(XENSTORED_OBJS_y)
> -LDLIBS_xenstored += -lrt
> +xenstored: LDLIBS += $(LDLIBS_libxenevtchn)
> +xenstored: LDLIBS += $(LDLIBS_libxengnttab)
> +xenstored: LDLIBS += $(LDLIBS_libxenctrl)
> +xenstored: LDLIBS += -lrt
> +xenstored: LDLIBS += $(SOCKET_LIBS)
>  
> -ALL_TARGETS = clients
> -ifeq ($(XENSTORE_XENSTORED),y)
> -ALL_TARGETS += xs_tdb_dump xenstored
> +ifeq ($(CONFIG_SYSTEMD),y)
> +$(XENSTORED_OBJS-y): CFLAGS += $(SYSTEMD_CFLAGS)
> +xenstored: LDLIBS += $(SYSTEMD_LIBS)
>  endif
>  
> -ifdef CONFIG_STUBDOM
> -CFLAGS += -DNO_SOCKETS=1
> +xenstore: LDLIBS += $(LDLIBS_libxenstore)
> +xenstore: LDLIBS += $(LDLIBS_libxentoolcore)
> +xenstore: LDLIBS += $(SOCKET_LIBS)
> +
> +xenstore-control: LDLIBS += $(LDLIBS_libxenstore)
> +xenstore-control: LDLIBS += $(LDLIBS_libxenctrl)
> +xenstore-control: LDLIBS += $(LDLIBS_libxenguest)
> +xenstore-control: LDLIBS += $(LDLIBS_libxentoolcore)
> +xenstore-control: LDLIBS += $(SOCKET_LIBS)
> +
> +CLIENTS := xenstore-exists xenstore-list xenstore-read xenstore-rm xenstore-chmod
> +CLIENTS += xenstore-write xenstore-ls xenstore-watch
> +
> +TARGETS := xenstore $(CLIENTS) xenstore-control
> +ifeq ($(XENSTORE_XENSTORED),y)
> +TARGETS += xs_tdb_dump xenstored
>  endif
>  
>  .PHONY: all
> -all: $(ALL_TARGETS)
> +all: $(TARGETS)
>  
>  .PHONY: clients
>  clients: xenstore $(CLIENTS) xenstore-control
> @@ -62,37 +78,28 @@ xenstored_probes.o: xenstored_solaris.o

Urgh - there's a mess in here.

the `dtrace` line has trailing whitespace, but xenstored_probes.d is
going to be clobbered by the dependency file logic.

Given this is utterly broken, perhaps better to drop the CONFIG_SunOS
chunk entirely?

>  CFLAGS += -DHAVE_DTRACE=1
>  endif
>  
> -ifeq ($(CONFIG_SYSTEMD),y)
> -$(XENSTORED_OBJS): CFLAGS += $(SYSTEMD_CFLAGS)
> -xenstored: LDFLAGS += $(SYSTEMD_LIBS)
> -endif
> -
> -$(XENSTORED_OBJS): CFLAGS += $(CFLAGS_libxengnttab)
> -
> -xenstored: $(XENSTORED_OBJS)
> -	$(CC) $^ $(LDFLAGS) $(LDLIBS_libxenevtchn) $(LDLIBS_libxengnttab) $(LDLIBS_libxenctrl) $(LDLIBS_xenstored) $(SOCKET_LIBS) -o $@ $(APPEND_LDFLAGS)
> +xenstored: $(XENSTORED_OBJS-y)
> +	$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@ $(APPEND_LDFLAGS)
>  
> -xenstored.a: $(XENSTORED_OBJS)
> +xenstored.a: $(XENSTORED_OBJS-y)
>  	$(AR) cr $@ $^
>  
>  $(CLIENTS): xenstore
>  	ln -f xenstore $@
>  
>  xenstore: xenstore_client.o xs_lib.o
> -	$(CC) $^ $(LDFLAGS) $(LDLIBS_libxenstore) $(LDLIBS_libxentoolcore) $(SOCKET_LIBS) -o $@ $(APPEND_LDFLAGS)
> +	$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@ $(APPEND_LDFLAGS)
>  
>  xenstore-control: xenstore_control.o
> -	$(CC) $< $(LDFLAGS) $(LDLIBS_libxenstore) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxentoolcore) $(SOCKET_LIBS) -o $@ $(APPEND_LDFLAGS)
> +	$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@ $(APPEND_LDFLAGS)
>  
>  xs_tdb_dump: xs_tdb_dump.o utils.o tdb.o talloc.o
> -	$(CC) $^ $(LDFLAGS) -o $@ $(APPEND_LDFLAGS)
> +	$(CC) $(LDFLAGS) $^ -o $@ $(APPEND_LDFLAGS)
>  
>  .PHONY: clean
>  clean:
>  	rm -f *.a *.o xenstored_probes.h

This header file looks wonky to be cleaning.

> -	rm -f xenstored
> -	rm -f xs_tdb_dump xenstore-control init-xenstore-domain
> -	rm -f xenstore $(CLIENTS)
> +	rm -f $(TARGETS)
>  	$(RM) $(DEPS_RM)
>  
>  .PHONY: distclean

There is some abuse lower down too.  Another local TAGS, but also a
tarball rule too, and we probably don't want to be using .SECONDARY:
right at the bottom.

~Andrew


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

* Re: [XEN PATCH 37/57] tools/xentop: rework makefile
  2021-12-06 17:02 ` [XEN PATCH 37/57] tools/xentop: rework makefile Anthony PERARD
@ 2021-12-16 18:36   ` Andrew Cooper
  0 siblings, 0 replies; 115+ messages in thread
From: Andrew Cooper @ 2021-12-16 18:36 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel; +Cc: Anthony PERARD, Ian Jackson, Wei Liu

On 06/12/2021 17:02, Anthony PERARD wrote:
> diff --git a/tools/xentop/Makefile b/tools/xentop/Makefile
> index 0034114684..1e52b29b37 100644
> --- a/tools/xentop/Makefile
> +++ b/tools/xentop/Makefile
> @@ -13,24 +13,23 @@
>  XEN_ROOT=$(CURDIR)/../..
>  include $(XEN_ROOT)/tools/Rules.mk
>  
> -ifneq ($(XENSTAT_XENTOP),y)
> -.PHONY: all install xentop uninstall
> -all install xentop uninstall:
> -else
> -
>  CFLAGS += -DGCC_PRINTF -Werror $(CFLAGS_libxenstat)
>  LDLIBS += $(LDLIBS_libxenstat) $(CURSES_LIBS) $(TINFO_LIBS) $(SOCKET_LIBS) -lm
>  CFLAGS += -DHOST_$(XEN_OS)
>  
>  # Include configure output (config.h)
>  CFLAGS += -include $(XEN_ROOT)/tools/config.h
> -LDFLAGS += $(APPEND_LDFLAGS)
> +
> +TARGETS := xentop
>  
>  .PHONY: all
> -all: xentop
> +all: $(TARGETS)
> +
> +xentop: xentop.o
> +	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS) $(APPEND_LDFLAGS)
>  
>  .PHONY: install
> -install: xentop
> +install: all
>  	$(INSTALL_DIR) $(DESTDIR)$(sbindir)
>  	$(INSTALL_PROG) xentop $(DESTDIR)$(sbindir)/xentop

$(TARGETS) ?

>  
> @@ -38,11 +37,9 @@ install: xentop
>  uninstall:
>  	rm -f $(DESTDIR)$(sbindir)/xentop
>  
> -endif
> -
>  .PHONY: clean
>  clean:
> -	rm -f xentop xentop.o $(DEPS_RM)
> +	rm -f $(TARGETS) xentop.o $(DEPS_RM)

$(RM) *.o ?

~Andrew

>  
>  .PHONY: distclean
>  distclean: clean



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

* Re: [XEN PATCH 38/57] tools/xenstrace: rework Makefile
  2021-12-06 17:02 ` [XEN PATCH 38/57] tools/xenstrace: rework Makefile Anthony PERARD
@ 2021-12-16 18:38   ` Andrew Cooper
  0 siblings, 0 replies; 115+ messages in thread
From: Andrew Cooper @ 2021-12-16 18:38 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel
  Cc: Anthony PERARD, George Dunlap, Ian Jackson, Wei Liu

On 06/12/2021 17:02, Anthony PERARD wrote:
>  .PHONY: install
> -install: build
> +install: all
>  	$(INSTALL_DIR) $(DESTDIR)$(bindir)
>  	$(INSTALL_DIR) $(DESTDIR)$(sbindir)
>  	[ -z "$(LIBBIN)" ] || $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)

Doesn't this conditional mkdir want to be dropped?

~Andrew


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

* Re: [XEN PATCH 47/57] libs/stat: Fix and rework python-bindings build
  2021-12-06 17:02 ` [XEN PATCH 47/57] libs/stat: Fix and rework python-bindings build Anthony PERARD
  2021-12-07 14:45   ` Juergen Gross
@ 2021-12-16 18:47   ` Andrew Cooper
  2021-12-21 18:03     ` Anthony PERARD
  1 sibling, 1 reply; 115+ messages in thread
From: Andrew Cooper @ 2021-12-16 18:47 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel
  Cc: Anthony PERARD, Ian Jackson, Wei Liu, Juergen Gross

On 06/12/2021 17:02, Anthony PERARD wrote:
> Fix the dependency on the library, $(SHLIB) variable doesn't exist
> anymore.
>
> Rework dependency on the include file, we can let `swig` generate the
> dependency for us with the use of "-M*" flags.

Hmm.  At no point is swig mentioned in README/etc, and it's not in any
of the CI logic.  I wasn't even aware that we had python bindings here.

Unless someone tries and confirms them not to be broken, I'd be tempted
to drop it all.  I bet this has been dead since we dropped Xend.

~Andrew


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

* Re: [XEN PATCH 50/57] tools/Rules.mk: Cleanup %.pc rules
  2021-12-06 17:02 ` [XEN PATCH 50/57] tools/Rules.mk: Cleanup %.pc rules Anthony PERARD
@ 2021-12-16 18:51   ` Andrew Cooper
  0 siblings, 0 replies; 115+ messages in thread
From: Andrew Cooper @ 2021-12-16 18:51 UTC (permalink / raw)
  To: Anthony PERARD, xen-devel; +Cc: Anthony PERARD, Ian Jackson, Wei Liu

On 06/12/2021 17:02, Anthony PERARD wrote:
> PKG_CONFIG_VARS isn't used anymore.

isn't set any more, so is dead logic.

Will tweak on commit.

~Andrew


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

* Re: [XEN PATCH 36/57] tools/xenstore: Cleanup makefile
  2021-12-16 18:34   ` Andrew Cooper
@ 2021-12-17  5:24     ` Juergen Gross
  0 siblings, 0 replies; 115+ messages in thread
From: Juergen Gross @ 2021-12-17  5:24 UTC (permalink / raw)
  To: Andrew Cooper, Anthony PERARD, xen-devel
  Cc: Anthony PERARD, Ian Jackson, Wei Liu, Julien Grall


[-- Attachment #1.1.1: Type: text/plain, Size: 5704 bytes --]

On 16.12.21 19:34, Andrew Cooper wrote:
> On 06/12/2021 17:02, Anthony PERARD wrote:
>> Regroup *FLAGS together, use $(LDLIBS).
>>
>> Remove $(LDLIBS_xenstored) which was the wrong name name as it doesn't
>> decribe how to link to a potential libxenstored.so, instead add the
>> value to $(LDLIBS) of xenstored.
>>
>> Add SYSTEMD_LIBS into $(LDLIBS) instead of $(LDFLAGS).
>>
>> Remove the "-I." from $(CFLAGS), it shouldn't be needed.
>>
>> Removed $(CFLAGS-y) and $(LDFLAGS-y). $(CFLAGS-y) is already included
>> in $(CFLAGS) and both aren't used anyway.
>>
>> Rename ALL_TARGETS to TARGETS.
>> Only add programmes we want to build in $(TARGETS), not phony-targets
>> (replace "clients").
>>
>> Store all `xenstored` objs into $(XENSTORED_OBJS-y).
>>
>> Replace one $< by $^ even if there's only one dependency,
>> (xenstore-control).
>>
>> clean: "init-xenstore-domain" isn't built here, so stop trying to
>> remove it, remove $(TARGETS).
>>
>> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
>> ---
>>   tools/xenstore/Makefile | 81 ++++++++++++++++++++++-------------------
>>   1 file changed, 44 insertions(+), 37 deletions(-)
>>
>> diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
>> index 292b478fa1..7fe1d9c1e2 100644
>> --- a/tools/xenstore/Makefile
>> +++ b/tools/xenstore/Makefile
>> @@ -5,7 +5,6 @@ MAJOR = 3.0
>>   MINOR = 3
> 
> Actually, shouldn't this MAJOR/MINOR be dropped now that libxenstore
> moved to tools/libs ?

Yes, you are right. They should be dropped.

> 
> It's definitely wrong now, seeing as we bumped to 4.0 for Xen 4.16.
> 
>>   
>>   CFLAGS += -Werror
>> -CFLAGS += -I.
>>   # Include configure output (config.h)
>>   CFLAGS += -include $(XEN_ROOT)/tools/config.h
>>   CFLAGS += -I./include
>> @@ -16,36 +15,53 @@ CFLAGS += $(CFLAGS_libxentoolcore)
>>   CFLAGS += -DXEN_LIB_STORED="\"$(XEN_LIB_STORED)\""
>>   CFLAGS += -DXEN_RUN_STORED="\"$(XEN_RUN_STORED)\""
>>   
>> -CFLAGS  += $(CFLAGS-y)
>> -LDFLAGS += $(LDFLAGS-y)
>> +ifdef CONFIG_STUBDOM
>> +CFLAGS += -DNO_SOCKETS=1
>> +endif
>>   
>> -CLIENTS := xenstore-exists xenstore-list xenstore-read xenstore-rm xenstore-chmod
>> -CLIENTS += xenstore-write xenstore-ls xenstore-watch
>> +XENSTORED_OBJS-y := xenstored_core.o xenstored_watch.o xenstored_domain.o
>> +XENSTORED_OBJS-y += xenstored_transaction.o xenstored_control.o
>> +XENSTORED_OBJS-y += xs_lib.o talloc.o utils.o tdb.o hashtable.o
>>   
>> -XENSTORED_OBJS = xenstored_core.o xenstored_watch.o xenstored_domain.o
>> -XENSTORED_OBJS += xenstored_transaction.o xenstored_control.o
>> -XENSTORED_OBJS += xs_lib.o talloc.o utils.o tdb.o hashtable.o
>> +XENSTORED_OBJS-$(CONFIG_Linux) += xenstored_posix.o
>> +XENSTORED_OBJS-$(CONFIG_SunOS) += xenstored_solaris.o xenstored_posix.o xenstored_probes.o
>> +XENSTORED_OBJS-$(CONFIG_NetBSD) += xenstored_posix.o
>> +XENSTORED_OBJS-$(CONFIG_FreeBSD) += xenstored_posix.o
>> +XENSTORED_OBJS-$(CONFIG_MiniOS) += xenstored_minios.o
>>   
>> -XENSTORED_OBJS_$(CONFIG_Linux) = xenstored_posix.o
>> -XENSTORED_OBJS_$(CONFIG_SunOS) = xenstored_solaris.o xenstored_posix.o xenstored_probes.o
>> -XENSTORED_OBJS_$(CONFIG_NetBSD) = xenstored_posix.o
>> -XENSTORED_OBJS_$(CONFIG_FreeBSD) = xenstored_posix.o
>> -XENSTORED_OBJS_$(CONFIG_MiniOS) = xenstored_minios.o
>> +$(XENSTORED_OBJS-y): CFLAGS += $(CFLAGS_libxengnttab)
>>   
>> -XENSTORED_OBJS += $(XENSTORED_OBJS_y)
>> -LDLIBS_xenstored += -lrt
>> +xenstored: LDLIBS += $(LDLIBS_libxenevtchn)
>> +xenstored: LDLIBS += $(LDLIBS_libxengnttab)
>> +xenstored: LDLIBS += $(LDLIBS_libxenctrl)
>> +xenstored: LDLIBS += -lrt
>> +xenstored: LDLIBS += $(SOCKET_LIBS)
>>   
>> -ALL_TARGETS = clients
>> -ifeq ($(XENSTORE_XENSTORED),y)
>> -ALL_TARGETS += xs_tdb_dump xenstored
>> +ifeq ($(CONFIG_SYSTEMD),y)
>> +$(XENSTORED_OBJS-y): CFLAGS += $(SYSTEMD_CFLAGS)
>> +xenstored: LDLIBS += $(SYSTEMD_LIBS)
>>   endif
>>   
>> -ifdef CONFIG_STUBDOM
>> -CFLAGS += -DNO_SOCKETS=1
>> +xenstore: LDLIBS += $(LDLIBS_libxenstore)
>> +xenstore: LDLIBS += $(LDLIBS_libxentoolcore)
>> +xenstore: LDLIBS += $(SOCKET_LIBS)
>> +
>> +xenstore-control: LDLIBS += $(LDLIBS_libxenstore)
>> +xenstore-control: LDLIBS += $(LDLIBS_libxenctrl)
>> +xenstore-control: LDLIBS += $(LDLIBS_libxenguest)
>> +xenstore-control: LDLIBS += $(LDLIBS_libxentoolcore)
>> +xenstore-control: LDLIBS += $(SOCKET_LIBS)
>> +
>> +CLIENTS := xenstore-exists xenstore-list xenstore-read xenstore-rm xenstore-chmod
>> +CLIENTS += xenstore-write xenstore-ls xenstore-watch
>> +
>> +TARGETS := xenstore $(CLIENTS) xenstore-control
>> +ifeq ($(XENSTORE_XENSTORED),y)
>> +TARGETS += xs_tdb_dump xenstored
>>   endif
>>   
>>   .PHONY: all
>> -all: $(ALL_TARGETS)
>> +all: $(TARGETS)
>>   
>>   .PHONY: clients
>>   clients: xenstore $(CLIENTS) xenstore-control
>> @@ -62,37 +78,28 @@ xenstored_probes.o: xenstored_solaris.o
> 
> Urgh - there's a mess in here.
> 
> the `dtrace` line has trailing whitespace, but xenstored_probes.d is
> going to be clobbered by the dependency file logic.
> 
> Given this is utterly broken, perhaps better to drop the CONFIG_SunOS
> chunk entirely?

I've basically asking to do so since 5 years now. Last try wast last
year and the DilOS reply was:

   we have plans for XEN on 2021 year, but all depends on business needs
   and investments."

So the same as in 2016 (not there yet, but planning to do so):

   i have plans try to return back and look at latest Xen.

At least running xenstored in SunOS has been broken since years now, and
I'd like to suggest removing the CONFIG_SunOS parts from it (again).


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [XEN PATCH 14/57] tools/flask/utils: remove unused variables/targets from Makefile
  2021-12-16 12:36   ` Andrew Cooper
@ 2021-12-21 17:00     ` Anthony PERARD
  0 siblings, 0 replies; 115+ messages in thread
From: Anthony PERARD @ 2021-12-21 17:00 UTC (permalink / raw)
  To: Andrew Cooper
  Cc: xen-devel, Anthony PERARD, Daniel De Graaf, Daniel P. Smith,
	Ian Jackson, Wei Liu

On Thu, Dec 16, 2021 at 12:36:41PM +0000, Andrew Cooper wrote:
> On 06/12/2021 17:01, Anthony PERARD wrote:
> > @@ -35,21 +29,13 @@ flask-set-bool: set-bool.o
> >  
> >  .PHONY: clean
> >  clean: 
> > -	rm -f *.o *.opic *.so
> > +	rm -f *.o
> >  	rm -f $(CLIENTS)
> >  	$(RM) $(DEPS_RM)
> 
> Here and in plenty of subsequent patches, there's manipulation of raw
> `rm -f`'s which ought to be cleaned up to $(RM)

About using $(RM) or `rm -f`, I don't think we need to care if one or
the other is used in Makefiles, they needs to be equivalent or things
are going to fails. GNU make manual says that `rm` should exist,
especially when things like autoconf are used. For example our
./configure scrips is using `rm -f` and I don't think we can configure
that. So having RM configurable doesn't really serve any purpose.

Beyond that, using $(RM) is good in order to be consistent, and changing
"rm -f" to "$(RM)" is fine, I might not doing it myself or ask for it.

> I can fix this on commit if you're happy.

For the avoidance of doubt, yes, I'm happy with the patch that have been
committed.

Thanks,

-- 
Anthony PERARD


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

* Re: [XEN PATCH 19/57] tools/configure.ac: Create ZLIB_LIBS and ZLIB_CFLAGS
  2021-12-16 17:16   ` Andrew Cooper
@ 2021-12-21 17:17     ` Anthony PERARD
  0 siblings, 0 replies; 115+ messages in thread
From: Anthony PERARD @ 2021-12-21 17:17 UTC (permalink / raw)
  To: Andrew Cooper
  Cc: xen-devel, Anthony PERARD, Ian Jackson, Wei Liu, Juergen Gross

On Thu, Dec 16, 2021 at 05:16:05PM +0000, Andrew Cooper wrote:
> On 06/12/2021 17:02, Anthony PERARD wrote:
> > diff --git a/tools/libs/guest/Makefile b/tools/libs/guest/Makefile
> > index 8f5f3acd21..1f4b7f7c58 100644
> > --- a/tools/libs/guest/Makefile
> > +++ b/tools/libs/guest/Makefile
> > @@ -103,8 +102,7 @@ NO_HEADERS_CHK := y
> >  
> >  include $(XEN_ROOT)/tools/libs/libs.mk
> >  
> > -libxenguest.so.$(MAJOR).$(MINOR): COMPRESSION_LIBS = $(filter -l%,$(zlib-options))
> > -libxenguest.so.$(MAJOR).$(MINOR): APPEND_LDFLAGS += $(COMPRESSION_LIBS) -lz
> > +libxenguest.so.$(MAJOR).$(MINOR): APPEND_LDFLAGS += $(ZLIB_LIBS) -lz
> 
> Looking ZLIB vs the other compression libs, shouldn't -lz be inside
> $(ZLIB_LIBS) ?

I don't think so because -lz is also used by libxenhypfs for example,
and maybe go binding for libxl. It seems that the name of the variable
is misleading, as it seems that -lz is zlib but $ZLIB doesn't contain it
or anything that would be called zlib.

-lz is check explicitly by configure and fail if missing, while $ZLIB
can be empty.

> Also, shouldn't this be LDLIBS rather than APPEND_LDFLAGS ?

Yes, I think I'm doing that in a different patch.
    libs: rename LDUSELIBS to LDLIBS and use it instead of APPEND_LDFLAGS

Thanks,

-- 
Anthony PERARD


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

* Re: [XEN PATCH 22/57] tools/console: have one Makefile per program/directory
  2021-12-16 17:26   ` Andrew Cooper
@ 2021-12-21 17:25     ` Anthony PERARD
  0 siblings, 0 replies; 115+ messages in thread
From: Anthony PERARD @ 2021-12-21 17:25 UTC (permalink / raw)
  To: Andrew Cooper
  Cc: xen-devel, Anthony PERARD, Andrew Cooper, George Dunlap,
	Ian Jackson, Jan Beulich, Julien Grall, Stefano Stabellini,
	Wei Liu

On Thu, Dec 16, 2021 at 05:26:49PM +0000, Andrew Cooper wrote:
> On 06/12/2021 17:02, Anthony PERARD wrote:
> > Sources of both xenconsoled and xenconsole are already separated into
> > different directory and don't share anything in common. Having two
> > different Makefile means it's easier to deal with *FLAGS.
> >
> > Some common changes:
> > Rename $(BIN) to $(TARGETS), this will be useful later.
> > Stop removing *.so *.rpm *.a as they aren't created here.
> > Use $(OBJS-y) to list objects.
> > Update $(CFLAGS) for the directory rather than a single object.
> >
> > daemon:
> >     Remove the need for $(LDLIBS_xenconsoled), use $(LDLIBS) instead.
> >     Remove the need for $(CONSOLE_CFLAGS-y) and use $(CFLAGS-y)
> > 	instead.
> >
> > client:
> >     Remove the unused $(LDLIBS_xenconsole)
> >
> > Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> > ---
> >  .gitignore                    |  4 +--
> >  tools/console/Makefile        | 49 +++-------------------------------
> >  tools/console/client/Makefile | 39 +++++++++++++++++++++++++++
> >  tools/console/daemon/Makefile | 50 +++++++++++++++++++++++++++++++++++
> >  4 files changed, 94 insertions(+), 48 deletions(-)
> >  create mode 100644 tools/console/client/Makefile
> >  create mode 100644 tools/console/daemon/Makefile
> >
> > diff --git a/.gitignore b/.gitignore
> > index b39b996718..c31fa9b841 100644
> > --- a/.gitignore
> > +++ b/.gitignore
> > @@ -159,8 +159,8 @@ tools/libs/util/libxenutil.map
> >  tools/libs/vchan/headers.chk
> >  tools/libs/vchan/libxenvchan.map
> >  tools/libs/vchan/xenvchan.pc
> > -tools/console/xenconsole
> > -tools/console/xenconsoled
> > +tools/console/client/xenconsole
> > +tools/console/daemon/xenconsoled
> 
> $ git ls-files -- :/ | grep gitignore
> ../.gitignore
> ../tools/fuzz/cpu-policy/.gitignore
> ../tools/libs/.gitignore
> ../tools/misc/.gitignore
> ../tools/tests/cpu-policy/.gitignore
> ../tools/tests/resource/.gitignore
> ../tools/tests/tsx/.gitignore
> ../tools/tests/vhpet/.gitignore
> ../tools/tests/xenstore/.gitignore
> tools/kconfig/.gitignore
> xsm/flask/.gitignore
> 
> 
> We're starting to use per-dir gitignores, because it has far less
> problematic behaviour for code movement.

You mean "we", I don't think everyone agree we that yet ;-). They aren't
any "xen/.gitignore" yet, despite me trying to add one at some point.

> I think we ought to take this opportunity to clean things up for the better.

Sounds good to me, I'll make the change.

> > diff --git a/tools/console/client/Makefile b/tools/console/client/Makefile
> > new file mode 100644
> > index 0000000000..44176c6d93
> > --- /dev/null
> > +++ b/tools/console/client/Makefile
> > @@ -0,0 +1,39 @@
> > +XEN_ROOT=$(CURDIR)/../../..
> > +include $(XEN_ROOT)/tools/Rules.mk
> > +
> > +CFLAGS += -Werror
> 
> -Werror really ought to come from somewhere common, seeing as we expect
> it to be unilaterally set.

Yes. I think I'll also look at having "./configure --disable-werror" or
similar so -Werror could be easly disable, by for example someone
building an ancient release and not wanting to deal with warnings.

Thanks,

-- 
Anthony PERARD


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

* Re: [XEN PATCH 24/57] tools/debugger/gdbsx: Fix and cleanup makefiles
  2021-12-16 17:55   ` Andrew Cooper
@ 2021-12-21 17:30     ` Anthony PERARD
  0 siblings, 0 replies; 115+ messages in thread
From: Anthony PERARD @ 2021-12-21 17:30 UTC (permalink / raw)
  To: Andrew Cooper
  Cc: xen-devel, Anthony PERARD, Elena Ufimtseva, Ian Jackson, Wei Liu

On Thu, Dec 16, 2021 at 05:55:29PM +0000, Andrew Cooper wrote:
> On 06/12/2021 17:02, Anthony PERARD wrote:
> > diff --git a/tools/debugger/gdbsx/Makefile b/tools/debugger/gdbsx/Makefile
> > index 8d7cd94a31..4aaf427c45 100644
> > --- a/tools/debugger/gdbsx/Makefile
> > +++ b/tools/debugger/gdbsx/Makefile
> > @@ -28,7 +28,7 @@ uninstall:
> >  gdbsx: gx/gx_all.a xg/xg_all.a 
> >  	$(CC) $(LDFLAGS) -o $@ $^
> >  
> > -xg/xg_all.a:
> > +xg/xg_all.a: FORCE
> >  	$(MAKE) -C xg
> > -gx/gx_all.a:
> > +gx/gx_all.a: FORCE
> >  	$(MAKE) -C gx
> 
> Shouldn't these be in the sub Make's ?

No, this is how we tell make how to build some of the prerequisite
needed to build "gdbsx", we tell make that they are build in
sub-directory.

> > diff --git a/tools/debugger/gdbsx/gx/Makefile b/tools/debugger/gdbsx/gx/Makefile
> > -#%.o: %.c $(GX_HDRS) Makefile
> > -#	$(CC) -c $(CFLAGS) -o $@ $<
> > -
> > -gx_all.a: $(GX_OBJS) Makefile $(GX_HDRS)
> > -	ar cr $@ $(GX_OBJS)        # problem with ld using -m32 
> > +gx_all.a: $(GX_OBJS) Makefile
> > +	ar cr $@ $(GX_OBJS)
> 
> There's probably an $(AR) we ought to be using.

Yes, I'll look at that.

Thanks,

-- 
Anthony PERARD


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

* Re: [XEN PATCH 25/57] tools/examples: cleanup Makefile
  2021-12-16 17:57   ` Andrew Cooper
@ 2021-12-21 17:38     ` Anthony PERARD
  0 siblings, 0 replies; 115+ messages in thread
From: Anthony PERARD @ 2021-12-21 17:38 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: xen-devel, Anthony PERARD, Ian Jackson, Wei Liu

On Thu, Dec 16, 2021 at 05:57:43PM +0000, Andrew Cooper wrote:
> On 06/12/2021 17:02, Anthony PERARD wrote:
> > diff --git a/tools/examples/Makefile b/tools/examples/Makefile
> > index 14e24f4cb3..48b520e133 100644
> > --- a/tools/examples/Makefile
> > +++ b/tools/examples/Makefile
> > @@ -26,10 +22,8 @@ uninstall: uninstall-readmes uninstall-configs
> >  
> >  .PHONY: install-readmes
> >  install-readmes:
> > -	[ -d $(DESTDIR)$(XEN_CONFIG_DIR) ] || \
> > -		$(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)
> > -	set -e; for i in $(XEN_READMES); \
> > -	    do [ -e $(DESTDIR)$(XEN_CONFIG_DIR)/$$i ] || \
> > +	$(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)
> > +	set -e; for i in $(XEN_READMES); do \
> >  	    $(INSTALL_DATA) $$i $(DESTDIR)$(XEN_CONFIG_DIR); \
> 
> Hmm.  Do we need a shell loop here at all?  Can't $(INSTALL_DATA) take
> multiple $i's at the same time?

Probably, even if the only time they are multiple filed install by
INSTALL_DATA in our build system is when shell globing is involve.
So, it's probably fine to remove the loop.

Thanks,

-- 
Anthony PERARD


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

* Re: [XEN PATCH 26/57] tools/firmware/hvmloader: rework Makefile
  2021-12-16 18:03   ` Andrew Cooper
@ 2021-12-21 17:45     ` Anthony PERARD
  0 siblings, 0 replies; 115+ messages in thread
From: Anthony PERARD @ 2021-12-21 17:45 UTC (permalink / raw)
  To: Andrew Cooper
  Cc: xen-devel, Anthony PERARD, Jan Beulich, Andrew Cooper,
	Roger Pau Monné,
	Wei Liu, Ian Jackson

On Thu, Dec 16, 2021 at 06:03:54PM +0000, Andrew Cooper wrote:
> On 06/12/2021 17:02, Anthony PERARD wrote:
> > Setup proper dependencies with libacpi so we don't need to run "make
> > hvmloader" in the "all" target. ("build.o" new prerequisite isn't
> > exactly proper but a side effect of building the $(DSDT_FILES) is to
> > generate the "ssdt_*.h" needed by "build.o".)
> >
> > Make use if "-iquote" instead of a plain "-I".
> 
> So I've read up on what this means, but is it really that important in
> the grand scheme of things?

It something that Jan proposed to do in some cases in the hypervisor
build system. I thought it was something good to do so I start using
-iquote in the toolstack as well.

> Can't we actually make our problems go away by turning libacpi into a
> real static library?  (Also, the "kill hvmloader plans" will turn
> libacpi back into only having one single user, so that too)

Well, libacpi also have some headers that needs to be generated, so I'm
not sure which problem are going away when turning it into a static lib.
Also, I don't think hvmloader and libxl would want the same library.

Thanks,

-- 
Anthony PERARD


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

* Re: [XEN PATCH 41/57] libs: Remove need for *installlocal targets
  2021-12-07 13:20   ` Juergen Gross
@ 2021-12-21 17:59     ` Anthony PERARD
  0 siblings, 0 replies; 115+ messages in thread
From: Anthony PERARD @ 2021-12-21 17:59 UTC (permalink / raw)
  To: Juergen Gross; +Cc: xen-devel, Anthony PERARD, Ian Jackson, Wei Liu

On Tue, Dec 07, 2021 at 02:20:29PM +0100, Juergen Gross wrote:
> On 06.12.21 18:02, Anthony PERARD wrote:
> > There is no need for an extra "installlocal" target, we can use
> > double-colon rules instead.
> 
> Doesn't that mean that with the ultimate goal of including all
> Makefiles of the tree that all "install" and "uninstall" rules in the
> tree will have to be double-colon rules?

So, the install targets will be double-colon but for a different reason
(because of the framework been used). All the "install" target will
actually have different name, they will be prefixed by the name of the
directory where the Makefile is.

For example, "install" in "xl" will be named "xl/install", but there
will be something that will allow to run "make -C xl install" which will
call the rule "xl/install".

> With above remark I don't see how tools/libs/stat/Makefile can be left
> unmodified, as it includes libs.mk and it contains an "intall:" rule.

I've missed that one, just because ./configure doesn't allow to enable
the binding...

Thanks,

-- 
Anthony PERARD


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

* Re: [XEN PATCH 47/57] libs/stat: Fix and rework python-bindings build
  2021-12-16 18:47   ` Andrew Cooper
@ 2021-12-21 18:03     ` Anthony PERARD
  0 siblings, 0 replies; 115+ messages in thread
From: Anthony PERARD @ 2021-12-21 18:03 UTC (permalink / raw)
  To: Andrew Cooper
  Cc: xen-devel, Anthony PERARD, Ian Jackson, Wei Liu, Juergen Gross

On Thu, Dec 16, 2021 at 06:47:17PM +0000, Andrew Cooper wrote:
> On 06/12/2021 17:02, Anthony PERARD wrote:
> > Fix the dependency on the library, $(SHLIB) variable doesn't exist
> > anymore.
> >
> > Rework dependency on the include file, we can let `swig` generate the
> > dependency for us with the use of "-M*" flags.
> 
> Hmm.  At no point is swig mentioned in README/etc, and it's not in any
> of the CI logic.  I wasn't even aware that we had python bindings here.
> 
> Unless someone tries and confirms them not to be broken, I'd be tempted
> to drop it all.  I bet this has been dead since we dropped Xend.

How about the perl binding? Nothing to do with xend for them.

The only way to build the binding is to set a variable. It's not
possible to enable the binding via ./configure at the moment. So, yes,
maybe no one uses them.

Cheers,

-- 
Anthony PERARD


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

end of thread, other threads:[~2021-12-21 18:04 UTC | newest]

Thread overview: 115+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-06 17:01 [XEN PATCH 00/57] Toolstack build system improvement, toward non-recursive makefiles Anthony PERARD
2021-12-06 17:01 ` [XEN PATCH 01/57] .gitignore: Non existing toolcore/include files Anthony PERARD
2021-12-06 17:01 ` [XEN PATCH 02/57] tools/configure.ac: Remove left over system_aio Anthony PERARD
2021-12-06 17:01 ` [XEN PATCH 03/57] tools/Rules.mk: Remove $(CFLAGS.opic) from %.opic: %.S Anthony PERARD
2021-12-06 17:01 ` [XEN PATCH 04/57] libs: Remove _paths.h from libs ctrl and util Anthony PERARD
2021-12-07  7:43   ` Juergen Gross
2021-12-06 17:01 ` [XEN PATCH 05/57] libs: Remove -Iinclude from CFLAGS Anthony PERARD
2021-12-07  7:44   ` Juergen Gross
2021-12-06 17:01 ` [XEN PATCH 06/57] libs/libs.mk: Remove generic variable that already exist Anthony PERARD
2021-12-07  7:46   ` Juergen Gross
2021-12-06 17:01 ` [XEN PATCH 07/57] libs/guest: Drop spurious include in Makefile Anthony PERARD
2021-12-07  7:48   ` Juergen Gross
2021-12-06 17:01 ` [XEN PATCH 08/57] libs/light: Remove non-existing CFLAGS_libxl.o var Anthony PERARD
2021-12-07  7:49   ` Juergen Gross
2021-12-06 17:01 ` [XEN PATCH 09/57] libs/light: Remove -I Anthony PERARD
2021-12-07  7:59   ` Juergen Gross
2021-12-06 17:01 ` [XEN PATCH 10/57] libs/stat: Remove duplicated CFLAGS from deps Anthony PERARD
2021-12-07  8:01   ` Juergen Gross
2021-12-06 17:01 ` [XEN PATCH 11/57] libs/store: Remove PKG_CONFIG_REMOVE Anthony PERARD
2021-12-07  8:05   ` Juergen Gross
2021-12-06 17:01 ` [XEN PATCH 12/57] tools: remove some unneeded subdir-distclean-* targets Anthony PERARD
2021-12-06 17:01 ` [XEN PATCH 13/57] tools/firmware/hvmloader: remove "subdirs-*" prerequisite Anthony PERARD
2021-12-06 17:01 ` [XEN PATCH 14/57] tools/flask/utils: remove unused variables/targets from Makefile Anthony PERARD
2021-12-16 12:35   ` Daniel P. Smith
2021-12-16 12:36   ` Andrew Cooper
2021-12-21 17:00     ` Anthony PERARD
2021-12-06 17:01 ` [XEN PATCH 15/57] tools/libacpi: cleanup Makefile, don't check for iasl binary Anthony PERARD
2021-12-16 11:47   ` Andrew Cooper
2021-12-06 17:01 ` [XEN PATCH 16/57] tools/ocaml: Remove generation of _paths.h Anthony PERARD
2021-12-16 14:09   ` Andrew Cooper
2021-12-06 17:02 ` [XEN PATCH 17/57] tools/xl: Remove unnecessary -I. from CFLAGS Anthony PERARD
2021-12-06 17:02 ` [XEN PATCH 18/57] tools: Use config.h from autoconf instead of "buildmakevars2header" Anthony PERARD
2021-12-07 10:08   ` Juergen Gross
2021-12-07 10:49     ` Anthony PERARD
2021-12-07 10:53       ` Juergen Gross
2021-12-06 17:02 ` [XEN PATCH 19/57] tools/configure.ac: Create ZLIB_LIBS and ZLIB_CFLAGS Anthony PERARD
2021-12-07 10:20   ` Juergen Gross
2021-12-16 17:16   ` Andrew Cooper
2021-12-21 17:17     ` Anthony PERARD
2021-12-06 17:02 ` [XEN PATCH 20/57] tools/Rules.mk: introduce FORCE target Anthony PERARD
2021-12-07 10:54   ` Juergen Gross
2021-12-06 17:02 ` [XEN PATCH 21/57] tools/include/xen-foreign: avoid to rely on default .SUFFIXES Anthony PERARD
2021-12-06 17:02 ` [XEN PATCH 22/57] tools/console: have one Makefile per program/directory Anthony PERARD
2021-12-16 17:26   ` Andrew Cooper
2021-12-21 17:25     ` Anthony PERARD
2021-12-06 17:02 ` [XEN PATCH 23/57] tools/debugger: Allow make to recurse into debugger/ Anthony PERARD
2021-12-06 17:02 ` [XEN PATCH 24/57] tools/debugger/gdbsx: Fix and cleanup makefiles Anthony PERARD
2021-12-16 17:55   ` Andrew Cooper
2021-12-21 17:30     ` Anthony PERARD
2021-12-06 17:02 ` [XEN PATCH 25/57] tools/examples: cleanup Makefile Anthony PERARD
2021-12-16 17:57   ` Andrew Cooper
2021-12-21 17:38     ` Anthony PERARD
2021-12-06 17:02 ` [XEN PATCH 26/57] tools/firmware/hvmloader: rework Makefile Anthony PERARD
2021-12-16 18:03   ` Andrew Cooper
2021-12-21 17:45     ` Anthony PERARD
2021-12-06 17:02 ` [XEN PATCH 27/57] tools/fuzz/libelf: rework makefile Anthony PERARD
2021-12-06 17:02 ` [XEN PATCH 28/57] tools/fuzz/x86_instruction_emulator: " Anthony PERARD
2021-12-06 17:02 ` [XEN PATCH 29/57] tools/helper: Cleanup Makefile Anthony PERARD
2021-12-06 17:02 ` [XEN PATCH 30/57] tools/hotplug: cleanup Makefiles Anthony PERARD
2021-12-06 17:02 ` [XEN PATCH 31/57] tools/libfsimage: Cleanup makefiles Anthony PERARD
2021-12-06 17:02 ` [XEN PATCH 32/57] tools/misc: rework Makefile Anthony PERARD
2021-12-06 17:02 ` [XEN PATCH 33/57] tools/vchan: Collect targets in TARGETS Anthony PERARD
2021-12-06 17:02 ` [XEN PATCH 34/57] tools/xcutils: rework Makefile Anthony PERARD
2021-12-16 18:20   ` Andrew Cooper
2021-12-06 17:02 ` [XEN PATCH 35/57] tools/xenpaging: Rework makefile Anthony PERARD
2021-12-16 18:25   ` Andrew Cooper
2021-12-06 17:02 ` [XEN PATCH 36/57] tools/xenstore: Cleanup makefile Anthony PERARD
2021-12-07 11:21   ` Juergen Gross
2021-12-16 17:19   ` Andrew Cooper
2021-12-16 18:34   ` Andrew Cooper
2021-12-17  5:24     ` Juergen Gross
2021-12-06 17:02 ` [XEN PATCH 37/57] tools/xentop: rework makefile Anthony PERARD
2021-12-16 18:36   ` Andrew Cooper
2021-12-06 17:02 ` [XEN PATCH 38/57] tools/xenstrace: rework Makefile Anthony PERARD
2021-12-16 18:38   ` Andrew Cooper
2021-12-06 17:02 ` [XEN PATCH 39/57] libs: Remove both "libs" and "build" target Anthony PERARD
2021-12-07 12:14   ` Juergen Gross
2021-12-06 17:02 ` [XEN PATCH 40/57] libs: rename LDUSELIBS to LDLIBS and use it instead of APPEND_LDFLAGS Anthony PERARD
2021-12-07 12:17   ` Juergen Gross
2021-12-06 17:02 ` [XEN PATCH 41/57] libs: Remove need for *installlocal targets Anthony PERARD
2021-12-07 13:20   ` Juergen Gross
2021-12-21 17:59     ` Anthony PERARD
2021-12-06 17:02 ` [XEN PATCH 42/57] libs,tools/include: Clean "clean" targets Anthony PERARD
2021-12-07 13:21   ` Juergen Gross
2021-12-06 17:02 ` [XEN PATCH 43/57] libs: Rename $(SRCS-y) to $(OBJS-y) Anthony PERARD
2021-12-07 13:24   ` Juergen Gross
2021-12-06 17:02 ` [XEN PATCH 44/57] libs/guest: rename ELF_OBJS to LIBELF_OBJS Anthony PERARD
2021-12-07 13:26   ` Juergen Gross
2021-12-06 17:02 ` [XEN PATCH 45/57] libs/guest: rework CFLAGS Anthony PERARD
2021-12-07 13:29   ` Juergen Gross
2021-12-06 17:02 ` [XEN PATCH 46/57] libs/store: use of -iquote instead of -I Anthony PERARD
2021-12-07 13:30   ` Juergen Gross
2021-12-06 17:02 ` [XEN PATCH 47/57] libs/stat: Fix and rework python-bindings build Anthony PERARD
2021-12-07 14:45   ` Juergen Gross
2021-12-16 18:47   ` Andrew Cooper
2021-12-21 18:03     ` Anthony PERARD
2021-12-06 17:02 ` [XEN PATCH 48/57] libs/stat: Fix and rework perl-binding build Anthony PERARD
2021-12-07 14:46   ` Juergen Gross
2021-12-06 17:02 ` [XEN PATCH 49/57] libs/toolcore: don't install xentoolcore_internal.h anymore Anthony PERARD
2021-12-07 14:47   ` Juergen Gross
2021-12-06 17:02 ` [XEN PATCH 50/57] tools/Rules.mk: Cleanup %.pc rules Anthony PERARD
2021-12-16 18:51   ` Andrew Cooper
2021-12-06 17:02 ` [XEN PATCH 51/57] .gitignore: Cleanup ignores of tools/libs/*/{headers.chk,*.pc} Anthony PERARD
2021-12-06 17:02 ` [XEN PATCH 52/57] stubdom: only build libxen*.a from tools/libs/ Anthony PERARD
2021-12-11 23:47   ` Samuel Thibault
2021-12-06 17:02 ` [XEN PATCH 53/57] stubdom: introduce xenlibs.mk Anthony PERARD
2021-12-11 23:49   ` Samuel Thibault
2021-12-06 17:02 ` [XEN PATCH 54/57] tools/libs: create Makefile.common to be used by stubdom build system Anthony PERARD
2021-12-07 14:57   ` Juergen Gross
2021-12-06 17:02 ` [XEN PATCH 55/57] tools/xenstore: introduce Makefile.common to be used by stubdom Anthony PERARD
2021-12-07 14:58   ` Juergen Gross
2021-12-06 17:02 ` [XEN PATCH 56/57] stubdom: build xenstore*-stubdom using new Makefile.common Anthony PERARD
2021-12-11 23:51   ` Samuel Thibault
2021-12-06 17:02 ` [XEN PATCH 57/57] stubdom: xenlibs linkfarm, ignore non-regular files Anthony PERARD
2021-12-11 23:53   ` Samuel Thibault

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.