diff options
author | Borislav Petkov <bp@suse.de> | 2013-02-20 10:32:29 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-03-15 12:05:59 -0400 |
commit | 9e4a66482e9a96405eb9ee7f7bf28c9799ca8670 (patch) | |
tree | 354fbbc643e3cd882277e12c4136b136a86e9904 /tools/scripts | |
parent | a50e43332756a5ac8d00f3367a54d9effeb9c674 (diff) |
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 <bp@suse.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1361374353-30385-4-git-send-email-bp@alien8.de
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/scripts')
-rw-r--r-- | tools/scripts/Makefile.include | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include index 00a05f45b39a..f03e681f8891 100644 --- a/tools/scripts/Makefile.include +++ b/tools/scripts/Makefile.include | |||
@@ -1,3 +1,4 @@ | |||
1 | ifneq ($(O),) | ||
1 | ifeq ($(origin O), command line) | 2 | ifeq ($(origin O), command line) |
2 | dummy := $(if $(shell test -d $(O) || echo $(O)),$(error O=$(O) does not exist),) | 3 | dummy := $(if $(shell test -d $(O) || echo $(O)),$(error O=$(O) does not exist),) |
3 | ABSOLUTE_O := $(shell cd $(O) ; pwd) | 4 | ABSOLUTE_O := $(shell cd $(O) ; pwd) |
@@ -7,9 +8,10 @@ ifeq ($(objtree),) | |||
7 | objtree := $(O) | 8 | objtree := $(O) |
8 | endif | 9 | endif |
9 | endif | 10 | endif |
11 | endif | ||
10 | 12 | ||
11 | ifneq ($(OUTPUT),) | ||
12 | # check that the output directory actually exists | 13 | # check that the output directory actually exists |
14 | ifneq ($(OUTPUT),) | ||
13 | OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd) | 15 | OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd) |
14 | $(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist)) | 16 | $(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist)) |
15 | endif | 17 | endif |