diff options
author | Jiri Olsa <jolsa@redhat.com> | 2014-01-03 09:32:32 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-01-13 08:06:22 -0500 |
commit | a6cf5f39236c2ea6008a2f5cb908c3181c123096 (patch) | |
tree | 28c2448afb14845c0bebf4b487a0eca52bf6d5c7 /tools/perf | |
parent | 41cde47675de62ee0f3877c00ab44373b2b2f4ca (diff) |
perf tools: Move arch setup into seprate Makefile
I need to use arch related setup in the tests/make, so moving arch setup
into Makefile.arch.
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1388759553-12974-1-git-send-email-jolsa@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/config/Makefile | 52 | ||||
-rw-r--r-- | tools/perf/config/Makefile.arch | 22 |
2 files changed, 40 insertions, 34 deletions
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile index 14faeeb0d752..f2bc659d20af 100644 --- a/tools/perf/config/Makefile +++ b/tools/perf/config/Makefile | |||
@@ -1,28 +1,26 @@ | |||
1 | uname_M := $(shell uname -m 2>/dev/null || echo not) | ||
2 | 1 | ||
3 | ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ | 2 | ifeq ($(src-perf),) |
4 | -e s/arm.*/arm/ -e s/sa110/arm/ \ | 3 | src-perf := $(srctree)/tools/perf |
5 | -e s/s390x/s390/ -e s/parisc64/parisc/ \ | 4 | endif |
6 | -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \ | ||
7 | -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ ) | ||
8 | NO_PERF_REGS := 1 | ||
9 | CFLAGS := $(EXTRA_CFLAGS) $(EXTRA_WARNINGS) | ||
10 | 5 | ||
11 | # Additional ARCH settings for x86 | 6 | ifeq ($(obj-perf),) |
12 | ifeq ($(ARCH),i386) | 7 | obj-perf := $(OUTPUT) |
13 | override ARCH := x86 | ||
14 | NO_PERF_REGS := 0 | ||
15 | LIBUNWIND_LIBS = -lunwind -lunwind-x86 | ||
16 | endif | 8 | endif |
17 | 9 | ||
18 | ifeq ($(ARCH),x86_64) | 10 | ifneq ($(obj-perf),) |
19 | override ARCH := x86 | 11 | obj-perf := $(abspath $(obj-perf))/ |
20 | IS_X86_64 := 0 | 12 | endif |
21 | ifeq (, $(findstring m32,$(CFLAGS))) | 13 | |
22 | IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -x c - | tail -n 1) | 14 | LIB_INCLUDE := $(srctree)/tools/lib/ |
23 | endif | 15 | CFLAGS := $(EXTRA_CFLAGS) $(EXTRA_WARNINGS) |
16 | |||
17 | include $(src-perf)/config/Makefile.arch | ||
18 | |||
19 | NO_PERF_REGS := 1 | ||
20 | |||
21 | # Additional ARCH settings for x86 | ||
22 | ifeq ($(ARCH),x86) | ||
24 | ifeq (${IS_X86_64}, 1) | 23 | ifeq (${IS_X86_64}, 1) |
25 | RAW_ARCH := x86_64 | ||
26 | CFLAGS += -DHAVE_ARCH_X86_64_SUPPORT | 24 | CFLAGS += -DHAVE_ARCH_X86_64_SUPPORT |
27 | ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S | 25 | ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S |
28 | LIBUNWIND_LIBS = -lunwind -lunwind-x86_64 | 26 | LIBUNWIND_LIBS = -lunwind -lunwind-x86_64 |
@@ -64,20 +62,6 @@ ifeq ($(NO_PERF_REGS),0) | |||
64 | CFLAGS += -DHAVE_PERF_REGS_SUPPORT | 62 | CFLAGS += -DHAVE_PERF_REGS_SUPPORT |
65 | endif | 63 | endif |
66 | 64 | ||
67 | ifeq ($(src-perf),) | ||
68 | src-perf := $(srctree)/tools/perf | ||
69 | endif | ||
70 | |||
71 | ifeq ($(obj-perf),) | ||
72 | obj-perf := $(OUTPUT) | ||
73 | endif | ||
74 | |||
75 | ifneq ($(obj-perf),) | ||
76 | obj-perf := $(abspath $(obj-perf))/ | ||
77 | endif | ||
78 | |||
79 | LIB_INCLUDE := $(srctree)/tools/lib/ | ||
80 | |||
81 | # include ARCH specific config | 65 | # include ARCH specific config |
82 | -include $(src-perf)/arch/$(ARCH)/Makefile | 66 | -include $(src-perf)/arch/$(ARCH)/Makefile |
83 | 67 | ||
diff --git a/tools/perf/config/Makefile.arch b/tools/perf/config/Makefile.arch new file mode 100644 index 000000000000..fef8ae922800 --- /dev/null +++ b/tools/perf/config/Makefile.arch | |||
@@ -0,0 +1,22 @@ | |||
1 | |||
2 | uname_M := $(shell uname -m 2>/dev/null || echo not) | ||
3 | |||
4 | ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ | ||
5 | -e s/arm.*/arm/ -e s/sa110/arm/ \ | ||
6 | -e s/s390x/s390/ -e s/parisc64/parisc/ \ | ||
7 | -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \ | ||
8 | -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ ) | ||
9 | |||
10 | # Additional ARCH settings for x86 | ||
11 | ifeq ($(ARCH),i386) | ||
12 | override ARCH := x86 | ||
13 | endif | ||
14 | |||
15 | ifeq ($(ARCH),x86_64) | ||
16 | override ARCH := x86 | ||
17 | IS_X86_64 := 0 | ||
18 | ifeq (, $(findstring m32,$(CFLAGS))) | ||
19 | IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -x c - | tail -n 1) | ||
20 | RAW_ARCH := x86_64 | ||
21 | endif | ||
22 | endif | ||