diff mbox series

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

Message ID e6bcfa87-aa12-97dd-23f4-d2f085e2e4f6@suse.com (mailing list archive)
State New, archived
Headers show
Series tools/x86: adjust populating of tools/include/xen/ | expand

Commit Message

Jan Beulich March 11, 2021, 2:40 p.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 (arguably instead of all-y this might better be xendir-y
anyway).

Also change the pattern from *autogen.h to *-autogen.h.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v2: Insert dash in pattern. Re-base over changed earlier patch.
---
I was 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 12, 2021, 10:24 a.m. UTC | #1
Jan Beulich writes ("[PATCH v2 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 (arguably instead of all-y this might better be xendir-y
> anyway).

Thanks, but I do not like this change.

IMO make commands should be primarily organised by their logical
function and role in the file.  If that means that multiple targets
have arch-specific parts, so be it.

IMO it is not right to move something from xen-dir to all just to
reduce the number of different targets with arch-specific parts.

Ian.
diff mbox series

Patch

--- a/tools/include/Makefile
+++ b/tools/include/Makefile
@@ -29,14 +29,12 @@  xen-dir:
 	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)
+
+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 $(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
-
-all-$(CONFIG_X86): xen-dir
 	$(MAKE) -C xen/lib/x86 all XEN_ROOT=$(XEN_ROOT) PYTHON=$(PYTHON)
 
 # Not xen/xsm as that clashes with link to