build: rework test/livepatch/Makefile
authorAnthony PERARD <anthony.perard@citrix.com>
Fri, 25 Feb 2022 09:55:30 +0000 (10:55 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 25 Feb 2022 09:55:30 +0000 (10:55 +0100)
commit27060920a79be3a12628e91212d6e21a9b4a2b76
tree82a0b5932775324588598860f4031d81dbd42daf
parent91fa912206d83518661062d70e6082a70eadb6ec
build: rework test/livepatch/Makefile

This rework the livepatch/Makefile to make it less repetitive and make
use of the facilities. All the targets to be built are now listed in
$(extra-y) which will allow Rules.mk to build them without the need of
a local target in a future patch.

There are some changes/fixes in this patch:
- when "xen-syms" is used for a target, it is added to the dependency
  list of the target, which allow to rebuild the target when xen-syms
  changes. But if "xen-syms" is missing, make simply fails.
- modinfo.o wasn't removing it's $@.bin file like the other targets,
  this is now done.
- The command to build *.livepatch targets as been fixed to use
  $(XEN_LDFLAGS) rather than just $(LDFLAGS) which is a fallout from
  2740d96efdd3 ("xen/build: have the root Makefile generates the
  CFLAGS")

make will findout the dependencies of the *.livepatch files and thus
what to built by "looking" at the objects listed in the *-objs
variables. The actual dependencies is generated by the new
"multi-depend" macro.

"$(targets)" needs to be updated with the objects listed in the
different *-objs variables to allow make to load the .*.cmd dependency
files.

This patch copies the macro "multi_depend" from Linux 5.12, and rename
it to "multi-depend".

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/scripts/Kbuild.include
xen/test/livepatch/Makefile