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

[xen staging] libs/light: Rework generation of include/_libxl_*.h



commit 68d19cfb90a5bb6257e03be3f21c912bac7ec49b
Author:     Anthony PERARD <anthony.perard@xxxxxxxxxx>
AuthorDate: Thu Oct 13 14:05:09 2022 +0100
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Fri Oct 14 20:56:57 2022 +0100

    libs/light: Rework generation of include/_libxl_*.h
    
    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>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Release-acked-by: Henry Wang <Henry.Wang@xxxxxxx>
---
 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 d84e5f3cd9..d681269229 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:
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

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