diff mbox series

[2/2] tools/x86: move arch-specific include/xen/ population into arch-specific rule

Message ID 0702c375-4769-7246-ba47-613ed69330e1@suse.com (mailing list archive)
State Superseded
Headers show
Series tools/x86: adjust populating of tools/include/xen/ | expand

Commit Message

Jan Beulich March 8, 2021, 9:22 a.m. UTC
There's no need for the common "xen-dir" rule to have an arch-specific
part when there already is a arch-specific rule where this can be taken
care of.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
I was tempted to also uniformly change the pattern from *autogen.h to
*-autogen.h right here - thoughts?

I was also tempted to move the "xen-dir" dependency from
all-$(CONFIG_X86) to the general all-y, but perhaps that's less related
and hence should really be a separate change (and there may also be
arguments against that).

Comments

Ian Jackson March 8, 2021, 10 a.m. UTC | #1
Jan Beulich writes ("[PATCH 2/2] tools/x86: move arch-specific include/xen/ population into arch-specific rule"):
> There's no need for the common "xen-dir" rule to have an arch-specific
> part when there already is a arch-specific rule where this can be taken
> care of.

I think the symlinks being made in this arch-specific code are more
logically part of the xen-dir target than part of the all target.

> I was tempted to also uniformly change the pattern from *autogen.h to
> *-autogen.h right here - thoughts?

I haven't read this in enough detail to know whether that's right, but
if it is right it is IMO preferable.

Thanks,
Ian.
Jan Beulich March 8, 2021, 10:08 a.m. UTC | #2
On 08.03.2021 11:00, Ian Jackson wrote:
> Jan Beulich writes ("[PATCH 2/2] tools/x86: move arch-specific include/xen/ population into arch-specific rule"):
>> There's no need for the common "xen-dir" rule to have an arch-specific
>> part when there already is a arch-specific rule where this can be taken
>> care of.
> 
> I think the symlinks being made in this arch-specific code are more
> logically part of the xen-dir target than part of the all target.

But that's true of what has been in all-$(CONFIG_X86) as well, isn't it?
It's all about populating xen/.

Jan
diff mbox series

Patch

--- a/tools/include/Makefile
+++ b/tools/include/Makefile
@@ -29,12 +29,6 @@  xen-dir: prep-y
 	ln -s ../xen-foreign xen/foreign
 	ln -s $(XEN_ROOT)/xen/include/acpi/platform acpi/
 	ln -s $(XEN_ROOT)/xen/include/acpi/ac*.h acpi/
-ifeq ($(CONFIG_X86),y)
-	ln -s $(XEN_ROOT)/xen/include/asm-x86 xen/asm
-	mkdir -p xen/lib/x86
-	ln -s $(filter-out %autogen.h,$(wildcard $(XEN_ROOT)/xen/include/xen/lib/x86/*.h)) xen/lib/x86/
-	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.
@@ -43,6 +37,10 @@  prep-$(CONFIG_X86):
 	test ! -d xen/lib/x86 || mv xen/lib/x86 .xen-lib-x86
 
 all-$(CONFIG_X86): xen-dir
+	ln -s $(XEN_ROOT)/xen/include/asm-x86 xen/asm
+	mkdir -p xen/lib/x86
+	ln -s $(filter-out %autogen.h,$(wildcard $(XEN_ROOT)/xen/include/xen/lib/x86/*.h)) xen/lib/x86/
+	ln -s $(XEN_ROOT)/xen/include/xen/lib/x86/Makefile xen/lib/x86/
 	$(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)