Skip to contentSkip to conversation

include: don't mention stub headers more than once in a make rule

PATCH In review Jan Beulich 2 participants 2 messages Mar 22, 2023 – Mar 27, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 include: don't mention stub headers more than once in a make rule

When !GRANT_TABLE and !PV_SHIM headers-n contains grant_table.h twice, causing make to complain "target '...' given more than once in the same rule" for the rule generating the stub headers. We don't need duplicate entries in headers-n anywhere, so zap them (by using $(sort ...)) right where the final value of the variable is constructed.

Fixes 6bec713f871f ("include/compat: produce stubs for headers not otherwise generated")
xen/include/Makefile +1 -1
@@ -34,7 +34,7 @@ headers-$(CONFIG_TRACEBUFFER) += compat/
 headers-$(CONFIG_XENOPROF) += compat/xenoprof.h
 headers-$(CONFIG_XSM_FLASK) += compat/xsm/flask_op.h
 
-headers-n := $(filter-out $(headers-y),$(headers-n) $(headers-))
+headers-n := $(sort $(filter-out $(headers-y),$(headers-n) $(headers-)))
 
 cppflags-y                := -include public/xen-compat.h -DXEN_GENERATING_COMPAT_HEADERS
 cppflags-$(CONFIG_X86)    += -m32
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Jan Beulich

When !GRANT_TABLE and !PV_SHIM headers-n contains grant_table.h twice, causing make to complain "target '...' given more than once in the same rule" for the rule generating the stub headers. We don't need duplicate entries in headers-n anywhere, so zap them (by using $(sort ...)) right where the final value of the variable is constructed.

Fixes 6bec713f871f ("include/compat: produce stubs for headers not otherwise generated")

Thanks,

Signature · 1 line
Anthony PERARD