Makefile: Fix module dirs search
PATCH v2 1/1 Makefile: Fix module dirs search
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.
---
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(-)
Makefile +4 -4
@@ -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
Signature · 5 lines
2.50.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Martin Doucha <[email protected]> wrote:
Module dirs search runs relative to current working directory instead
Quoted 5 lines
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.
Patch merged, thanks for the fix!
Signature · 5 lines
Regards, Li Wang -- Mailing list info: https://lists.linux.it/listinfo/ltp