[PATCH v4 5/6] selftests/x86: support header files in extra-files

From: Bill Roberts

Date: Tue Sep 15 2026 - 15:28:40 EST


The Makefile dependencies do not include header files, and adding header
files to extra-files calls will cause the header to be passed to the
compiler to compile, which is not what we want. So filter out .h files
from EXTRA_FILES but keep them for the target's prerequisites.

Signed-off-by: Bill Roberts <bill.roberts@xxxxxxx>
---
tools/testing/selftests/x86/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile
index 75315f1190d6..ac181b065f37 100644
--- a/tools/testing/selftests/x86/Makefile
+++ b/tools/testing/selftests/x86/Makefile
@@ -114,7 +114,7 @@ endif
# the dependencies ("header3.h"), because clang, unlike gcc, will not accept
# header files as an input to the compiler invocation.
define extra-files
-$(OUTPUT)/$(1): EXTRA_FILES := $(2)
+$(OUTPUT)/$(1): EXTRA_FILES := $(filter-out %.h,$(2))
$(OUTPUT)/$(1): $(2)
endef

--
2.55.0