[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250401121830.21696-2-jani.nikula@intel.com>
Date: Tue, 1 Apr 2025 15:18:26 +0300
From: Jani Nikula <jani.nikula@...el.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>,
linux-kernel@...r.kernel.org
Cc: jani.nikula@...el.com,
Masahiro Yamada <masahiroy@...nel.org>,
David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>,
linux-kbuild@...r.kernel.org,
dri-devel@...ts.freedesktop.org,
intel-xe@...ts.freedesktop.org,
intel-gfx@...ts.freedesktop.org
Subject: [PATCH 1/5] drm: place header test files in .hdrtest subdirectories
The header tests track whether headers have been checked using empty
*.hdrtest files in the build tree. This pollutes the build directories,
as the files live in the same "name space" as the real output files,
messing with TAB completion among other things.
Hide the disgusting turds by placing them in .hdrtest subdirectories.
Change the quiet command output to simply $< instead of trying to decode
roughly the same from the increasingly complicated $@.
Note that it would be somewhat nicer to have the basename of the
.hdrtest files be dot-prefixed instead of using subdirectories. However,
it's challenging to come up with a pattern rule for that, as we can list
headers to test in the subdirectories of $(src) too, without requiring
Makefiles and kbuild to descend to each of them.
Reported-by: Linus Torvalds <torvalds@...ux-foundation.org>
Closes: https://lore.kernel.org/r/CAHk-=wjMrqzuUmH-mFbR_46EWEFS=bB=J7h9ABMVy56Vi81PKQ@mail.gmail.com
Fixes: 62ae45687e43 ("drm: ensure drm headers are self-contained and pass kernel-doc")
Cc: Masahiro Yamada <masahiroy@...nel.org>
Cc: David Airlie <airlied@...il.com>
Cc: Daniel Vetter <daniel@...ll.ch>
Signed-off-by: Jani Nikula <jani.nikula@...el.com>
---
Cc: linux-kbuild@...r.kernel.org
Cc: dri-devel@...ts.freedesktop.org
Cc: intel-xe@...ts.freedesktop.org
Cc: intel-gfx@...ts.freedesktop.org
---
drivers/gpu/drm/Makefile | 6 +++---
include/drm/Makefile | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index ed54a546bbe2..1666ea55bd24 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -230,14 +230,14 @@ hdrtest-files := \
$(shell cd $(src) && find display lib -name '*.h')
always-$(CONFIG_DRM_HEADER_TEST) += \
- $(patsubst %.h,%.hdrtest, $(hdrtest-files))
+ $(patsubst %.h,.hdrtest/%.hdrtest, $(hdrtest-files))
# Include the header twice to detect missing include guard.
-quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
+quiet_cmd_hdrtest = HDRTEST $<
cmd_hdrtest = \
$(CC) $(c_flags) -fsyntax-only -x c /dev/null -include $< -include $<; \
$(srctree)/scripts/kernel-doc -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \
touch $@
-$(obj)/%.hdrtest: $(src)/%.h FORCE
+$(obj)/.hdrtest/%.hdrtest: $(src)/%.h FORCE
$(call if_changed_dep,hdrtest)
diff --git a/include/drm/Makefile b/include/drm/Makefile
index a7bd15d2803e..a7593987909b 100644
--- a/include/drm/Makefile
+++ b/include/drm/Makefile
@@ -5,14 +5,14 @@ hdrtest-files := \
$(shell cd $(src) && find * -name '*.h' 2>/dev/null)
always-$(CONFIG_DRM_HEADER_TEST) += \
- $(patsubst %.h,%.hdrtest, $(hdrtest-files))
+ $(patsubst %.h,.hdrtest/%.hdrtest, $(hdrtest-files))
# Include the header twice to detect missing include guard.
-quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
+quiet_cmd_hdrtest = HDRTEST $<
cmd_hdrtest = \
$(CC) $(c_flags) -fsyntax-only -x c /dev/null -include $< -include $<; \
$(srctree)/scripts/kernel-doc -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \
touch $@
-$(obj)/%.hdrtest: $(src)/%.h FORCE
+$(obj)/.hdrtest/%.hdrtest: $(src)/%.h FORCE
$(call if_changed_dep,hdrtest)
--
2.39.5
Powered by blists - more mailing lists