Re: Bug 116411: tools/perf_clean: output directory does not exist. Stop.

From: TJ
Date: Sat Apr 16 2016 - 20:39:22 EST


On 15-04-2016 17:00, Arnaldo Carvalho de Melo wrote:
----8-<---- snip

Thanks for narrowing it down, do you have any patch fixing this?

I'm having some success with the following change although I'm a long way from completing tests of all possible permutations. It's a bit 'raw' and could be caught out:

diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include
index 8abbef1..7c88242 100644
--- a/tools/scripts/Makefile.include
+++ b/tools/scripts/Makefile.include
@@ -2,7 +2,7 @@ ifneq ($(O),)
ifeq ($(origin O), command line)
dummy := $(if $(shell test -d $(O) || echo $(O)),$(error O=$(O) does not exist),)
ABSOLUTE_O := $(shell cd $(O) ; pwd)
- OUTPUT := $(ABSOLUTE_O)/$(if $(subdir),$(subdir)/)
+ OUTPUT := $(ABSOLUTE_O)/$(if $(filter %$(subdir),$(ABSOLUTE_O)),,$(subdir)/)
COMMAND_O := O=$(ABSOLUTE_O)
ifeq ($(objtree),)
objtree := $(O)