Skip to contentSkip to conversation

cpupower: keep O= builds inside the cpupower output directory

PATCH New Sasha Levin 1 participant 1 message Oct 11

Subsystems (2)
lore
Share & tools
lore

Sasha Levin

author maintainer
#0 lore raw

PATCH 1/1 cpupower: keep O= builds inside the cpupower output directory

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")
Assisted-by LLM
---
 tools/power/cpupower/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/power/cpupower/Makefile +1 -1
index ab428e336d878..206de09252a57 100644
@@ -10,7 +10,7 @@
 #
 OUTPUT=./
 ifeq ("$(origin O)", "command line")
-	OUTPUT := $(O)/
+	OUTPUT := $(O)/$(if $(subdir),$(subdir)/)
 endif
 
 ifneq ($(OUTPUT),)
Signature · 1 line
2.53.0