updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / libpfm4 / config.mk
blob808674cab094640a7f3e6faaff9f2dbb5af2f2d5
2 # Copyright (c) 2002-2006 Hewlett-Packard Development Company, L.P.
3 # Contributed by Stephane Eranian <eranian@hpl.hp.com>
5 # Permission is hereby granted, free of charge, to any person obtaining a copy
6 # of this software and associated documentation files (the "Software"), to deal
7 # in the Software without restriction, including without limitation the rights
8 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9 # of the Software, and to permit persons to whom the Software is furnished to do so,
10 # subject to the following conditions:
12 # The above copyright notice and this permission notice shall be included in all
13 # copies or substantial portions of the Software.
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16 # INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
17 # PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
18 # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
19 # CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
20 # OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 # This file is part of libpfm, a performance monitoring support library for
23 # applications on Linux.
27 # This file defines the global compilation settings.
28 # It is included by every Makefile
31 SYS := $(shell uname -s)
32 ARCH := $(shell uname -m)
33 ifeq (i686,$(findstring i686,$(ARCH)))
34 override ARCH=i386
35 endif
36 ifeq (i586,$(findstring i586,$(ARCH)))
37 override ARCH=i386
38 endif
39 ifeq (i486,$(findstring i486,$(ARCH)))
40 override ARCH=i386
41 endif
42 ifeq (i386,$(findstring i386,$(ARCH)))
43 override ARCH=i386
44 endif
45 ifeq (i86pc,$(findstring i86pc,$(ARCH)))
46 override ARCH=i386
47 endif
48 ifeq ($(ARCH),x86_64)
49 override ARCH=x86_64
50 endif
51 ifeq ($(ARCH),amd64)
52 override ARCH=x86_64
53 endif
54 ifeq (ppc,$(findstring ppc,$(ARCH)))
55 override ARCH=powerpc
56 endif
57 ifeq (sparc64,$(findstring sparc64,$(ARCH)))
58 override ARCH=sparc
59 endif
60 ifeq (armv7,$(findstring armv7,$(ARCH)))
61 override ARCH=arm
62 endif
63 ifeq (mips64,$(findstring mips64,$(ARCH)))
64 override ARCH=mips
65 endif
66 ifeq (mips,$(findstring mips,$(ARCH)))
67 override ARCH=mips
68 endif
71 # CONFIG_PFMLIB_SHARED: y=compile static and shared versions, n=static only
72 # CONFIG_PFMLIB_DEBUG: enable debugging output support
73 # CONFIG_PFMLIB_NOPYTHON: do not generate the python support, incompatible
74 # with PFMLIB_SHARED=n
76 CONFIG_PFMLIB_SHARED?=y
77 CONFIG_PFMLIB_DEBUG?=y
78 CONFIG_PFMLIB_NOPYTHON?=y
81 # Cell Broadband Engine is reported as PPC but needs special handling.
83 ifeq ($(SYS),Linux)
84 MACHINE := $(shell grep -q 'Cell Broadband Engine' /proc/cpuinfo && echo cell)
85 ifeq (cell,$(MACHINE))
86 override ARCH=cell
87 endif
88 endif
91 # Library version
93 VERSION=4
94 REVISION=2
95 AGE=0
98 # Where should things (lib, headers, man) go in the end.
100 PREFIX=/usr
101 LIBDIR=$(PREFIX)/lib
102 INCDIR=$(PREFIX)/include
103 MANDIR=$(PREFIX)/share/man
104 DOCDIR=$(PREFIX)/share/doc/libpfm-$(VERSION).$(REVISION).$(AGE)
107 # System header files
109 # SYSINCDIR : where to find standard header files (default to .)
110 SYSINCDIR=.
113 # Configuration Paramaters for libpfm library
115 ifeq ($(ARCH),ia64)
116 CONFIG_PFMLIB_ARCH_IA64=y
117 endif
119 ifeq ($(ARCH),x86_64)
120 CONFIG_PFMLIB_ARCH_X86_64=y
121 CONFIG_PFMLIB_ARCH_X86=y
122 endif
124 ifeq ($(ARCH),i386)
125 CONFIG_PFMLIB_ARCH_I386=y
126 CONFIG_PFMLIB_ARCH_X86=y
127 endif
129 ifeq ($(ARCH),mips)
130 CONFIG_PFMLIB_ARCH_MIPS=y
131 endif
133 ifeq ($(ARCH),powerpc)
134 CONFIG_PFMLIB_ARCH_POWERPC=y
135 endif
137 ifeq ($(ARCH),sparc)
138 CONFIG_PFMLIB_ARCH_SPARC=y
139 endif
141 ifeq ($(ARCH),arm)
142 CONFIG_PFMLIB_ARCH_ARM=y
143 endif
145 ifeq ($(XTPE_COMPILE_TARGET),linux)
146 CONFIG_PFMLIB_ARCH_CRAYXT=y
147 endif
149 ifeq ($(ARCH),cell)
150 CONFIG_PFMLIB_CELL=y
151 endif
153 # handle special cases for 64-bit builds
154 ifeq ($(BITMODE),64)
155 ifeq ($(ARCH),powerpc)
156 CONFIG_PFMLIB_ARCH_POWERPC64=y
157 endif
158 endif
161 # you shouldn't have to touch anything beyond this point
165 # The entire package can be compiled using
166 # icc the Intel Itanium Compiler (7.x,8.x, 9.x)
167 # or GNU C
168 #CC=icc
169 CC?=gcc
170 LIBS=
171 INSTALL=install
172 LN?=ln -sf
173 PFMINCDIR=$(TOPDIR)/include
174 PFMLIBDIR=$(TOPDIR)/lib
175 DBG?=-g -Wall -Werror
176 CFLAGS+=$(OPTIM) $(DBG) -I$(SYSINCDIR) -I$(PFMINCDIR)
177 MKDEP=makedepend
178 PFMLIB=$(PFMLIBDIR)/libpfm.a
180 ifeq ($(CONFIG_PFMLIB_ARCH_POWERPC64),y)
181 CFLAGS+= -m64
182 LDFLAGS+= -m64
183 LIBDIR=$(DESTDIR)/lib64
184 endif
186 ifeq ($(CONFIG_PFMLIB_DEBUG),y)
187 CFLAGS += -DCONFIG_PFMLIB_DEBUG
188 endif
190 CTAGS?=ctags
193 # Python is for use with perf_events
194 # so it only works on Linux
196 ifneq ($(SYS),Linux)
197 CONFIG_PFMLIB_NOPYTHON=y
198 endif
201 # mark that we are compiling on Linux
203 ifeq ($(SYS),Linux)
204 CFLAGS+= -DCONFIG_PFMLIB_OS_LINUX
205 endif
208 # compile examples statically if library is
209 # compile static
210 # not compatible with python support, so disable for now
212 ifeq ($(CONFIG_PFMLIB_SHARED),n)
213 LDFLAGS+= -static
214 CONFIG_PFMLIB_NOPYTHON=y
215 endif