perf tools: Let O= makes handle relative paths
[firefly-linux-kernel-4.4.55.git] / tools / scripts / Makefile.include
index bde8521d56bb37d8952a99a7d552cb6ae2b6e50e..96ce80a3743ba22e13935f238e9835aca8923326 100644 (file)
@@ -1,6 +1,8 @@
 ifeq ("$(origin O)", "command line")
-       OUTPUT := $(O)/
-       COMMAND_O := O=$(O)
+       dummy := $(if $(shell test -d $(O) || echo $(O)),$(error O=$(O) does not exist),)
+       ABSOLUTE_O := $(shell cd $(O) ; pwd)
+       OUTPUT := $(ABSOLUTE_O)/
+       COMMAND_O := O=$(ABSOLUTE_O)
 endif
 
 ifneq ($(OUTPUT),)