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

[PATCH 1/2][4.15?] tools/x86: don't rebuild cpuid-autogen.h every time



The first thing the "xen-dir" rule does is delete the entire xen/
subtree. Obviously this includes deleting xen/lib/x86/*autogen.h. As a
result there's no original version for $(move-if-changed ...) to compare
against, and hence the file and all its consumers would get rebuilt
every time. Introduce a "prep-y" rule to move xen/lib/x86/ on the side,
to then recover any *autogen.h from there prior to invoking the
respective recursive $(MAKE) invocation.

Fixes: eddf9559c977 ("libx86: generate cpuid-autogen.h in the libx86 include 
dir")
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/.gitignore
+++ b/.gitignore
@@ -234,6 +234,7 @@
 tools/hotplug/NetBSD/rc.d/xendriverdomain
 tools/include/acpi
 tools/include/_libxl*.h
+tools/include/.xen*/*
 tools/include/_xentoolcore_list.h
 tools/include/xen/*
 tools/include/xen-xsm/*
--- a/tools/include/Makefile
+++ b/tools/include/Makefile
@@ -10,15 +10,15 @@ include $(XEN_ROOT)/tools/Rules.mk
 # Relative to $(XEN_ROOT)/xen/xsm/flask
 FLASK_H_DEPEND := policy/initial_sids
 
-.PHONY: all all-y build xen-dir
+.PHONY: all all-y build prep-y xen-dir
 all build: all-y xen-foreign xen-dir xen-xsm/.dir
-all-y:
+all-y prep-y:
 
 .PHONY: xen-foreign
 xen-foreign:
        $(MAKE) -C xen-foreign
 
-xen-dir:
+xen-dir: prep-y
        @rm -rf xen acpi
        mkdir -p xen/libelf acpi
        ln -s $(XEN_ROOT)/xen/include/public/COPYING xen/
@@ -36,7 +36,15 @@ ifeq ($(CONFIG_X86),y)
        ln -s $(XEN_ROOT)/xen/include/xen/lib/x86/Makefile xen/lib/x86/
 endif
 
+# Arrange for preserving of auto-generated headers (to avoid them getting
+# rebuilt every time): Move the entire xen/lib/x86/ to a temporary place.
+prep-$(CONFIG_X86):
+       rm -rf .xen-lib-x86
+       test ! -d xen/lib/x86 || mv xen/lib/x86 .xen-lib-x86
+
 all-$(CONFIG_X86): xen-dir
+       $(if $(wildcard .xen-lib-x86/*autogen.h),mv .xen-lib-x86/*autogen.h 
xen/lib/x86/)
+       rm -rf .xen-lib-x86
        $(MAKE) -C xen/lib/x86 all XEN_ROOT=$(XEN_ROOT) PYTHON=$(PYTHON)
 
 # Not xen/xsm as that clashes with link to
@@ -78,7 +86,7 @@ uninstall:
 
 .PHONY: clean
 clean:
-       rm -rf xen xen-xsm acpi
+       rm -rf xen xen-xsm .xen* acpi
        $(MAKE) -C xen-foreign clean
 
 .PHONY: dist




 


Rackspace

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