From: Ian Rogers Date: Mon, 18 May 2026 15:46:36 +0000 (-0700) Subject: perf build: Prefix SCRIPTS with output directory to fix continuous rebuilds X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=85cc481af5ffa23809b7bb100aa774172369983c;p=thirdparty%2Flinux.git perf build: Prefix SCRIPTS with output directory to fix continuous rebuilds In Makefile.perf, ALL_PROGRAMS includes SCRIPTS (perf-archive, perf-iostat). However, unlike PROGRAMS and DLFILTERS, SCRIPTS was not prefixed with $(OUTPUT). During out-of-tree builds (or when O= is specified), Make checked for the unprefixed target 'tools/perf/perf-archive'. Since the actual script was installed into $(OUTPUT)perf-archive, Make concluded the target was missing and continuously re-executed the script installation rule on every single incremental build. Prefix SCRIPTS with $(OUTPUT) and update the static pattern rule to ensure Kbuild correctly tracks generated script prerequisites during incremental builds. Reviewed-by: Namhyung Kim Assisted-by: Gemini:gemini-3.1-pro-preview Signed-off-by: Ian Rogers Tested-by: James Clark Cc: Adrian Hunter Cc: Albert Ou Cc: Alexandre Chartre Cc: Alexandre Ghiti Cc: Andrii Nakryiko Cc: Ankur Arora Cc: Collin Funk Cc: Costa Shulyupin Cc: Daniel Borkmann Cc: Dapeng Mi Cc: David Sterba Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Eduard Zingerman Cc: Howard Chu Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kumar Kartikeya Dwivedi Cc: Leo Yan Cc: Markus Mayer Cc: Martin KaFai Lau Cc: Nathan Chancellor Cc: Nick Terrell Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Peter Zijlstra Cc: Quentin Monnet Cc: Ricky Ringler Cc: Song Liu Cc: Swapnil Sapkal Cc: Thomas Falcon Cc: Tomas Glozar Cc: Yonghong Song Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index b8a81c9749a89..fc92d6ceac5b0 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -405,7 +405,7 @@ python-clean := $(call QUIET_CLEAN, python) $(RM) -r $(PYTHON_EXTBUILD) $(OUTPUT # Use the detected configuration -include $(OUTPUT).config-detected -SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) +SCRIPTS = $(addprefix $(OUTPUT),$(patsubst %.sh,%,$(SCRIPT_SH))) PROGRAMS += $(OUTPUT)perf @@ -592,8 +592,8 @@ $(GTK_IN): FORCE prepare $(OUTPUT)libperf-gtk.so: $(GTK_IN) $(PERFLIBS) $(QUIET_LINK)$(CC) -o $@ -shared $(LDFLAGS) $(filter %.o,$^) $(GTK_LIBS) -$(SCRIPTS) : % : %.sh - $(QUIET_GEN)$(INSTALL) '$@.sh' '$(OUTPUT)$@' +$(SCRIPTS) : $(OUTPUT)% : %.sh + $(QUIET_GEN)$(INSTALL) '$<' '$@' $(OUTPUT)PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE $(Q)$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT)