On Fri, Feb 13, 2026 at 08:13:09PM +0100, Alejandro Vallejo wrote: > On Fri Feb 13, 2026 at 7:42 PM CET, Roger Pau Monné wrote: > >> >> diff --git a/xen/arch/x86/mm/Makefile b/xen/arch/x86/mm/Makefile > >> >> index 960f6e8409..64fde82c50 100644 > >> >> --- a/xen/arch/x86/mm/Makefile > >> >> +++ b/xen/arch/x86/mm/Makefile > >> >> @@ -1,4 +1,4 @@ > >> >> -obj-y += shadow/ > >> >> +obj-$(CONFIG_OPT_HAP) += shadow/ > >> > > >> > I think you can use: > >> > > >> > obj-$(findstring y,$(CONFIG_PV) $(CONFIG_SHADOW_PAGING)) += ... > >> > >> Hmmm. I guess I shouldn't just include it twice, like we do for other .o > >> files. > > > > I see, so use: > > > > obj-$(CONFIG_PV) += shadow/ > > obj-$(CONFIG_SHADOW_PAGING) += shadow/ > > > > Maybe that's simpler really, and it's a pattern we already use > > elsewhere. > > I meant them being folder with makefiles potentially doing things that should > only be done once. I don't know if we dedup tokens somewhere. These makefiles > are rather arcane.
I'm not a Makefile expert, so I might be wrong. We apply $(sort ...) in several places to remove duplicates, I would assume, I see: # Subdirectories we need to descend into subdir-y := $(sort $(subdir-y) $(patsubst %/,%,$(filter %/, $(obj-y)))) Which should remove any duplicated folders. I've tried the duplicated folder addition to obj-y and seems to build fine. Thanks, Roger.
