perf tools: Fix lib/traceevent build dir with OUTPUT variable set
authorRobert Richter <robert.richter@amd.com>
Tue, 7 Aug 2012 17:43:12 +0000 (19:43 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 8 Aug 2012 15:37:41 +0000 (12:37 -0300)
With the OUTPUT variable set the libtraceevent.a file is wrongly built
in the source directory:

 + make -d OUTPUT=/.../.build/perf-user/ DESTDIR=/.../.install/perf-user/
 ...
     Considering target file `../lib/traceevent//libtraceevent.a'.
      File `../lib/traceevent//libtraceevent.a' does not exist.
      Finished prerequisites of target file `../lib/traceevent//libtraceevent.a'.
     Must remake target `../lib/traceevent//libtraceevent.a'.
 Invoking recipe from Makefile:837 to update target `../lib/traceevent//libtraceevent.a'.
 Putting child 0x703850 (../lib/traceevent//libtraceevent.a) PID 8365 on the chain.
 Live child 0x703850 (../lib/traceevent//libtraceevent.a) PID 8365
     SUBDIR ../lib/traceevent/

 $ git clean -nxd
 Would remove tools/lib/traceevent/.event-parse.d
 Would remove tools/lib/traceevent/.parse-filter.d
 Would remove tools/lib/traceevent/.parse-utils.d
 Would remove tools/lib/traceevent/.trace-seq.d
 Would remove tools/lib/traceevent/event-parse.o
 Would remove tools/lib/traceevent/libtraceevent.a
 Would remove tools/lib/traceevent/parse-filter.o
 Would remove tools/lib/traceevent/parse-utils.o
 Would remove tools/lib/traceevent/trace-seq.o

This patch fixes this.

Note: Though this should already work with O=$outputdir we better use
the OUTPUT variable directly.

Signed-off-by: Robert Richter <robert.richter@amd.com>
Cc: Ingo Molnar <mingo@kernel.org>
Link: http://lkml.kernel.org/r/1344361396-7237-3-git-send-email-robert.richter@amd.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/Makefile

index 35655c3a7b7a438dd806b9d5a5fb8baa7102876a..2d4bf6ef1c5a101dc242e5d7bb1411d9fba1e43a 100644 (file)
@@ -186,10 +186,10 @@ SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH))
 
 TRACE_EVENT_DIR = ../lib/traceevent/
 
-ifeq ("$(origin O)", "command line")
-       TE_PATH=$(OUTPUT)/
+ifneq ($(OUTPUT),)
+       TE_PATH=$(OUTPUT)
 else
-       TE_PATH=$(TRACE_EVENT_DIR)/
+       TE_PATH=$(TRACE_EVENT_DIR)
 endif
 
 LIBTRACEEVENT = $(TE_PATH)libtraceevent.a
@@ -842,7 +842,7 @@ $(LIB_FILE): $(LIB_OBJS)
 
 # libtraceevent.a
 $(LIBTRACEEVENT):
-       $(QUIET_SUBDIR0)$(TRACE_EVENT_DIR) $(QUIET_SUBDIR1) $(COMMAND_O) libtraceevent.a
+       $(QUIET_SUBDIR0)$(TRACE_EVENT_DIR) $(QUIET_SUBDIR1) O=$(OUTPUT) libtraceevent.a
 
 help:
        @echo 'Perf make targets:'