Skip to contentSkip to conversation

tools/dma: fix building with O=

PATCH Applied Sasha Levin 3 participants 3 messages Oct 11 – Oct 13

Subsystems (2)
lore
Share & tools
lore

Sasha Levin

author maintainer
#0 lore raw

PATCH 1/1 tools/dma: fix building with O=

With O= set, "all" depends on $(OUTPUT)dma_map_benchmark, but the only rule builds dma_map_benchmark in the source directory, and built-in rules are disabled:

make: *** No rule to make target '<O>/dma_map_benchmark', needed by 'all'. Stop.

Build $(OUTPUT)dma_map_benchmark.

Fixes f74ee32963f1b ("tools/dma: move dma_map_benchmark from selftests to tools/dma")
Assisted-by LLM
---
 tools/dma/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/dma/Makefile +2 -2
index e4abf37bf020c..0c239a6b9eae5 100644
@@ -38,8 +38,8 @@ prepare: $(OUTPUT)include/linux/map_benchmark.h
 FORCE:
 
 DMA_MAP_BENCHMARK = dma_map_benchmark
-$(DMA_MAP_BENCHMARK): prepare FORCE
-	$(CC) $(CFLAGS) $(DMA_MAP_BENCHMARK).c -o $(DMA_MAP_BENCHMARK)
+$(OUTPUT)$(DMA_MAP_BENCHMARK): prepare FORCE
+	$(CC) $(CFLAGS) $(DMA_MAP_BENCHMARK).c -o $@
 
 clean:
 	rm -f $(ALL_PROGRAMS)
Signature · 1 line
2.53.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 21 lines · Sasha Levin

With O= set, "all" depends on $(OUTPUT)dma_map_benchmark, but the only rule builds dma_map_benchmark in the source directory, and built-in rules are disabled:

make: *** No rule to make target '<O>/dma_map_benchmark', needed by 'all'. Stop.

Build $(OUTPUT)dma_map_benchmark.

Fixes f74ee32963f1b ("tools/dma: move dma_map_benchmark from selftests to tools/dma")
Assisted-by LLM
---
  tools/dma/Makefile | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
tools/dma/Makefile +0 -0
index e4abf37bf020c..0c239a6b9eae5 100644

tools/dma/Makefile prepare: $(OUTPUT)include/linux/map_benchmark.h · line 45

Quoted 10 lines
tools/dma/Makefile +2 -2
@@ -38,8 +38,8 @@ prepare: $(OUTPUT)include/linux/map_benchmark.h
  FORCE:
 
  DMA_MAP_BENCHMARK = dma_map_benchmark
-$(DMA_MAP_BENCHMARK): prepare FORCE
-	$(CC) $(CFLAGS) $(DMA_MAP_BENCHMARK).c -o $(DMA_MAP_BENCHMARK)
+$(OUTPUT)$(DMA_MAP_BENCHMARK): prepare FORCE
+	$(CC) $(CFLAGS) $(DMA_MAP_BENCHMARK).c -o $@
 
  clean:
  	rm -f $(ALL_PROGRAMS)
Signature · 2 lines
Thanks,
Qinxin
#2 lore raw
In reply to Sasha Levin
Quoted 4 lines · Sasha Levin

With O= set, "all" depends on $(OUTPUT)dma_map_benchmark, but the only rule builds dma_map_benchmark in the source directory, and built-in rules are disabled:

Quoted 8 lines

make: *** No rule to make target '<O>/dma_map_benchmark', needed by 'all'. Stop.

Build $(OUTPUT)dma_map_benchmark.

Fixes f74ee32963f1b ("tools/dma: move dma_map_benchmark from selftests to tools/dma")
Assisted-by LLM

Applied to dma-mapping-for-next. Thanks!

Best regards

Signature · 2 lines
Marek Szyprowski, PhD
Samsung R&D Institute Poland