Skip to content

Commit

Permalink
perf tools: Correct Makefile.include
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Steven Rostedt <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
suryasaimadhu authored and acmel committed Mar 15, 2013
1 parent a50e433 commit 9e4a664
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/scripts/Makefile.include
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 9e4a664

Please sign in to comment.