From: Jiri Olsa <jolsa@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Jiri Olsa <jolsa@redhat.com>,
Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Ingo Molnar <mingo@elte.hu>, Paul Mackerras <paulus@samba.org>,
Corey Ashford <cjashfor@linux.vnet.ibm.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Namhyung Kim <namhyung@kernel.org>,
Borislav Petkov <bp@alien8.de>,
Stephane Eranian <eranian@google.com>,
Sam Ravnborg <sam@ravnborg.org>, David Ahern <dsahern@gmail.com>
Subject: [PATCH 03/26] perf tools: Move arch check into config/Makefile
Date: Wed, 24 Apr 2013 11:37:30 +0200 [thread overview]
Message-ID: <1366796273-4780-4-git-send-email-jolsa@redhat.com> (raw)
In-Reply-To: <1366796273-4780-1-git-send-email-jolsa@redhat.com>
Moving arch check into config/Makefile.
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Stephane Eranian <eranian@google.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: David Ahern <dsahern@gmail.com>
---
tools/perf/Makefile | 43 +++++++++++++++----------------------------
tools/perf/config/Makefile | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 49 insertions(+), 28 deletions(-)
create mode 100644 tools/perf/config/Makefile
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index c8fb0fd..518d540 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -55,37 +55,25 @@ include config/utilities.mak
$(OUTPUT)PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE
@$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT)
-uname_M := $(shell uname -m 2>/dev/null || echo not)
-
-ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
- -e s/arm.*/arm/ -e s/sa110/arm/ \
- -e s/s390x/s390/ -e s/parisc64/parisc/ \
- -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
- -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ )
-NO_PERF_REGS := 1
-
CC = $(CROSS_COMPILE)gcc
AR = $(CROSS_COMPILE)ar
-# Additional ARCH settings for x86
-ifeq ($(ARCH),i386)
- override ARCH := x86
- NO_PERF_REGS := 0
- LIBUNWIND_LIBS = -lunwind -lunwind-x86
+# include config/Makefile by default and rule out
+# non-config cases
+config := 1
+
+# standalone clean
+ifeq ($(MAKECMDGOALS),clean)
+ config := 0
endif
-ifeq ($(ARCH),x86_64)
- override ARCH := x86
- IS_X86_64 := 0
- ifeq (, $(findstring m32,$(EXTRA_CFLAGS)))
- IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -x c - | tail -n 1)
- endif
- ifeq (${IS_X86_64}, 1)
- RAW_ARCH := x86_64
- ARCH_CFLAGS := -DARCH_X86_64
- ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S
- endif
- NO_PERF_REGS := 0
- LIBUNWIND_LIBS = -lunwind -lunwind-x86_64
+
+# tags cscope
+ifneq ($(filter tags cscope,$(MAKECMDGOALS)),)
+ config := 0
+endif
+
+ifeq ($(config),1)
+include config/Makefile
endif
# Treat warnings as errors unless directed not to
@@ -857,7 +845,6 @@ ifeq ($(NO_PERF_REGS),0)
ifeq ($(ARCH),x86)
LIB_H += arch/x86/include/perf_regs.h
endif
- BASIC_CFLAGS += -DHAVE_PERF_REGS
endif
ifndef NO_STRLCPY
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
new file mode 100644
index 0000000..fe317c2
--- /dev/null
+++ b/tools/perf/config/Makefile
@@ -0,0 +1,34 @@
+uname_M := $(shell uname -m 2>/dev/null || echo not)
+
+ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
+ -e s/arm.*/arm/ -e s/sa110/arm/ \
+ -e s/s390x/s390/ -e s/parisc64/parisc/ \
+ -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
+ -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ )
+NO_PERF_REGS := 1
+
+# Additional ARCH settings for x86
+ifeq ($(ARCH),i386)
+ override ARCH := x86
+ NO_PERF_REGS := 0
+ LIBUNWIND_LIBS = -lunwind -lunwind-x86
+endif
+
+ifeq ($(ARCH),x86_64)
+ override ARCH := x86
+ IS_X86_64 := 0
+ ifeq (, $(findstring m32,$(EXTRA_CFLAGS)))
+ IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -x c - | tail -n 1)
+ endif
+ ifeq (${IS_X86_64}, 1)
+ RAW_ARCH := x86_64
+ ARCH_CFLAGS := -DARCH_X86_64
+ ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S
+ endif
+ NO_PERF_REGS := 0
+ LIBUNWIND_LIBS = -lunwind -lunwind-x86_64
+endif
+
+ifeq ($(NO_PERF_REGS),0)
+ BASIC_CFLAGS += -DHAVE_PERF_REGS
+endif
--
1.7.11.7
next prev parent reply other threads:[~2013-04-24 9:38 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-24 9:37 [PATCHv2 00/26] perf tools: Makefile changes Jiri Olsa
2013-04-24 9:37 ` [PATCH 01/26] perf tools: Add automated make test suite Jiri Olsa
2013-04-25 9:05 ` Namhyung Kim
2013-04-24 9:37 ` [PATCH 02/26] perf tools: Fix tab vs spaces issue in Makefile ifdef/endif Jiri Olsa
2013-05-31 11:29 ` [tip:perf/core] " tip-bot for Jiri Olsa
2013-04-24 9:37 ` Jiri Olsa [this message]
2013-04-25 9:15 ` [PATCH 03/26] perf tools: Move arch check into config/Makefile Namhyung Kim
2013-04-26 11:37 ` Jiri Olsa
2013-04-26 16:18 ` Jiri Olsa
2013-05-06 2:03 ` Namhyung Kim
2013-04-24 9:37 ` [PATCH 04/26] perf tools: Move programs " Jiri Olsa
2013-04-24 9:37 ` [PATCH 05/26] perf tools: Move compiler and linker flags " Jiri Olsa
2013-04-24 9:37 ` [PATCH 06/26] perf tools: Move libelf check config " Jiri Olsa
2013-04-24 9:37 ` [PATCH 07/26] perf tools: Move libdw " Jiri Olsa
2013-04-24 9:37 ` [PATCH 08/26] perf tools: Move libunwind " Jiri Olsa
2013-04-24 9:37 ` [PATCH 09/26] perf tools: Move libaudit " Jiri Olsa
2013-04-24 9:37 ` [PATCH 10/26] perf tools: Move slang " Jiri Olsa
2013-04-24 9:37 ` [PATCH 11/26] perf tools: Move gtk2 " Jiri Olsa
2013-04-24 9:37 ` [PATCH 12/26] perf tools: Move libperl " Jiri Olsa
2013-04-24 9:37 ` [PATCH 13/26] perf tools: Move libpython " Jiri Olsa
2013-04-24 9:37 ` [PATCH 14/26] perf tools: Move libbfd " Jiri Olsa
2013-04-24 9:37 ` [PATCH 15/26] perf tools: Move stdlib " Jiri Olsa
2013-04-24 9:37 ` [PATCH 16/26] perf tools: Move libnuma " Jiri Olsa
2013-04-24 9:37 ` [PATCH 17/26] perf tools: Move paths " Jiri Olsa
2013-04-24 9:37 ` [PATCH 18/26] perf tools: Final touches for CHK config move Jiri Olsa
2013-04-24 9:37 ` [PATCH 19/26] perf tools: Merge all *CFLAGS* make variable into CFLAGS Jiri Olsa
2013-04-24 9:37 ` [PATCH 20/26] perf tools: Merge all *LDFLAGS* make variable into LDFLAGS Jiri Olsa
2013-04-24 9:37 ` [PATCH 21/26] perf tools: Switch to full patch C include directories Jiri Olsa
2013-04-26 16:26 ` David Ahern
2013-04-29 10:02 ` Jiri Olsa
2013-04-24 9:37 ` [PATCH 22/26] perf tools: Add NO_BIONIC variable to confiure bionic setup Jiri Olsa
2013-04-24 9:37 ` [PATCH 23/26] perf tools: Replace tabs with spaces for all non-commands statements Jiri Olsa
2013-04-24 9:37 ` [PATCH 24/26] perf tools: Replace multiple line assignment with multiple statements Jiri Olsa
2013-04-24 9:37 ` [PATCH 25/26] perf tools: Remove '?=' Makefile STRIP assignment Jiri Olsa
2013-04-24 9:37 ` [PATCH 26/26] perf tools: Add missing liblk.a dependency for python/perf.so Jiri Olsa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1366796273-4780-4-git-send-email-jolsa@redhat.com \
--to=jolsa@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@ghostprotocols.net \
--cc=bp@alien8.de \
--cc=cjashfor@linux.vnet.ibm.com \
--cc=dsahern@gmail.com \
--cc=eranian@google.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=namhyung@kernel.org \
--cc=paulus@samba.org \
--cc=sam@ravnborg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome