diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-03-27 13:30:45 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-04-02 15:28:03 -0400 |
commit | c29ede615fd35a640e771fbbb1778e915fac43a7 (patch) | |
tree | 269de5b6479899a3905d3a3ab2472ef9054f017b /tools/perf | |
parent | 8b2c551f9635bf1c5c2d38de300137998915478f (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/perf')
-rw-r--r-- | tools/perf/Makefile | 322 | ||||
-rwxr-xr-x | tools/perf/util/PERF-VERSION-GEN | 6 |
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 @@ | |||
1 | ifeq ("$(origin O)", "command line") | ||
2 | OUTPUT := $(O)/ | ||
3 | endif | ||
4 | |||
1 | # The default target of this Makefile is... | 5 | # The default target of this Makefile is... |
2 | all:: | 6 | all:: |
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 | ||
156 | PERF-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 | ||
160 | uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') | 168 | uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') |
161 | uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not') | 169 | uname_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 | # |
313 | PROGRAMS += perf | 321 | PROGRAMS += $(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 | |||
320 | ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS) | 328 | ALL_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 |
323 | OTHER_PROGRAMS = perf$X | 331 | OTHER_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. |
326 | ifndef SHELL_PATH | 334 | ifndef SHELL_PATH |
@@ -332,7 +340,7 @@ endif | |||
332 | 340 | ||
333 | export PERL_PATH | 341 | export PERL_PATH |
334 | 342 | ||
335 | LIB_FILE=libperf.a | 343 | LIB_FILE=$(OUTPUT)libperf.a |
336 | 344 | ||
337 | LIB_H += ../../include/linux/perf_event.h | 345 | LIB_H += ../../include/linux/perf_event.h |
338 | LIB_H += ../../include/linux/rbtree.h | 346 | LIB_H += ../../include/linux/rbtree.h |
@@ -393,77 +401,77 @@ LIB_H += util/probe-finder.h | |||
393 | LIB_H += util/probe-event.h | 401 | LIB_H += util/probe-event.h |
394 | LIB_H += util/cpumap.h | 402 | LIB_H += util/cpumap.h |
395 | 403 | ||
396 | LIB_OBJS += util/abspath.o | 404 | LIB_OBJS += $(OUTPUT)util/abspath.o |
397 | LIB_OBJS += util/alias.o | 405 | LIB_OBJS += $(OUTPUT)util/alias.o |
398 | LIB_OBJS += util/build-id.o | 406 | LIB_OBJS += $(OUTPUT)util/build-id.o |
399 | LIB_OBJS += util/config.o | 407 | LIB_OBJS += $(OUTPUT)util/config.o |
400 | LIB_OBJS += util/ctype.o | 408 | LIB_OBJS += $(OUTPUT)util/ctype.o |
401 | LIB_OBJS += util/debugfs.o | 409 | LIB_OBJS += $(OUTPUT)util/debugfs.o |
402 | LIB_OBJS += util/environment.o | 410 | LIB_OBJS += $(OUTPUT)util/environment.o |
403 | LIB_OBJS += util/event.o | 411 | LIB_OBJS += $(OUTPUT)util/event.o |
404 | LIB_OBJS += util/exec_cmd.o | 412 | LIB_OBJS += $(OUTPUT)util/exec_cmd.o |
405 | LIB_OBJS += util/help.o | 413 | LIB_OBJS += $(OUTPUT)util/help.o |
406 | LIB_OBJS += util/levenshtein.o | 414 | LIB_OBJS += $(OUTPUT)util/levenshtein.o |
407 | LIB_OBJS += util/parse-options.o | 415 | LIB_OBJS += $(OUTPUT)util/parse-options.o |
408 | LIB_OBJS += util/parse-events.o | 416 | LIB_OBJS += $(OUTPUT)util/parse-events.o |
409 | LIB_OBJS += util/path.o | 417 | LIB_OBJS += $(OUTPUT)util/path.o |
410 | LIB_OBJS += util/rbtree.o | 418 | LIB_OBJS += $(OUTPUT)util/rbtree.o |
411 | LIB_OBJS += util/bitmap.o | 419 | LIB_OBJS += $(OUTPUT)util/bitmap.o |
412 | LIB_OBJS += util/hweight.o | 420 | LIB_OBJS += $(OUTPUT)util/hweight.o |
413 | LIB_OBJS += util/find_next_bit.o | 421 | LIB_OBJS += $(OUTPUT)util/find_next_bit.o |
414 | LIB_OBJS += util/run-command.o | 422 | LIB_OBJS += $(OUTPUT)util/run-command.o |
415 | LIB_OBJS += util/quote.o | 423 | LIB_OBJS += $(OUTPUT)util/quote.o |
416 | LIB_OBJS += util/strbuf.o | 424 | LIB_OBJS += $(OUTPUT)util/strbuf.o |
417 | LIB_OBJS += util/string.o | 425 | LIB_OBJS += $(OUTPUT)util/string.o |
418 | LIB_OBJS += util/strlist.o | 426 | LIB_OBJS += $(OUTPUT)util/strlist.o |
419 | LIB_OBJS += util/usage.o | 427 | LIB_OBJS += $(OUTPUT)util/usage.o |
420 | LIB_OBJS += util/wrapper.o | 428 | LIB_OBJS += $(OUTPUT)util/wrapper.o |
421 | LIB_OBJS += util/sigchain.o | 429 | LIB_OBJS += $(OUTPUT)util/sigchain.o |
422 | LIB_OBJS += util/symbol.o | 430 | LIB_OBJS += $(OUTPUT)util/symbol.o |
423 | LIB_OBJS += util/color.o | 431 | LIB_OBJS += $(OUTPUT)util/color.o |
424 | LIB_OBJS += util/pager.o | 432 | LIB_OBJS += $(OUTPUT)util/pager.o |
425 | LIB_OBJS += util/header.o | 433 | LIB_OBJS += $(OUTPUT)util/header.o |
426 | LIB_OBJS += util/callchain.o | 434 | LIB_OBJS += $(OUTPUT)util/callchain.o |
427 | LIB_OBJS += util/values.o | 435 | LIB_OBJS += $(OUTPUT)util/values.o |
428 | LIB_OBJS += util/debug.o | 436 | LIB_OBJS += $(OUTPUT)util/debug.o |
429 | LIB_OBJS += util/map.o | 437 | LIB_OBJS += $(OUTPUT)util/map.o |
430 | LIB_OBJS += util/session.o | 438 | LIB_OBJS += $(OUTPUT)util/session.o |
431 | LIB_OBJS += util/thread.o | 439 | LIB_OBJS += $(OUTPUT)util/thread.o |
432 | LIB_OBJS += util/trace-event-parse.o | 440 | LIB_OBJS += $(OUTPUT)util/trace-event-parse.o |
433 | LIB_OBJS += util/trace-event-read.o | 441 | LIB_OBJS += $(OUTPUT)util/trace-event-read.o |
434 | LIB_OBJS += util/trace-event-info.o | 442 | LIB_OBJS += $(OUTPUT)util/trace-event-info.o |
435 | LIB_OBJS += util/trace-event-scripting.o | 443 | LIB_OBJS += $(OUTPUT)util/trace-event-scripting.o |
436 | LIB_OBJS += util/svghelper.o | 444 | LIB_OBJS += $(OUTPUT)util/svghelper.o |
437 | LIB_OBJS += util/sort.o | 445 | LIB_OBJS += $(OUTPUT)util/sort.o |
438 | LIB_OBJS += util/hist.o | 446 | LIB_OBJS += $(OUTPUT)util/hist.o |
439 | LIB_OBJS += util/probe-event.o | 447 | LIB_OBJS += $(OUTPUT)util/probe-event.o |
440 | LIB_OBJS += util/util.o | 448 | LIB_OBJS += $(OUTPUT)util/util.o |
441 | LIB_OBJS += util/cpumap.o | 449 | LIB_OBJS += $(OUTPUT)util/cpumap.o |
442 | 450 | ||
443 | BUILTIN_OBJS += builtin-annotate.o | 451 | BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o |
444 | 452 | ||
445 | BUILTIN_OBJS += builtin-bench.o | 453 | BUILTIN_OBJS += $(OUTPUT)builtin-bench.o |
446 | 454 | ||
447 | # Benchmark modules | 455 | # Benchmark modules |
448 | BUILTIN_OBJS += bench/sched-messaging.o | 456 | BUILTIN_OBJS += $(OUTPUT)bench/sched-messaging.o |
449 | BUILTIN_OBJS += bench/sched-pipe.o | 457 | BUILTIN_OBJS += $(OUTPUT)bench/sched-pipe.o |
450 | BUILTIN_OBJS += bench/mem-memcpy.o | 458 | BUILTIN_OBJS += $(OUTPUT)bench/mem-memcpy.o |
451 | 459 | ||
452 | BUILTIN_OBJS += builtin-diff.o | 460 | BUILTIN_OBJS += $(OUTPUT)builtin-diff.o |
453 | BUILTIN_OBJS += builtin-help.o | 461 | BUILTIN_OBJS += $(OUTPUT)builtin-help.o |
454 | BUILTIN_OBJS += builtin-sched.o | 462 | BUILTIN_OBJS += $(OUTPUT)builtin-sched.o |
455 | BUILTIN_OBJS += builtin-buildid-list.o | 463 | BUILTIN_OBJS += $(OUTPUT)builtin-buildid-list.o |
456 | BUILTIN_OBJS += builtin-buildid-cache.o | 464 | BUILTIN_OBJS += $(OUTPUT)builtin-buildid-cache.o |
457 | BUILTIN_OBJS += builtin-list.o | 465 | BUILTIN_OBJS += $(OUTPUT)builtin-list.o |
458 | BUILTIN_OBJS += builtin-record.o | 466 | BUILTIN_OBJS += $(OUTPUT)builtin-record.o |
459 | BUILTIN_OBJS += builtin-report.o | 467 | BUILTIN_OBJS += $(OUTPUT)builtin-report.o |
460 | BUILTIN_OBJS += builtin-stat.o | 468 | BUILTIN_OBJS += $(OUTPUT)builtin-stat.o |
461 | BUILTIN_OBJS += builtin-timechart.o | 469 | BUILTIN_OBJS += $(OUTPUT)builtin-timechart.o |
462 | BUILTIN_OBJS += builtin-top.o | 470 | BUILTIN_OBJS += $(OUTPUT)builtin-top.o |
463 | BUILTIN_OBJS += builtin-trace.o | 471 | BUILTIN_OBJS += $(OUTPUT)builtin-trace.o |
464 | BUILTIN_OBJS += builtin-probe.o | 472 | BUILTIN_OBJS += $(OUTPUT)builtin-probe.o |
465 | BUILTIN_OBJS += builtin-kmem.o | 473 | BUILTIN_OBJS += $(OUTPUT)builtin-kmem.o |
466 | BUILTIN_OBJS += builtin-lock.o | 474 | BUILTIN_OBJS += $(OUTPUT)builtin-lock.o |
467 | 475 | ||
468 | PERFLIBS = $(LIB_FILE) | 476 | PERFLIBS = $(LIB_FILE) |
469 | 477 | ||
@@ -494,6 +502,10 @@ ifeq ($(uname_S),Darwin) | |||
494 | PTHREAD_LIBS = | 502 | PTHREAD_LIBS = |
495 | endif | 503 | endif |
496 | 504 | ||
505 | ifneq ($(OUTPUT),) | ||
506 | BASIC_CFLAGS += -I$(OUTPUT) | ||
507 | endif | ||
508 | |||
497 | ifeq ($(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) | 509 | ifeq ($(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) |
498 | ifneq ($(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) | 510 | ifneq ($(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 | |||
512 | ifndef NO_DWARF | 524 | ifndef 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 |
516 | endif | 528 | endif |
517 | endif | 529 | endif |
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 |
522 | else | 534 | else |
523 | EXTLIBS += -lnewt | 535 | EXTLIBS += -lnewt |
524 | LIB_OBJS += util/newt.o | 536 | LIB_OBJS += $(OUTPUT)util/newt.o |
525 | endif | 537 | endif |
526 | 538 | ||
527 | ifndef NO_LIBPERL | 539 | ifndef 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 |
534 | else | 546 | else |
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 |
538 | endif | 550 | endif |
539 | 551 | ||
540 | ifndef NO_LIBPYTHON | 552 | ifndef 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 |
547 | else | 559 | else |
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 |
551 | endif | 563 | endif |
552 | 564 | ||
553 | ifdef NO_DEMANGLE | 565 | ifdef NO_DEMANGLE |
@@ -618,53 +630,53 @@ ifdef NO_C99_FORMAT | |||
618 | endif | 630 | endif |
619 | ifdef SNPRINTF_RETURNS_BOGUS | 631 | ifdef 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 |
622 | endif | 634 | endif |
623 | ifdef FREAD_READS_DIRECTORIES | 635 | ifdef 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 |
626 | endif | 638 | endif |
627 | ifdef NO_SYMLINK_HEAD | 639 | ifdef NO_SYMLINK_HEAD |
628 | BASIC_CFLAGS += -DNO_SYMLINK_HEAD | 640 | BASIC_CFLAGS += -DNO_SYMLINK_HEAD |
629 | endif | 641 | endif |
630 | ifdef NO_STRCASESTR | 642 | ifdef 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 |
633 | endif | 645 | endif |
634 | ifdef NO_STRTOUMAX | 646 | ifdef 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 |
637 | endif | 649 | endif |
638 | ifdef NO_STRTOULL | 650 | ifdef NO_STRTOULL |
639 | COMPAT_CFLAGS += -DNO_STRTOULL | 651 | COMPAT_CFLAGS += -DNO_STRTOULL |
640 | endif | 652 | endif |
641 | ifdef NO_SETENV | 653 | ifdef 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 |
644 | endif | 656 | endif |
645 | ifdef NO_MKDTEMP | 657 | ifdef 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 |
648 | endif | 660 | endif |
649 | ifdef NO_UNSETENV | 661 | ifdef 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 |
652 | endif | 664 | endif |
653 | ifdef NO_SYS_SELECT_H | 665 | ifdef NO_SYS_SELECT_H |
654 | BASIC_CFLAGS += -DNO_SYS_SELECT_H | 666 | BASIC_CFLAGS += -DNO_SYS_SELECT_H |
655 | endif | 667 | endif |
656 | ifdef NO_MMAP | 668 | ifdef 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 |
659 | else | 671 | else |
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 |
664 | endif | 676 | endif |
665 | ifdef NO_PREAD | 677 | ifdef 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 |
668 | endif | 680 | endif |
669 | ifdef NO_FAST_WORKING_DIRECTORY | 681 | ifdef NO_FAST_WORKING_DIRECTORY |
670 | BASIC_CFLAGS += -DNO_FAST_WORKING_DIRECTORY | 682 | BASIC_CFLAGS += -DNO_FAST_WORKING_DIRECTORY |
@@ -686,10 +698,10 @@ else | |||
686 | endif | 698 | endif |
687 | endif | 699 | endif |
688 | ifdef NO_INET_NTOP | 700 | ifdef NO_INET_NTOP |
689 | LIB_OBJS += compat/inet_ntop.o | 701 | LIB_OBJS += $(OUTPUT)compat/inet_ntop.o |
690 | endif | 702 | endif |
691 | ifdef NO_INET_PTON | 703 | ifdef NO_INET_PTON |
692 | LIB_OBJS += compat/inet_pton.o | 704 | LIB_OBJS += $(OUTPUT)compat/inet_pton.o |
693 | endif | 705 | endif |
694 | 706 | ||
695 | ifdef NO_ICONV | 707 | ifdef NO_ICONV |
@@ -706,15 +718,15 @@ endif | |||
706 | 718 | ||
707 | ifdef PPC_SHA1 | 719 | ifdef 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 |
710 | else | 722 | else |
711 | ifdef ARM_SHA1 | 723 | ifdef 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 |
714 | else | 726 | else |
715 | ifdef MOZILLA_SHA1 | 727 | ifdef 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 |
718 | else | 730 | else |
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 | |||
726 | endif | 738 | endif |
727 | ifdef NO_HSTRERROR | 739 | ifdef 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 |
730 | endif | 742 | endif |
731 | ifdef NO_MEMMEM | 743 | ifdef 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 |
734 | endif | 746 | endif |
735 | ifdef INTERNAL_QSORT | 747 | ifdef 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 |
738 | endif | 750 | endif |
739 | ifdef RUNTIME_PREFIX | 751 | ifdef RUNTIME_PREFIX |
740 | COMPAT_CFLAGS += -DRUNTIME_PREFIX | 752 | COMPAT_CFLAGS += -DRUNTIME_PREFIX |
@@ -814,7 +826,7 @@ export TAR INSTALL DESTDIR SHELL_PATH | |||
814 | 826 | ||
815 | SHELL = $(SHELL_PATH) | 827 | SHELL = $(SHELL_PATH) |
816 | 828 | ||
817 | all:: .perf.dev.null shell_compatibility_test $(ALL_PROGRAMS) $(BUILT_INS) $(OTHER_PROGRAMS) PERF-BUILD-OPTIONS | 829 | all:: .perf.dev.null shell_compatibility_test $(ALL_PROGRAMS) $(BUILT_INS) $(OTHER_PROGRAMS) $(OUTPUT)PERF-BUILD-OPTIONS |
818 | ifneq (,$X) | 830 | ifneq (,$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';) |
820 | endif | 832 | endif |
@@ -826,39 +838,39 @@ please_set_SHELL_PATH_to_a_more_modern_shell: | |||
826 | 838 | ||
827 | shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell | 839 | shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell |
828 | 840 | ||
829 | strip: $(PROGRAMS) perf$X | 841 | strip: $(PROGRAMS) $(OUTPUT)perf$X |
830 | $(STRIP) $(STRIP_OPTS) $(PROGRAMS) perf$X | 842 | $(STRIP) $(STRIP_OPTS) $(PROGRAMS) $(OUTPUT)perf$X |
831 | 843 | ||
832 | perf.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 | ||
837 | perf$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 | ||
841 | builtin-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 | ||
847 | builtin-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 | ||
859 | common-cmds.h: util/generate-cmdlist.sh command-list.txt | 871 | $(OUTPUT)common-cmds.h: util/generate-cmdlist.sh command-list.txt |
860 | 872 | ||
861 | common-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 | ||
875 | configure: configure.ac | 887 | configure: 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 |
883 | perf.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 | ||
895 | util/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 | ||
902 | builtin-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 | ||
905 | util/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 | ||
908 | util/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. |
913 | KBITMAP_FLAGS=`echo $(ALL_CFLAGS) | sed s/-Wshadow// | sed s/-Wswitch-default// | sed s/-Wextra//` | 925 | KBITMAP_FLAGS=`echo $(ALL_CFLAGS) | sed s/-Wshadow// | sed s/-Wswitch-default// | sed s/-Wextra//` |
914 | 926 | ||
915 | util/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 | ||
918 | util/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 | ||
921 | util/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 | ||
924 | util/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 | ||
927 | scripts/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 | ||
930 | util/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 | ||
933 | scripts/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 | ||
936 | perf-%$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: | |||
974 | TRACK_CFLAGS = $(subst ','\'',$(ALL_CFLAGS)):\ | 986 | TRACK_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 | ||
977 | PERF-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". |
987 | PERF-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 | ||
1006 | export NO_SVN_TESTS | 1018 | export NO_SVN_TESTS |
1007 | 1019 | ||
1008 | check: common-cmds.h | 1020 | check: $(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 | ||
1040 | install: all | 1052 | install: 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)' |
1058 | ifneq (,$X) | 1070 | ifneq (,$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';) |
1060 | endif | 1072 | endif |
1061 | endif | 1073 | endif |
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 | ||
3 | GVF=PERF-VERSION-FILE | 3 | if [ $# -eq 1 ] ; then |
4 | OUTPUT=$1 | ||
5 | fi | ||
6 | |||
7 | GVF=${OUTPUT}PERF-VERSION-FILE | ||
4 | DEF_VER=v0.0.2.PERF | 8 | DEF_VER=v0.0.2.PERF |
5 | 9 | ||
6 | LF=' | 10 | LF=' |