On 11.03.2024 09:59, Simone Ballarin wrote: > --- a/xen/build.mk > +++ b/xen/build.mk > @@ -45,6 +45,8 @@ asm-offsets.s: arch/$(SRCARCH)/$(ARCH)/asm-offsets.c > $(CC) $(call cpp_flags,$(c_flags)) -S -g0 -o $@.new -MQ $@ $< > $(call move-if-changed,$@.new,$@) > > +ARCHDIR = $(shell echo $(SRCARCH) | tr a-z A-Z)
Yet another instance? > --- a/xen/scripts/Makefile.asm-generic > +++ b/xen/scripts/Makefile.asm-generic > @@ -31,8 +31,22 @@ generated-y := $(addprefix $(obj)/, $(generated-y)) > old-headers := $(wildcard $(obj)/*.h) > unwanted := $(filter-out $(generic-y) $(generated-y),$(old-headers)) > > +define header_stub > +#ifndef ASM_GENERIC_$(3)_$(2)_H > +#define ASM_GENERIC_$(3)_$(2)_H > + > +#include <asm-generic/$(1).h> > + > +#endif /* ASM_GENERIC_$(3)_$(2)_H */ > +endef > + > +arch = $(shell echo $(SRCARCH) | tr a-z A-Z) And one more, in disguise - why not ARCHDIR here? > +header_body = $(call header_stub,$*,$(shell echo "$*" | tr a-z A-Z),$(arch)) > +export header_body This ought to be doable without involving a shell variable, I'd hope. But - this is a lot of effort just to ... > quiet_cmd_wrap = WRAP $@ > - cmd_wrap = echo "\#include <asm-generic/$*.h>" > $@ > + cmd_wrap = echo "$$header_body" > $@ ... deal with an innocent header consisting of just a single #include. Jan