[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XEN PATCH for-4.17 v5 13/17] libs/light: Rework generation of include/_libxl_*.h


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Thu, 13 Oct 2022 14:05:09 +0100
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Anthony PERARD <anthony.perard@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, "Juergen Gross" <jgross@xxxxxxxx>
  • Delivery-date: Thu, 13 Oct 2022 13:15:21 +0000
  • Ironport-data: A9a23:DAGtNqi4Qrx5uckmXImtJFX+X161ZRAKZh0ujC45NGQN5FlHY01je htvXz3XOfyKZDT2KYhwPImxpBkGsJDcmIBiHQc4/y48EXsb9cadCdqndUqhZCn6wu8v7q5Ex 55HNoSfdpBcolv0/ErF3m3J9CEkvU2wbuOgTrSCYkidfCc8IA85kxVvhuUltYBhhNm9Emult Mj75sbSIzdJ4RYtWo4vw//F+U4HUMja4mtC5AVmPKsT5TcyqlFOZH4hDfDpR5fHatE88t6SH 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KT1Q0 uUfGGkGUgLdtum08qyDWsdmmf12eaEHPKtH0p1h5TTQDPJgSpHfWaTao9Rf2V/chOgXQ6yYP ZBAL2MyMlKQOHWjOX9OYH46tO6umnn4dSwesF+PrLA7y2PS0BZwwP7mN9+9ltmiFZ8Pzh/G+ zKuE2LRXhcwaM2mwjq+zlWvq/PqxSziXd8IC+jtnhJtqALKnTFCYPEMbnO5ruO+kVWWQM9EJ gof/S9Ghbc23FymSJ/6RRLQiG6JuFsQVsRdF8U+6RqR0ezE7gCBHG8GQzVdLts8u6cLqScCj wHT2YmzXHo27ePTGSn1GqqoQS2aZTYyNGgyPCQ4X1U06NvRvrkjoBjQd4M2eEKqteHdFTb1y jGMiSExgbQPkMIGv5mGEUD7byGE/caQEFNsjunDdif8t14iOtb5D2C9wQKDhcusOrp1WbVoU JIsv8GFpN4DApiW/MBmaLVcRer5jxpp3dC1vLKOI3XD327wk5JAVdoKiN2bGKuOGpdsRNMRS BWP0T69HbcKVJdQUYd5YpiqF+MhxrX6GNLuW5j8N4QQP8YpLFffon43PyZ8OlwBd2B1yMkC1 WqzK57wXR7294w9pNZJewvt+eBynX1vrY8ibZv60w6mwdKjWZJhcp9caQPmUwzMxPnbyOkj2 4oAapDiJtQ2eLGWXxQ7BqZKcQBXcillW8qrwyGVH8baSjdb9KgaI6e56dscl0ZNxcy5Ss+gE qmBZ3Jl
  • Ironport-hdrordr: A9a23:ZiwMNaFA3YzsrB6TpLqE0MeALOsnbusQ8zAXP0AYc3Jom6uj5q aTdZUgpGfJYVkqOE3I9ertBEDEewK4yXcX2/h3AV7BZniEhILAFugLhuGO/9SjIVybygc079 YYT0EUMrzN5DZB4voSmDPIceod/A==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Instead of moving the public "_libxl_*.h" headers, we make a copy to
the destination so that make doesn't try to remake the targets
"_libxl_*.h" in libs/light/ again.

A new .PRECIOUS target is added to tell make to not deletes the
intermediate targets generated by "gentypes.py".

Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
---

Notes:
    v4:
    - new patch

 tools/libs/light/Makefile | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile
index 4a8b0f7bcf..9329055c98 100644
--- a/tools/libs/light/Makefile
+++ b/tools/libs/light/Makefile
@@ -215,6 +215,8 @@ libxl_internal_json.h: _libxl_types_internal_json.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
 
+# This exploits the 'multi-target pattern rule' trick.
+# gentypes.py should be executed only once to make all the targets.
 _libxl_type%.h _libxl_type%_json.h _libxl_type%_private.h _libxl_type%.c: 
libxl_type%.idl gentypes.py idl.py
        $(eval stem = $(notdir $*))
        $(PYTHON) gentypes.py libxl_type$(stem).idl __libxl_type$(stem).h 
__libxl_type$(stem)_private.h \
@@ -224,8 +226,10 @@ _libxl_type%.h _libxl_type%_json.h _libxl_type%_private.h 
_libxl_type%.c: libxl_
        $(call 
move-if-changed,__libxl_type$(stem)_json.h,_libxl_type$(stem)_json.h)
        $(call move-if-changed,__libxl_type$(stem).c,_libxl_type$(stem).c)
 
-$(XEN_INCLUDE)/_%.h: _%.h
-       $(call move-if-changed,_$*.h,$(XEN_INCLUDE)/_$*.h)
+.PRECIOUS: _libxl_type%.h _libxl_type%.c
+
+$(XEN_INCLUDE)/_libxl_%.h: _libxl_%.h
+       cp -f $< $@
 
 .PHONY: acpi
 acpi:
-- 
Anthony PERARD




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.