From 9e4a66482e9a96405eb9ee7f7bf28c9799ca8670 Mon Sep 17 00:00:00 2001 From: Borislav Petkov Date: Wed, 20 Feb 2013 16:32:29 +0100 Subject: [PATCH] perf tools: Correct Makefile.include It looks at O= and adjusts the $(OUTPUT) variable based on what the output directory will be. However, when O is defined but empty, it wrongly becomes the user's $HOME dir which is not what we want. So check it is not empty before working with it further. Signed-off-by: Borislav Petkov Cc: Ingo Molnar Cc: Steven Rostedt Link: http://lkml.kernel.org/r/1361374353-30385-4-git-send-email-bp@alien8.de Signed-off-by: Arnaldo Carvalho de Melo --- tools/scripts/Makefile.include | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include index 00a05f4..f03e681 100644 --- a/tools/scripts/Makefile.include +++ b/tools/scripts/Makefile.include @@ -1,3 +1,4 @@ +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) @@ -7,9 +8,10 @@ ifeq ($(objtree),) objtree := $(O) endif endif +endif -ifneq ($(OUTPUT),) # check that the output directory actually exists +ifneq ($(OUTPUT),) OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd) $(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist)) endif -- 2.7.4