aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-03-27 13:30:45 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-04-02 15:28:03 -0400
commitc29ede615fd35a640e771fbbb1778e915fac43a7 (patch)
tree269de5b6479899a3905d3a3ab2472ef9054f017b /tools
parent8b2c551f9635bf1c5c2d38de300137998915478f (diff)
perf tools: Allow specifying O= to build files in a separate directory
Avoiding polluting the source tree with build files. Reported-by: Steven Rostedt <rostedt@goodmis.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/Makefile322
-rwxr-xr-xtools/perf/util/PERF-VERSION-GEN6
2 files changed, 172 insertions, 156 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 120736c03a59..93029c09cd65 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -1,3 +1,7 @@
1ifeq ("$(origin O)", "command line")
2 OUTPUT := $(O)/
3endif
4
1# The default target of this Makefile is... 5# The default target of this Makefile is...
2all:: 6all::
3 7
@@ -153,9 +157,13 @@ all::
153# 157#
154# Define NO_DWARF if you do not want debug-info analysis feature at all. 158# Define NO_DWARF if you do not want debug-info analysis feature at all.
155 159
156PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE 160$(shell sh -c 'mkdir -p $(OUTPUT)scripts/python/Perf-Trace-Util/' 2> /dev/null)
157 @$(SHELL_PATH) util/PERF-VERSION-GEN 161$(shell sh -c 'mkdir -p $(OUTPUT)util/scripting-engines/' 2> /dev/null)
158-include PERF-VERSION-FILE 162$(shell sh -c 'mkdir $(OUTPUT)bench' 2> /dev/null)
163
164$(OUTPUT)PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE
165 @$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT)
166-include $(OUTPUT)PERF-VERSION-FILE
159 167
160uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') 168uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
161uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not') 169uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')
@@ -310,7 +318,7 @@ PROGRAMS += $(EXTRA_PROGRAMS)
310# 318#
311# Single 'perf' binary right now: 319# Single 'perf' binary right now:
312# 320#
313PROGRAMS += perf 321PROGRAMS += $(OUTPUT)perf
314 322
315# List built-in command $C whose implementation cmd_$C() is not in 323# List built-in command $C whose implementation cmd_$C() is not in
316# builtin-$C.o but is linked in as part of some other command. 324# builtin-$C.o but is linked in as part of some other command.
@@ -320,7 +328,7 @@ PROGRAMS += perf
320ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS) 328ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS)
321 329
322# what 'all' will build but not install in perfexecdir 330# what 'all' will build but not install in perfexecdir
323OTHER_PROGRAMS = perf$X 331OTHER_PROGRAMS = $(OUTPUT)perf$X
324 332
325# Set paths to tools early so that they can be used for version tests. 333# Set paths to tools early so that they can be used for version tests.
326ifndef SHELL_PATH 334ifndef SHELL_PATH
@@ -332,7 +340,7 @@ endif
332 340
333export PERL_PATH 341export PERL_PATH
334 342
335LIB_FILE=libperf.a 343LIB_FILE=$(OUTPUT)libperf.a
336 344
337LIB_H += ../../include/linux/perf_event.h 345LIB_H += ../../include/linux/perf_event.h
338LIB_H += ../../include/linux/rbtree.h 346LIB_H += ../../include/linux/rbtree.h
@@ -393,77 +401,77 @@ LIB_H += util/probe-finder.h
393LIB_H += util/probe-event.h 401LIB_H += util/probe-event.h
394LIB_H += util/cpumap.h 402LIB_H += util/cpumap.h
395 403
396LIB_OBJS += util/abspath.o 404LIB_OBJS += $(OUTPUT)util/abspath.o
397LIB_OBJS += util/alias.o 405LIB_OBJS += $(OUTPUT)util/alias.o
398LIB_OBJS += util/build-id.o 406LIB_OBJS += $(OUTPUT)util/build-id.o
399LIB_OBJS += util/config.o 407LIB_OBJS += $(OUTPUT)util/config.o
400LIB_OBJS += util/ctype.o 408LIB_OBJS += $(OUTPUT)util/ctype.o
401LIB_OBJS += util/debugfs.o 409LIB_OBJS += $(OUTPUT)util/debugfs.o
402LIB_OBJS += util/environment.o 410LIB_OBJS += $(OUTPUT)util/environment.o
403LIB_OBJS += util/event.o 411LIB_OBJS += $(OUTPUT)util/event.o
404LIB_OBJS += util/exec_cmd.o 412LIB_OBJS += $(OUTPUT)util/exec_cmd.o
405LIB_OBJS += util/help.o 413LIB_OBJS += $(OUTPUT)util/help.o
406LIB_OBJS += util/levenshtein.o 414LIB_OBJS += $(OUTPUT)util/levenshtein.o
407LIB_OBJS += util/parse-options.o 415LIB_OBJS += $(OUTPUT)util/parse-options.o
408LIB_OBJS += util/parse-events.o 416LIB_OBJS += $(OUTPUT)util/parse-events.o
409LIB_OBJS += util/path.o 417LIB_OBJS += $(OUTPUT)util/path.o
410LIB_OBJS += util/rbtree.o 418LIB_OBJS += $(OUTPUT)util/rbtree.o
411LIB_OBJS += util/bitmap.o 419LIB_OBJS += $(OUTPUT)util/bitmap.o
412LIB_OBJS += util/hweight.o 420LIB_OBJS += $(OUTPUT)util/hweight.o
413LIB_OBJS += util/find_next_bit.o 421LIB_OBJS += $(OUTPUT)util/find_next_bit.o
414LIB_OBJS += util/run-command.o 422LIB_OBJS += $(OUTPUT)util/run-command.o
415LIB_OBJS += util/quote.o 423LIB_OBJS += $(OUTPUT)util/quote.o
416LIB_OBJS += util/strbuf.o 424LIB_OBJS += $(OUTPUT)util/strbuf.o
417LIB_OBJS += util/string.o 425LIB_OBJS += $(OUTPUT)util/string.o
418LIB_OBJS += util/strlist.o 426LIB_OBJS += $(OUTPUT)util/strlist.o
419LIB_OBJS += util/usage.o 427LIB_OBJS += $(OUTPUT)util/usage.o
420LIB_OBJS += util/wrapper.o 428LIB_OBJS += $(OUTPUT)util/wrapper.o
421LIB_OBJS += util/sigchain.o 429LIB_OBJS += $(OUTPUT)util/sigchain.o
422LIB_OBJS += util/symbol.o 430LIB_OBJS += $(OUTPUT)util/symbol.o
423LIB_OBJS += util/color.o 431LIB_OBJS += $(OUTPUT)util/color.o
424LIB_OBJS += util/pager.o 432LIB_OBJS += $(OUTPUT)util/pager.o
425LIB_OBJS += util/header.o 433LIB_OBJS += $(OUTPUT)util/header.o
426LIB_OBJS += util/callchain.o 434LIB_OBJS += $(OUTPUT)util/callchain.o
427LIB_OBJS += util/values.o 435LIB_OBJS += $(OUTPUT)util/values.o
428LIB_OBJS += util/debug.o 436LIB_OBJS += $(OUTPUT)util/debug.o
429LIB_OBJS += util/map.o 437LIB_OBJS += $(OUTPUT)util/map.o
430LIB_OBJS += util/session.o 438LIB_OBJS += $(OUTPUT)util/session.o
431LIB_OBJS += util/thread.o 439LIB_OBJS += $(OUTPUT)util/thread.o
432LIB_OBJS += util/trace-event-parse.o 440LIB_OBJS += $(OUTPUT)util/trace-event-parse.o
433LIB_OBJS += util/trace-event-read.o 441LIB_OBJS += $(OUTPUT)util/trace-event-read.o
434LIB_OBJS += util/trace-event-info.o 442LIB_OBJS += $(OUTPUT)util/trace-event-info.o
435LIB_OBJS += util/trace-event-scripting.o 443LIB_OBJS += $(OUTPUT)util/trace-event-scripting.o
436LIB_OBJS += util/svghelper.o 444LIB_OBJS += $(OUTPUT)util/svghelper.o
437LIB_OBJS += util/sort.o 445LIB_OBJS += $(OUTPUT)util/sort.o
438LIB_OBJS += util/hist.o 446LIB_OBJS += $(OUTPUT)util/hist.o
439LIB_OBJS += util/probe-event.o 447LIB_OBJS += $(OUTPUT)util/probe-event.o
440LIB_OBJS += util/util.o 448LIB_OBJS += $(OUTPUT)util/util.o
441LIB_OBJS += util/cpumap.o 449LIB_OBJS += $(OUTPUT)util/cpumap.o
442 450
443BUILTIN_OBJS += builtin-annotate.o 451BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
444 452
445BUILTIN_OBJS += builtin-bench.o 453BUILTIN_OBJS += $(OUTPUT)builtin-bench.o
446 454
447# Benchmark modules 455# Benchmark modules
448BUILTIN_OBJS += bench/sched-messaging.o 456BUILTIN_OBJS += $(OUTPUT)bench/sched-messaging.o
449BUILTIN_OBJS += bench/sched-pipe.o 457BUILTIN_OBJS += $(OUTPUT)bench/sched-pipe.o
450BUILTIN_OBJS += bench/mem-memcpy.o 458BUILTIN_OBJS += $(OUTPUT)bench/mem-memcpy.o
451 459
452BUILTIN_OBJS += builtin-diff.o 460BUILTIN_OBJS += $(OUTPUT)builtin-diff.o
453BUILTIN_OBJS += builtin-help.o 461BUILTIN_OBJS += $(OUTPUT)builtin-help.o
454BUILTIN_OBJS += builtin-sched.o 462BUILTIN_OBJS += $(OUTPUT)builtin-sched.o
455BUILTIN_OBJS += builtin-buildid-list.o 463BUILTIN_OBJS += $(OUTPUT)builtin-buildid-list.o
456BUILTIN_OBJS += builtin-buildid-cache.o 464BUILTIN_OBJS += $(OUTPUT)builtin-buildid-cache.o
457BUILTIN_OBJS += builtin-list.o 465BUILTIN_OBJS += $(OUTPUT)builtin-list.o
458BUILTIN_OBJS += builtin-record.o 466BUILTIN_OBJS += $(OUTPUT)builtin-record.o
459BUILTIN_OBJS += builtin-report.o 467BUILTIN_OBJS += $(OUTPUT)builtin-report.o
460BUILTIN_OBJS += builtin-stat.o 468BUILTIN_OBJS += $(OUTPUT)builtin-stat.o
461BUILTIN_OBJS += builtin-timechart.o 469BUILTIN_OBJS += $(OUTPUT)builtin-timechart.o
462BUILTIN_OBJS += builtin-top.o 470BUILTIN_OBJS += $(OUTPUT)builtin-top.o
463BUILTIN_OBJS += builtin-trace.o 471BUILTIN_OBJS += $(OUTPUT)builtin-trace.o
464BUILTIN_OBJS += builtin-probe.o 472BUILTIN_OBJS += $(OUTPUT)builtin-probe.o
465BUILTIN_OBJS += builtin-kmem.o 473BUILTIN_OBJS += $(OUTPUT)builtin-kmem.o
466BUILTIN_OBJS += builtin-lock.o 474BUILTIN_OBJS += $(OUTPUT)builtin-lock.o
467 475
468PERFLIBS = $(LIB_FILE) 476PERFLIBS = $(LIB_FILE)
469 477
@@ -494,6 +502,10 @@ ifeq ($(uname_S),Darwin)
494 PTHREAD_LIBS = 502 PTHREAD_LIBS =
495endif 503endif
496 504
505ifneq ($(OUTPUT),)
506 BASIC_CFLAGS += -I$(OUTPUT)
507endif
508
497ifeq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y) 509ifeq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y)
498ifneq ($(shell sh -c "(echo '\#include <gnu/libc-version.h>'; echo 'int main(void) { const char * version = gnu_get_libc_version(); return (long)version; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y) 510ifneq ($(shell sh -c "(echo '\#include <gnu/libc-version.h>'; echo 'int main(void) { const char * version = gnu_get_libc_version(); return (long)version; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y)
499 msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static); 511 msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static);
@@ -512,7 +524,7 @@ else
512ifndef NO_DWARF 524ifndef NO_DWARF
513 BASIC_CFLAGS += -I/usr/include/elfutils -DDWARF_SUPPORT 525 BASIC_CFLAGS += -I/usr/include/elfutils -DDWARF_SUPPORT
514 EXTLIBS += -lelf -ldw 526 EXTLIBS += -lelf -ldw
515 LIB_OBJS += util/probe-finder.o 527 LIB_OBJS += $(OUTPUT)util/probe-finder.o
516endif 528endif
517endif 529endif
518 530
@@ -521,7 +533,7 @@ ifneq ($(shell sh -c "(echo '\#include <newt.h>'; echo 'int main(void) { newtIni
521 BASIC_CFLAGS += -DNO_NEWT_SUPPORT 533 BASIC_CFLAGS += -DNO_NEWT_SUPPORT
522else 534else
523 EXTLIBS += -lnewt 535 EXTLIBS += -lnewt
524 LIB_OBJS += util/newt.o 536 LIB_OBJS += $(OUTPUT)util/newt.o
525endif 537endif
526 538
527ifndef NO_LIBPERL 539ifndef NO_LIBPERL
@@ -533,8 +545,8 @@ ifneq ($(shell sh -c "(echo '\#include <EXTERN.h>'; echo '\#include <perl.h>'; e
533 BASIC_CFLAGS += -DNO_LIBPERL 545 BASIC_CFLAGS += -DNO_LIBPERL
534else 546else
535 ALL_LDFLAGS += $(PERL_EMBED_LDOPTS) 547 ALL_LDFLAGS += $(PERL_EMBED_LDOPTS)
536 LIB_OBJS += util/scripting-engines/trace-event-perl.o 548 LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-perl.o
537 LIB_OBJS += scripts/perl/Perf-Trace-Util/Context.o 549 LIB_OBJS += $(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o
538endif 550endif
539 551
540ifndef NO_LIBPYTHON 552ifndef NO_LIBPYTHON
@@ -546,8 +558,8 @@ ifneq ($(shell sh -c "(echo '\#include <Python.h>'; echo 'int main(void) { Py_In
546 BASIC_CFLAGS += -DNO_LIBPYTHON 558 BASIC_CFLAGS += -DNO_LIBPYTHON
547else 559else
548 ALL_LDFLAGS += $(PYTHON_EMBED_LDOPTS) 560 ALL_LDFLAGS += $(PYTHON_EMBED_LDOPTS)
549 LIB_OBJS += util/scripting-engines/trace-event-python.o 561 LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-python.o
550 LIB_OBJS += scripts/python/Perf-Trace-Util/Context.o 562 LIB_OBJS += $(OUTPUT)scripts/python/Perf-Trace-Util/Context.o
551endif 563endif
552 564
553ifdef NO_DEMANGLE 565ifdef NO_DEMANGLE
@@ -618,53 +630,53 @@ ifdef NO_C99_FORMAT
618endif 630endif
619ifdef SNPRINTF_RETURNS_BOGUS 631ifdef SNPRINTF_RETURNS_BOGUS
620 COMPAT_CFLAGS += -DSNPRINTF_RETURNS_BOGUS 632 COMPAT_CFLAGS += -DSNPRINTF_RETURNS_BOGUS
621 COMPAT_OBJS += compat/snprintf.o 633 COMPAT_OBJS += $(OUTPUT)compat/snprintf.o
622endif 634endif
623ifdef FREAD_READS_DIRECTORIES 635ifdef FREAD_READS_DIRECTORIES
624 COMPAT_CFLAGS += -DFREAD_READS_DIRECTORIES 636 COMPAT_CFLAGS += -DFREAD_READS_DIRECTORIES
625 COMPAT_OBJS += compat/fopen.o 637 COMPAT_OBJS += $(OUTPUT)compat/fopen.o
626endif 638endif
627ifdef NO_SYMLINK_HEAD 639ifdef NO_SYMLINK_HEAD
628 BASIC_CFLAGS += -DNO_SYMLINK_HEAD 640 BASIC_CFLAGS += -DNO_SYMLINK_HEAD
629endif 641endif
630ifdef NO_STRCASESTR 642ifdef NO_STRCASESTR
631 COMPAT_CFLAGS += -DNO_STRCASESTR 643 COMPAT_CFLAGS += -DNO_STRCASESTR
632 COMPAT_OBJS += compat/strcasestr.o 644 COMPAT_OBJS += $(OUTPUT)compat/strcasestr.o
633endif 645endif
634ifdef NO_STRTOUMAX 646ifdef NO_STRTOUMAX
635 COMPAT_CFLAGS += -DNO_STRTOUMAX 647 COMPAT_CFLAGS += -DNO_STRTOUMAX
636 COMPAT_OBJS += compat/strtoumax.o 648 COMPAT_OBJS += $(OUTPUT)compat/strtoumax.o
637endif 649endif
638ifdef NO_STRTOULL 650ifdef NO_STRTOULL
639 COMPAT_CFLAGS += -DNO_STRTOULL 651 COMPAT_CFLAGS += -DNO_STRTOULL
640endif 652endif
641ifdef NO_SETENV 653ifdef NO_SETENV
642 COMPAT_CFLAGS += -DNO_SETENV 654 COMPAT_CFLAGS += -DNO_SETENV
643 COMPAT_OBJS += compat/setenv.o 655 COMPAT_OBJS += $(OUTPUT)compat/setenv.o
644endif 656endif
645ifdef NO_MKDTEMP 657ifdef NO_MKDTEMP
646 COMPAT_CFLAGS += -DNO_MKDTEMP 658 COMPAT_CFLAGS += -DNO_MKDTEMP
647 COMPAT_OBJS += compat/mkdtemp.o 659 COMPAT_OBJS += $(OUTPUT)compat/mkdtemp.o
648endif 660endif
649ifdef NO_UNSETENV 661ifdef NO_UNSETENV
650 COMPAT_CFLAGS += -DNO_UNSETENV 662 COMPAT_CFLAGS += -DNO_UNSETENV
651 COMPAT_OBJS += compat/unsetenv.o 663 COMPAT_OBJS += $(OUTPUT)compat/unsetenv.o
652endif 664endif
653ifdef NO_SYS_SELECT_H 665ifdef NO_SYS_SELECT_H
654 BASIC_CFLAGS += -DNO_SYS_SELECT_H 666 BASIC_CFLAGS += -DNO_SYS_SELECT_H
655endif 667endif
656ifdef NO_MMAP 668ifdef NO_MMAP
657 COMPAT_CFLAGS += -DNO_MMAP 669 COMPAT_CFLAGS += -DNO_MMAP
658 COMPAT_OBJS += compat/mmap.o 670 COMPAT_OBJS += $(OUTPUT)compat/mmap.o
659else 671else
660 ifdef USE_WIN32_MMAP 672 ifdef USE_WIN32_MMAP
661 COMPAT_CFLAGS += -DUSE_WIN32_MMAP 673 COMPAT_CFLAGS += -DUSE_WIN32_MMAP
662 COMPAT_OBJS += compat/win32mmap.o 674 COMPAT_OBJS += $(OUTPUT)compat/win32mmap.o
663 endif 675 endif
664endif 676endif
665ifdef NO_PREAD 677ifdef NO_PREAD
666 COMPAT_CFLAGS += -DNO_PREAD 678 COMPAT_CFLAGS += -DNO_PREAD
667 COMPAT_OBJS += compat/pread.o 679 COMPAT_OBJS += $(OUTPUT)compat/pread.o
668endif 680endif
669ifdef NO_FAST_WORKING_DIRECTORY 681ifdef NO_FAST_WORKING_DIRECTORY
670 BASIC_CFLAGS += -DNO_FAST_WORKING_DIRECTORY 682 BASIC_CFLAGS += -DNO_FAST_WORKING_DIRECTORY
@@ -686,10 +698,10 @@ else
686endif 698endif
687endif 699endif
688ifdef NO_INET_NTOP 700ifdef NO_INET_NTOP
689 LIB_OBJS += compat/inet_ntop.o 701 LIB_OBJS += $(OUTPUT)compat/inet_ntop.o
690endif 702endif
691ifdef NO_INET_PTON 703ifdef NO_INET_PTON
692 LIB_OBJS += compat/inet_pton.o 704 LIB_OBJS += $(OUTPUT)compat/inet_pton.o
693endif 705endif
694 706
695ifdef NO_ICONV 707ifdef NO_ICONV
@@ -706,15 +718,15 @@ endif
706 718
707ifdef PPC_SHA1 719ifdef PPC_SHA1
708 SHA1_HEADER = "ppc/sha1.h" 720 SHA1_HEADER = "ppc/sha1.h"
709 LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o 721 LIB_OBJS += $(OUTPUT)ppc/sha1.o ppc/sha1ppc.o
710else 722else
711ifdef ARM_SHA1 723ifdef ARM_SHA1
712 SHA1_HEADER = "arm/sha1.h" 724 SHA1_HEADER = "arm/sha1.h"
713 LIB_OBJS += arm/sha1.o arm/sha1_arm.o 725 LIB_OBJS += $(OUTPUT)arm/sha1.o $(OUTPUT)arm/sha1_arm.o
714else 726else
715ifdef MOZILLA_SHA1 727ifdef MOZILLA_SHA1
716 SHA1_HEADER = "mozilla-sha1/sha1.h" 728 SHA1_HEADER = "mozilla-sha1/sha1.h"
717 LIB_OBJS += mozilla-sha1/sha1.o 729 LIB_OBJS += $(OUTPUT)mozilla-sha1/sha1.o
718else 730else
719 SHA1_HEADER = <openssl/sha.h> 731 SHA1_HEADER = <openssl/sha.h>
720 EXTLIBS += $(LIB_4_CRYPTO) 732 EXTLIBS += $(LIB_4_CRYPTO)
@@ -726,15 +738,15 @@ ifdef NO_PERL_MAKEMAKER
726endif 738endif
727ifdef NO_HSTRERROR 739ifdef NO_HSTRERROR
728 COMPAT_CFLAGS += -DNO_HSTRERROR 740 COMPAT_CFLAGS += -DNO_HSTRERROR
729 COMPAT_OBJS += compat/hstrerror.o 741 COMPAT_OBJS += $(OUTPUT)compat/hstrerror.o
730endif 742endif
731ifdef NO_MEMMEM 743ifdef NO_MEMMEM
732 COMPAT_CFLAGS += -DNO_MEMMEM 744 COMPAT_CFLAGS += -DNO_MEMMEM
733 COMPAT_OBJS += compat/memmem.o 745 COMPAT_OBJS += $(OUTPUT)compat/memmem.o
734endif 746endif
735ifdef INTERNAL_QSORT 747ifdef INTERNAL_QSORT
736 COMPAT_CFLAGS += -DINTERNAL_QSORT 748 COMPAT_CFLAGS += -DINTERNAL_QSORT
737 COMPAT_OBJS += compat/qsort.o 749 COMPAT_OBJS += $(OUTPUT)compat/qsort.o
738endif 750endif
739ifdef RUNTIME_PREFIX 751ifdef RUNTIME_PREFIX
740 COMPAT_CFLAGS += -DRUNTIME_PREFIX 752 COMPAT_CFLAGS += -DRUNTIME_PREFIX
@@ -814,7 +826,7 @@ export TAR INSTALL DESTDIR SHELL_PATH
814 826
815SHELL = $(SHELL_PATH) 827SHELL = $(SHELL_PATH)
816 828
817all:: .perf.dev.null shell_compatibility_test $(ALL_PROGRAMS) $(BUILT_INS) $(OTHER_PROGRAMS) PERF-BUILD-OPTIONS 829all:: .perf.dev.null shell_compatibility_test $(ALL_PROGRAMS) $(BUILT_INS) $(OTHER_PROGRAMS) $(OUTPUT)PERF-BUILD-OPTIONS
818ifneq (,$X) 830ifneq (,$X)
819 $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) perf$X)), test '$p' -ef '$p$X' || $(RM) '$p';) 831 $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) perf$X)), test '$p' -ef '$p$X' || $(RM) '$p';)
820endif 832endif
@@ -826,39 +838,39 @@ please_set_SHELL_PATH_to_a_more_modern_shell:
826 838
827shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell 839shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell
828 840
829strip: $(PROGRAMS) perf$X 841strip: $(PROGRAMS) $(OUTPUT)perf$X
830 $(STRIP) $(STRIP_OPTS) $(PROGRAMS) perf$X 842 $(STRIP) $(STRIP_OPTS) $(PROGRAMS) $(OUTPUT)perf$X
831 843
832perf.o: perf.c common-cmds.h PERF-CFLAGS 844$(OUTPUT)perf.o: perf.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS
833 $(QUIET_CC)$(CC) -DPERF_VERSION='"$(PERF_VERSION)"' \ 845 $(QUIET_CC)$(CC) -DPERF_VERSION='"$(PERF_VERSION)"' \
834 '-DPERF_HTML_PATH="$(htmldir_SQ)"' \ 846 '-DPERF_HTML_PATH="$(htmldir_SQ)"' \
835 $(ALL_CFLAGS) -c $(filter %.c,$^) 847 $(ALL_CFLAGS) -c $(filter %.c,$^) -o $@
836 848
837perf$X: perf.o $(BUILTIN_OBJS) $(PERFLIBS) 849$(OUTPUT)perf$X: $(OUTPUT)perf.o $(BUILTIN_OBJS) $(PERFLIBS)
838 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ perf.o \ 850 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(OUTPUT)perf.o \
839 $(BUILTIN_OBJS) $(ALL_LDFLAGS) $(LIBS) 851 $(BUILTIN_OBJS) $(ALL_LDFLAGS) $(LIBS)
840 852
841builtin-help.o: builtin-help.c common-cmds.h PERF-CFLAGS 853$(OUTPUT)builtin-help.o: builtin-help.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS
842 $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) \ 854 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) \
843 '-DPERF_HTML_PATH="$(htmldir_SQ)"' \ 855 '-DPERF_HTML_PATH="$(htmldir_SQ)"' \
844 '-DPERF_MAN_PATH="$(mandir_SQ)"' \ 856 '-DPERF_MAN_PATH="$(mandir_SQ)"' \
845 '-DPERF_INFO_PATH="$(infodir_SQ)"' $< 857 '-DPERF_INFO_PATH="$(infodir_SQ)"' $<
846 858
847builtin-timechart.o: builtin-timechart.c common-cmds.h PERF-CFLAGS 859$(OUTPUT)builtin-timechart.o: builtin-timechart.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS
848 $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) \ 860 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) \
849 '-DPERF_HTML_PATH="$(htmldir_SQ)"' \ 861 '-DPERF_HTML_PATH="$(htmldir_SQ)"' \
850 '-DPERF_MAN_PATH="$(mandir_SQ)"' \ 862 '-DPERF_MAN_PATH="$(mandir_SQ)"' \
851 '-DPERF_INFO_PATH="$(infodir_SQ)"' $< 863 '-DPERF_INFO_PATH="$(infodir_SQ)"' $<
852 864
853$(BUILT_INS): perf$X 865$(BUILT_INS): $(OUTPUT)perf$X
854 $(QUIET_BUILT_IN)$(RM) $@ && \ 866 $(QUIET_BUILT_IN)$(RM) $@ && \
855 ln perf$X $@ 2>/dev/null || \ 867 ln perf$X $@ 2>/dev/null || \
856 ln -s perf$X $@ 2>/dev/null || \ 868 ln -s perf$X $@ 2>/dev/null || \
857 cp perf$X $@ 869 cp perf$X $@
858 870
859common-cmds.h: util/generate-cmdlist.sh command-list.txt 871$(OUTPUT)common-cmds.h: util/generate-cmdlist.sh command-list.txt
860 872
861common-cmds.h: $(wildcard Documentation/perf-*.txt) 873$(OUTPUT)common-cmds.h: $(wildcard Documentation/perf-*.txt)
862 $(QUIET_GEN). util/generate-cmdlist.sh > $@+ && mv $@+ $@ 874 $(QUIET_GEN). util/generate-cmdlist.sh > $@+ && mv $@+ $@
863 875
864$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh 876$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
@@ -870,7 +882,7 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
870 -e 's/@@NO_CURL@@/$(NO_CURL)/g' \ 882 -e 's/@@NO_CURL@@/$(NO_CURL)/g' \
871 $@.sh >$@+ && \ 883 $@.sh >$@+ && \
872 chmod +x $@+ && \ 884 chmod +x $@+ && \
873 mv $@+ $@ 885 mv $@+ $(OUTPUT)$@
874 886
875configure: configure.ac 887configure: configure.ac
876 $(QUIET_GEN)$(RM) $@ $<+ && \ 888 $(QUIET_GEN)$(RM) $@ $<+ && \
@@ -880,60 +892,60 @@ configure: configure.ac
880 $(RM) $<+ 892 $(RM) $<+
881 893
882# These can record PERF_VERSION 894# These can record PERF_VERSION
883perf.o perf.spec \ 895$(OUTPUT)perf.o perf.spec \
884 $(patsubst %.sh,%,$(SCRIPT_SH)) \ 896 $(patsubst %.sh,%,$(SCRIPT_SH)) \
885 $(patsubst %.perl,%,$(SCRIPT_PERL)) \ 897 $(patsubst %.perl,%,$(SCRIPT_PERL)) \
886 : PERF-VERSION-FILE 898 : $(OUTPUT)PERF-VERSION-FILE
887 899
888%.o: %.c PERF-CFLAGS 900$(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS
889 $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) $< 901 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<
890%.s: %.c PERF-CFLAGS 902$(OUTPUT)%.s: %.c $(OUTPUT)PERF-CFLAGS
891 $(QUIET_CC)$(CC) -S $(ALL_CFLAGS) $< 903 $(QUIET_CC)$(CC) -S $(ALL_CFLAGS) $<
892%.o: %.S 904$(OUTPUT)%.o: %.S
893 $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) $< 905 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<
894 906
895util/exec_cmd.o: util/exec_cmd.c PERF-CFLAGS 907$(OUTPUT)util/exec_cmd.o: util/exec_cmd.c $(OUTPUT)PERF-CFLAGS
896 $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) \ 908 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) \
897 '-DPERF_EXEC_PATH="$(perfexecdir_SQ)"' \ 909 '-DPERF_EXEC_PATH="$(perfexecdir_SQ)"' \
898 '-DBINDIR="$(bindir_relative_SQ)"' \ 910 '-DBINDIR="$(bindir_relative_SQ)"' \
899 '-DPREFIX="$(prefix_SQ)"' \ 911 '-DPREFIX="$(prefix_SQ)"' \
900 $< 912 $<
901 913
902builtin-init-db.o: builtin-init-db.c PERF-CFLAGS 914$(OUTPUT)builtin-init-db.o: builtin-init-db.c $(OUTPUT)PERF-CFLAGS
903 $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DDEFAULT_PERF_TEMPLATE_DIR='"$(template_dir_SQ)"' $< 915 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DDEFAULT_PERF_TEMPLATE_DIR='"$(template_dir_SQ)"' $<
904 916
905util/config.o: util/config.c PERF-CFLAGS 917$(OUTPUT)util/config.o: util/config.c $(OUTPUT)PERF-CFLAGS
906 $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $< 918 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
907 919
908util/rbtree.o: ../../lib/rbtree.c PERF-CFLAGS 920$(OUTPUT)util/rbtree.o: ../../lib/rbtree.c $(OUTPUT)PERF-CFLAGS
909 $(QUIET_CC)$(CC) -o util/rbtree.o -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $< 921 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
910 922
911# some perf warning policies can't fit to lib/bitmap.c, eg: it warns about variable shadowing 923# some perf warning policies can't fit to lib/bitmap.c, eg: it warns about variable shadowing
912# from <string.h> that comes from kernel headers wrapping. 924# from <string.h> that comes from kernel headers wrapping.
913KBITMAP_FLAGS=`echo $(ALL_CFLAGS) | sed s/-Wshadow// | sed s/-Wswitch-default// | sed s/-Wextra//` 925KBITMAP_FLAGS=`echo $(ALL_CFLAGS) | sed s/-Wshadow// | sed s/-Wswitch-default// | sed s/-Wextra//`
914 926
915util/bitmap.o: ../../lib/bitmap.c PERF-CFLAGS 927$(OUTPUT)util/bitmap.o: ../../lib/bitmap.c $(OUTPUT)PERF-CFLAGS
916 $(QUIET_CC)$(CC) -o util/bitmap.o -c $(KBITMAP_FLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $< 928 $(QUIET_CC)$(CC) -o $@ -c $(KBITMAP_FLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
917 929
918util/hweight.o: ../../lib/hweight.c PERF-CFLAGS 930$(OUTPUT)util/hweight.o: ../../lib/hweight.c $(OUTPUT)PERF-CFLAGS
919 $(QUIET_CC)$(CC) -o util/hweight.o -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $< 931 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
920 932
921util/find_next_bit.o: ../../lib/find_next_bit.c PERF-CFLAGS 933$(OUTPUT)util/find_next_bit.o: ../../lib/find_next_bit.c $(OUTPUT)PERF-CFLAGS
922 $(QUIET_CC)$(CC) -o util/find_next_bit.o -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $< 934 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
923 935
924util/scripting-engines/trace-event-perl.o: util/scripting-engines/trace-event-perl.c PERF-CFLAGS 936$(OUTPUT)util/scripting-engines/trace-event-perl.o: util/scripting-engines/trace-event-perl.c $(OUTPUT)PERF-CFLAGS
925 $(QUIET_CC)$(CC) -o util/scripting-engines/trace-event-perl.o -c $(ALL_CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow $< 937 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow $<
926 938
927scripts/perl/Perf-Trace-Util/Context.o: scripts/perl/Perf-Trace-Util/Context.c PERF-CFLAGS 939$(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o: scripts/perl/Perf-Trace-Util/Context.c $(OUTPUT)PERF-CFLAGS
928 $(QUIET_CC)$(CC) -o scripts/perl/Perf-Trace-Util/Context.o -c $(ALL_CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs $< 940 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs $<
929 941
930util/scripting-engines/trace-event-python.o: util/scripting-engines/trace-event-python.c PERF-CFLAGS 942$(OUTPUT)util/scripting-engines/trace-event-python.o: util/scripting-engines/trace-event-python.c $(OUTPUT)PERF-CFLAGS
931 $(QUIET_CC)$(CC) -o util/scripting-engines/trace-event-python.o -c $(ALL_CFLAGS) $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow $< 943 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow $<
932 944
933scripts/python/Perf-Trace-Util/Context.o: scripts/python/Perf-Trace-Util/Context.c PERF-CFLAGS 945$(OUTPUT)scripts/python/Perf-Trace-Util/Context.o: scripts/python/Perf-Trace-Util/Context.c $(OUTPUT)PERF-CFLAGS
934 $(QUIET_CC)$(CC) -o scripts/python/Perf-Trace-Util/Context.o -c $(ALL_CFLAGS) $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs $< 946 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs $<
935 947
936perf-%$X: %.o $(PERFLIBS) 948$(OUTPUT)perf-%$X: %.o $(PERFLIBS)
937 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) 949 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
938 950
939$(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H) 951$(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
@@ -974,17 +986,17 @@ cscope:
974TRACK_CFLAGS = $(subst ','\'',$(ALL_CFLAGS)):\ 986TRACK_CFLAGS = $(subst ','\'',$(ALL_CFLAGS)):\
975 $(bindir_SQ):$(perfexecdir_SQ):$(template_dir_SQ):$(prefix_SQ) 987 $(bindir_SQ):$(perfexecdir_SQ):$(template_dir_SQ):$(prefix_SQ)
976 988
977PERF-CFLAGS: .FORCE-PERF-CFLAGS 989$(OUTPUT)PERF-CFLAGS: .FORCE-PERF-CFLAGS
978 @FLAGS='$(TRACK_CFLAGS)'; \ 990 @FLAGS='$(TRACK_CFLAGS)'; \
979 if test x"$$FLAGS" != x"`cat PERF-CFLAGS 2>/dev/null`" ; then \ 991 if test x"$$FLAGS" != x"`cat $(OUTPUT)PERF-CFLAGS 2>/dev/null`" ; then \
980 echo 1>&2 " * new build flags or prefix"; \ 992 echo 1>&2 " * new build flags or prefix"; \
981 echo "$$FLAGS" >PERF-CFLAGS; \ 993 echo "$$FLAGS" >$(OUTPUT)PERF-CFLAGS; \
982 fi 994 fi
983 995
984# We need to apply sq twice, once to protect from the shell 996# We need to apply sq twice, once to protect from the shell
985# that runs PERF-BUILD-OPTIONS, and then again to protect it 997# that runs $(OUTPUT)PERF-BUILD-OPTIONS, and then again to protect it
986# and the first level quoting from the shell that runs "echo". 998# and the first level quoting from the shell that runs "echo".
987PERF-BUILD-OPTIONS: .FORCE-PERF-BUILD-OPTIONS 999$(OUTPUT)PERF-BUILD-OPTIONS: .FORCE-PERF-BUILD-OPTIONS
988 @echo SHELL_PATH=\''$(subst ','\'',$(SHELL_PATH_SQ))'\' >$@ 1000 @echo SHELL_PATH=\''$(subst ','\'',$(SHELL_PATH_SQ))'\' >$@
989 @echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@ 1001 @echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@
990 @echo NO_CURL=\''$(subst ','\'',$(subst ','\'',$(NO_CURL)))'\' >>$@ 1002 @echo NO_CURL=\''$(subst ','\'',$(subst ','\'',$(NO_CURL)))'\' >>$@
@@ -1005,7 +1017,7 @@ all:: $(TEST_PROGRAMS)
1005 1017
1006export NO_SVN_TESTS 1018export NO_SVN_TESTS
1007 1019
1008check: common-cmds.h 1020check: $(OUTPUT)common-cmds.h
1009 if sparse; \ 1021 if sparse; \
1010 then \ 1022 then \
1011 for i in *.c */*.c; \ 1023 for i in *.c */*.c; \
@@ -1039,10 +1051,10 @@ export perfexec_instdir
1039 1051
1040install: all 1052install: all
1041 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)' 1053 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
1042 $(INSTALL) perf$X '$(DESTDIR_SQ)$(bindir_SQ)' 1054 $(INSTALL) $(OUTPUT)perf$X '$(DESTDIR_SQ)$(bindir_SQ)'
1043 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace' 1055 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'
1044 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin' 1056 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin'
1045 $(INSTALL) perf-archive -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)' 1057 $(INSTALL) $(OUTPUT)perf-archive -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
1046 $(INSTALL) scripts/perl/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace' 1058 $(INSTALL) scripts/perl/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'
1047 $(INSTALL) scripts/perl/*.pl -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl' 1059 $(INSTALL) scripts/perl/*.pl -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl'
1048 $(INSTALL) scripts/perl/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin' 1060 $(INSTALL) scripts/perl/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin'
@@ -1056,7 +1068,7 @@ ifdef BUILT_INS
1056 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)' 1068 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
1057 $(INSTALL) $(BUILT_INS) '$(DESTDIR_SQ)$(perfexec_instdir_SQ)' 1069 $(INSTALL) $(BUILT_INS) '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
1058ifneq (,$X) 1070ifneq (,$X)
1059 $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) perf$X)), $(RM) '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/$p';) 1071 $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) $(OUTPUT)perf$X)), $(RM) '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/$p';)
1060endif 1072endif
1061endif 1073endif
1062 1074
@@ -1140,14 +1152,14 @@ clean:
1140 $(RM) *.o */*.o */*/*.o */*/*/*.o $(LIB_FILE) 1152 $(RM) *.o */*.o */*/*.o */*/*/*.o $(LIB_FILE)
1141 $(RM) $(ALL_PROGRAMS) $(BUILT_INS) perf$X 1153 $(RM) $(ALL_PROGRAMS) $(BUILT_INS) perf$X
1142 $(RM) $(TEST_PROGRAMS) 1154 $(RM) $(TEST_PROGRAMS)
1143 $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags cscope* 1155 $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope*
1144 $(RM) -r autom4te.cache 1156 $(RM) -r autom4te.cache
1145 $(RM) config.log config.mak.autogen config.mak.append config.status config.cache 1157 $(RM) config.log config.mak.autogen config.mak.append config.status config.cache
1146 $(RM) -r $(PERF_TARNAME) .doc-tmp-dir 1158 $(RM) -r $(PERF_TARNAME) .doc-tmp-dir
1147 $(RM) $(PERF_TARNAME).tar.gz perf-core_$(PERF_VERSION)-*.tar.gz 1159 $(RM) $(PERF_TARNAME).tar.gz perf-core_$(PERF_VERSION)-*.tar.gz
1148 $(RM) $(htmldocs).tar.gz $(manpages).tar.gz 1160 $(RM) $(htmldocs).tar.gz $(manpages).tar.gz
1149 $(MAKE) -C Documentation/ clean 1161 $(MAKE) -C Documentation/ clean
1150 $(RM) PERF-VERSION-FILE PERF-CFLAGS PERF-BUILD-OPTIONS 1162 $(RM) $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)PERF-CFLAGS $(OUTPUT)PERF-BUILD-OPTIONS
1151 1163
1152.PHONY: all install clean strip 1164.PHONY: all install clean strip
1153.PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell 1165.PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
diff --git a/tools/perf/util/PERF-VERSION-GEN b/tools/perf/util/PERF-VERSION-GEN
index 54552a00a117..49ece7921914 100755
--- a/tools/perf/util/PERF-VERSION-GEN
+++ b/tools/perf/util/PERF-VERSION-GEN
@@ -1,6 +1,10 @@
1#!/bin/sh 1#!/bin/sh
2 2
3GVF=PERF-VERSION-FILE 3if [ $# -eq 1 ] ; then
4 OUTPUT=$1
5fi
6
7GVF=${OUTPUT}PERF-VERSION-FILE
4DEF_VER=v0.0.2.PERF 8DEF_VER=v0.0.2.PERF
5 9
6LF=' 10LF='