[PATCH] perf install: Don't propagate subdir to Documentation submake

From: Nicolas Schier
Date: Thu May 23 2024 - 04:15:16 EST


Explicitly reset 'subdir' variable when descending to
tools/perf/Documentation. Similar to commit f89fb55714b62 ("perf build:
Don't propagate subdir to submakes for install_headers", 2023-01-02),
calling the 'tools/perf_install' target via top-levels Makefile results
in repeated subdir components when attempting to call the perf
documentation installation rules:

$ make tools/perf_install NO_LIBTRACEEVENT=1 JOBS=1
[...]
/bin/sh: 1: cd: can't cd to /data/linux/kbuild/tools/perf/tools/perf/
../../scripts/Makefile.include:17: *** output directory "/data/linux/kbuild/tools/perf/tools/perf/" does not exist. Stop.
make[5]: *** [Makefile.perf:1096: try-install-man] Error 2
make[4]: *** [Makefile.perf:264: sub-make] Error 2
make[3]: *** [Makefile:113: install] Error 2
make[2]: *** [Makefile:131: perf_install] Error 2

Resetting 'subdir' fixes the call from top-level Makefile.

Reported-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
Signed-off-by: Nicolas Schier <n.schier@xxxxxx>
---
tools/perf/Makefile.perf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 5c35c0d893069..ab15d199e3794 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -1093,7 +1093,7 @@ install-python_ext:

# 'make install-doc' should call 'make -C Documentation install'
$(INSTALL_DOC_TARGETS):
- $(Q)$(MAKE) -C $(DOC_DIR) O=$(OUTPUT) $(@:-doc=) ASCIIDOC_EXTRA=$(ASCIIDOC_EXTRA)
+ $(Q)$(MAKE) -C $(DOC_DIR) O=$(OUTPUT) $(@:-doc=) ASCIIDOC_EXTRA=$(ASCIIDOC_EXTRA) subdir=

### Cleaning rules


---
base-commit: 29c73fc794c83505066ee6db893b2a83ac5fac63
change-id: 20240523-make-tools-perf-install-71c3d1f11ffc

Best regards,
--
Nicolas Schier