Skip to contentSkip to conversation

tools/perf: try to make output directory

PATCH In review Andy Shevchenko 2 participants 2 messages Jan 28, 2016 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/perf: try to make output directory

Instead of just complaining and fail try to create output directory fisrt like it's done in main Linux kernel Makefile.

---
 tools/build/Makefile | 2 +-
 tools/perf/Makefile  | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)
tools/build/Makefile +1 -1
index 0d5a0e3..3f60b67 100644
@@ -3,7 +3,7 @@ srctree := $(patsubst %/,%,$(dir $(shell pwd)))
 srctree := $(patsubst %/,%,$(dir $(srctree)))
 endif
 
-include $(srctree)/tools//scripts/Makefile.include
+include $(srctree)/tools/scripts/Makefile.include
 
 define allow-override
   $(if $(or $(findstring environment,$(origin $(1))),\
tools/perf/Makefile +3 -0
index dcd9a70..4e68eba 100644
@@ -35,6 +35,9 @@ endif
 #
 ifneq ($(O),)
   FULL_O := $(shell readlink -f $(O) || echo $(O))
+  saved-output := $(FULL_O)
+  FULL_O := $(shell mkdir -p $(FULL_O) && cd $(FULL_O) && /bin/pwd)
+  $(if $(FULL_O),, $(error failed to create output directory "$(saved-output)"))
 endif
 
 #
Signature · 1 line
2.7.0.rc3
#1 lore raw

Em Thu, Jan 28, 2016 at 08:41:52PM +0200, Andy Shevchenko escreveu:

Quoted 2 lines

Instead of just complaining and fail try to create output directory fisrt like it's done in main Linux kernel Makefile.

That was intentionally disabled, please look at the changelog.

- Arnaldo

Quoted 35 lines
---
 tools/build/Makefile | 2 +-
 tools/perf/Makefile  | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)
tools/build/Makefile +1 -1
index 0d5a0e3..3f60b67 100644
@@ -3,7 +3,7 @@ srctree := $(patsubst %/,%,$(dir $(shell pwd)))
 srctree := $(patsubst %/,%,$(dir $(srctree)))
 endif
 
-include $(srctree)/tools//scripts/Makefile.include
+include $(srctree)/tools/scripts/Makefile.include
 
 define allow-override
   $(if $(or $(findstring environment,$(origin $(1))),\
tools/perf/Makefile +3 -0
index dcd9a70..4e68eba 100644
@@ -35,6 +35,9 @@ endif
 #
 ifneq ($(O),)
   FULL_O := $(shell readlink -f $(O) || echo $(O))
+  saved-output := $(FULL_O)
+  FULL_O := $(shell mkdir -p $(FULL_O) && cd $(FULL_O) && /bin/pwd)
+  $(if $(FULL_O),, $(error failed to create output directory "$(saved-output)"))
 endif
 
 #
Signature · 1 line
2.7.0.rc3