mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] cpupower: keep O= builds inside the cpupower output directory
@ 2026-10-11 22:33 Sasha Levin
  0 siblings, 0 replies; only message in thread
From: Sasha Levin @ 2026-10-11 22:33 UTC (permalink / raw)
  To: Thomas Renninger, Shuah Khan, John B. Wyatt IV, John Kacur,
	David Howells, Arnaldo Carvalho de Melo
  Cc: Sasha Levin, stable, linux-pm, linux-kernel

tools/Makefile builds cpupower with O= set to the top of the output
tree and subdir= set to tools/power/cpupower, like the other tools it
descends into. cpupower ignores subdir and puts its objects straight
into $(O). Through the kernel's "make O=<dir> tools/cpupower" that is
the kernel object tree, and "make O=<dir> tools/cpupower_clean" (also
part of "make tools/clean") then runs

  find $(O) -name '*.[oas]' | xargs rm -f

over the whole kernel object tree, deleting every kernel object file.

Append subdir to the output directory, as tools/scripts/Makefile.include
does for the other tools. Builds that pass O= without subdir, including
"make -C tools/power/cpupower O=<dir>", are unchanged.

Fixes: bf35182ffcd00 ("tools: Honour the O= flag when tool build called from a higher Makefile")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/power/cpupower/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/power/cpupower/Makefile b/tools/power/cpupower/Makefile
index ab428e336d878..206de09252a57 100644
--- a/tools/power/cpupower/Makefile
+++ b/tools/power/cpupower/Makefile
@@ -10,7 +10,7 @@
 #
 OUTPUT=./
 ifeq ("$(origin O)", "command line")
-	OUTPUT := $(O)/
+	OUTPUT := $(O)/$(if $(subdir),$(subdir)/)
 endif
 
 ifneq ($(OUTPUT),)
-- 
2.53.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-11 22:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-11 22:33 [PATCH] cpupower: keep O= builds inside the cpupower output directory Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®