]> xenbits.xensource.com Git - xen.git/commit
libxl: Generate golang bindings in libxl Makefile
authorGeorge Dunlap <george.dunlap@citrix.com>
Thu, 28 May 2020 11:20:53 +0000 (12:20 +0100)
committerGeorge Dunlap <george.dunlap@citrix.com>
Thu, 28 May 2020 11:20:53 +0000 (12:20 +0100)
commit60db5da62ac051aab0b217fa2d96acca1cd3ca3e
tree445b43e8c3601b24a6c9f0f780cc741957325757
parent724913de8ac8426d313a4645741d86c1169ae406
libxl: Generate golang bindings in libxl Makefile

The generated golang bindings (types.gen.go and helpers.gen.go) are
left checked in so that they can be fetched from xenbits using the
golang tooling.  This means that they must be updated whenever
libxl_types.idl (or other dependencies) are updated.  However, the
golang bindings are only built optionally; we can't assume that anyone
updating libxl_types.idl will also descend into the tools/golang tree
to re-generate the bindings.

Fix this by re-generating the golang bindings from the libxl Makefile
when the IDL dependencies are updated, so that anyone who updates
libxl_types.idl will also end up updating the golang generated files
as well.

 - Make a variable for the generated files, and a target in
   xenlight/Makefile which will only re-generate the files.

 - Add a target in libxl/Makefile to call external idl generation
   targets (currently only golang).

For ease of testing, also add a specific target in libxl/Makefile just
to check and update files generated from the IDL.

This does mean that there are two potential paths for generating the
files during a parallel build; but that shouldn't be an issue, since
tools/golang/xenlight should never be built until after tools/libxl
has completed building anyway.

Signed-off-by: George Dunlap <george.dunlap@citrix.com>
Reviewed-by: Nick Rosbrook <rosbrookn@ainfosec.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/golang/xenlight/Makefile
tools/libxl/Makefile