[LTP] [PATCH v2] Makefile: Fix module dirs search
Martin Doucha
mdoucha@suse.cz
Wed Aug 20 10:59:35 CEST 2025
Module dirs search runs relative to current working directory instead
of the source directory. In an out-of-tree build, the search for makefiles
will come up empty and grep will try to read from standard input, blocking
indefinitely. Search for makefiles relative to the source directory to fix
the issue.
Fixes: e3e1fa0e78 ("Makefile: Add kernel modules related make targets")
Signed-off-by: Martin Doucha <mdoucha@suse.cz>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
---
Changes since v1: Removed $(abs_srcdir) from module targets because now it's
already included in $(dir)
Makefile | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index 77270bc7c..d47b2528e 100644
--- a/Makefile
+++ b/Makefile
@@ -213,24 +213,24 @@ test-metadata: metadata-all
$(MAKE) -C $(abs_srcdir)/metadata test
MODULE_DIRS := $(shell \
- dirname $$(grep -l 'include.*module\.mk' $$(find testcases/ -type f -name 'Makefile')))
+ dirname $$(grep -l 'include.*module\.mk' $$(find $(abs_srcdir)/testcases/ -type f -name 'Makefile')))
.PHONY: modules modules-clean modules-install
modules:
@$(foreach dir,$(MODULE_DIRS),\
echo "Build $(dir)";\
- $(MAKE) -C $(abs_srcdir)/$(dir) || exit $$?; \
+ $(MAKE) -C $(dir) || exit $$?; \
)
modules-clean:
@$(foreach dir,$(MODULE_DIRS),\
echo "Build $(dir)";\
- $(MAKE) -C $(abs_srcdir)/$(dir) clean || exit $$?; \
+ $(MAKE) -C $(dir) clean || exit $$?; \
)
modules-install: modules
@$(foreach dir,$(MODULE_DIRS),\
echo "Build $(dir)";\
- $(MAKE) -C $(abs_srcdir)/$(dir) install || exit $$?; \
+ $(MAKE) -C $(dir) install || exit $$?; \
)
## Help
--
2.50.1
More information about the ltp
mailing list