On 07.09.2023 11:32, Oleksii Kurochko wrote: > --- /dev/null > +++ b/xen/scripts/Makefile.asm-generic > @@ -0,0 +1,53 @@ > +# SPDX-License-Identifier: GPL-2.0-only > +# include/asm-generic contains a lot of files that are used > +# verbatim by several architectures. > +# > +# This Makefile reads the file arch/$(SRCARCH)/include/asm/Makefile > +# and for each file listed in this file with generic-y creates > +# a small wrapper file in arch/$(SRCARCH)/include/generated/asm. > + > +PHONY := all > +all: > + > +src := $(subst /generated,,$(obj)) > + > +include $(srctree)/scripts/Kbuild.include > +-include $(src)/Makefile
With the definition of src above, is this correct for out-of-tree builds? You want to reference the Makefile in the source tree, ... > +redundant := $(filter $(mandatory-y) $(generated-y), $(generic-y)) > +redundant += $(foreach f, $(generic-y), $(if $(wildcard > $(srctree)/$(src)/$(f)),$(f))) ... much like $(srctree) is used here (and similarly again further down). Jan
