Blame src/libpfm-3.y/config.mk

Packit Service a1973e
#
Packit Service a1973e
# Copyright (c) 2002-2006 Hewlett-Packard Development Company, L.P.
Packit Service a1973e
# Contributed by Stephane Eranian <eranian@hpl.hp.com>
Packit Service a1973e
#
Packit Service a1973e
# Permission is hereby granted, free of charge, to any person obtaining a copy 
Packit Service a1973e
# of this software and associated documentation files (the "Software"), to deal 
Packit Service a1973e
# in the Software without restriction, including without limitation the rights 
Packit Service a1973e
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 
Packit Service a1973e
# of the Software, and to permit persons to whom the Software is furnished to do so, 
Packit Service a1973e
# subject to the following conditions:
Packit Service a1973e
# 
Packit Service a1973e
# The above copyright notice and this permission notice shall be included in all 
Packit Service a1973e
# copies or substantial portions of the Software.  
Packit Service a1973e
# 
Packit Service a1973e
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
Packit Service a1973e
# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
Packit Service a1973e
# PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
Packit Service a1973e
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 
Packit Service a1973e
# CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 
Packit Service a1973e
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Packit Service a1973e
# 
Packit Service a1973e
# This file is part of libpfm, a performance monitoring support library for
Packit Service a1973e
# applications on Linux.
Packit Service a1973e
#
Packit Service a1973e
Packit Service a1973e
#
Packit Service a1973e
# This file defines the global compilation settings.
Packit Service a1973e
# It is included by every Makefile
Packit Service a1973e
#
Packit Service a1973e
#
Packit Service a1973e
SYS  := $(shell uname -s)
Packit Service a1973e
ARCH := $(shell uname -m)
Packit Service a1973e
ifeq (i686,$(findstring i686,$(ARCH)))
Packit Service a1973e
override ARCH=ia32
Packit Service a1973e
endif
Packit Service a1973e
ifeq (i586,$(findstring i586,$(ARCH)))
Packit Service a1973e
override ARCH=ia32
Packit Service a1973e
endif
Packit Service a1973e
ifeq (i486,$(findstring i486,$(ARCH)))
Packit Service a1973e
override ARCH=ia32
Packit Service a1973e
endif
Packit Service a1973e
ifeq (i386,$(findstring i386,$(ARCH)))
Packit Service a1973e
override ARCH=ia32
Packit Service a1973e
endif
Packit Service a1973e
ifeq (ppc,$(findstring ppc,$(ARCH)))
Packit Service a1973e
override ARCH=powerpc
Packit Service a1973e
endif
Packit Service a1973e
ifeq (sparc64,$(findstring sparc64,$(ARCH)))
Packit Service a1973e
override ARCH=sparc
Packit Service a1973e
endif
Packit Service a1973e
Packit Service a1973e
#
Packit Service a1973e
# CONFIG_PFMLIB_SHARED: y=compile static and shared versions, n=static only
Packit Service a1973e
# CONFIG_PFMLIB_OLD_PFMV2: enable old ( 2.x, x <=4) perfmon2 (mutually exclusive with v3 support)
Packit Service a1973e
CONFIG_PFMLIB_SHARED?=y
Packit Service a1973e
CONFIG_PFMLIB_OLD_PFMV2?=n
Packit Service a1973e
Packit Service a1973e
#
Packit Service a1973e
# Cray-X2 is cross-compiled. Check the programming environment
Packit Service a1973e
#
Packit Service a1973e
PE := $(shell echo $${CRAY_PE_TARGET})
Packit Service a1973e
ifeq (cray-x2,$(PE))
Packit Service a1973e
override ARCH=crayx2
Packit Service a1973e
endif
Packit Service a1973e
Packit Service a1973e
#
Packit Service a1973e
# Cell Broadband Engine is reported as PPC but needs special handling.
Packit Service a1973e
#
Packit Service a1973e
ifeq ($(SYS),Linux)
Packit Service a1973e
MACHINE := $(shell grep -q 'Cell Broadband Engine' /proc/cpuinfo && echo cell)
Packit Service a1973e
ifeq (cell,$(MACHINE))
Packit Service a1973e
override ARCH=cell
Packit Service a1973e
endif
Packit Service a1973e
endif
Packit Service a1973e
Packit Service a1973e
#
Packit Service a1973e
# Library version
Packit Service a1973e
#
Packit Service a1973e
VERSION=3
Packit Service a1973e
REVISION=10
Packit Service a1973e
AGE=0
Packit Service a1973e
Packit Service a1973e
#
Packit Service a1973e
# Where should things (lib, headers, man) go in the end.
Packit Service a1973e
#
Packit Service a1973e
install_prefix?=/usr/local
Packit Service a1973e
PREFIX?=$(install_prefix)
Packit Service a1973e
LIBDIR=$(PREFIX)/lib
Packit Service a1973e
INCDIR=$(PREFIX)/include
Packit Service a1973e
MANDIR=$(PREFIX)/share/man
Packit Service a1973e
EXAMPLESDIR=$(PREFIX)/share/doc/libpfm-$(VERSION).$(REVISION).$(AGE)/examples
Packit Service a1973e
Packit Service a1973e
#
Packit Service a1973e
# Configuration Paramaters for libpfm library
Packit Service a1973e
#
Packit Service a1973e
ifeq ($(ARCH),ia64)
Packit Service a1973e
CONFIG_PFMLIB_ARCH_IA64=y
Packit Service a1973e
endif
Packit Service a1973e
Packit Service a1973e
ifeq ($(ARCH),x86_64)
Packit Service a1973e
CONFIG_PFMLIB_ARCH_X86_64=y
Packit Service a1973e
endif
Packit Service a1973e
Packit Service a1973e
ifeq ($(ARCH),ia32)
Packit Service a1973e
CONFIG_PFMLIB_ARCH_I386=y
Packit Service a1973e
endif
Packit Service a1973e
Packit Service a1973e
ifeq ($(ARCH),mips64)
Packit Service a1973e
CONFIG_PFMLIB_ARCH_MIPS64=y
Packit Service a1973e
#
Packit Service a1973e
# SiCortex/Linux
Packit Service a1973e
#
Packit Service a1973e
MACHINE := $(shell test -f /etc/sicortex-release && echo sicortex)
Packit Service a1973e
ifeq (sicortex,$(MACHINE))
Packit Service a1973e
CONFIG_PFMLIB_ARCH_SICORTEX=y
Packit Service a1973e
endif
Packit Service a1973e
endif
Packit Service a1973e
Packit Service a1973e
ifeq ($(ARCH),powerpc)
Packit Service a1973e
CONFIG_PFMLIB_ARCH_POWERPC=y
Packit Service a1973e
endif
Packit Service a1973e
Packit Service a1973e
ifeq ($(ARCH),sparc)
Packit Service a1973e
CONFIG_PFMLIB_ARCH_SPARC=y
Packit Service a1973e
endif
Packit Service a1973e
Packit Service a1973e
ifeq ($(XTPE_COMPILE_TARGET),linux)
Packit Service a1973e
CONFIG_PFMLIB_ARCH_CRAYXT=y
Packit Service a1973e
CONFIG_PFMLIB_SHARED=n
Packit Service a1973e
CONFIG_PFMLIB_OLD_PFMV2=y
Packit Service a1973e
endif
Packit Service a1973e
Packit Service a1973e
ifeq ($(XTPE_COMPILE_TARGET),catamount)
Packit Service a1973e
CONFIG_PFMLIB_ARCH_CRAYXT=y
Packit Service a1973e
CONFIG_PFMLIB_SHARED=n
Packit Service a1973e
CONFIG_PFMLIB_OLD_PFMV2=y
Packit Service a1973e
endif
Packit Service a1973e
Packit Service a1973e
ifeq ($(ARCH),crayx2)
Packit Service a1973e
CONFIG_PFMLIB_ARCH_CRAYX2=y
Packit Service a1973e
CONFIG_PFMLIB_SHARED=n
Packit Service a1973e
CONFIG_PFMLIB_OLD_PFMV2=y
Packit Service a1973e
endif
Packit Service a1973e
Packit Service a1973e
ifeq ($(ARCH),cell)
Packit Service a1973e
CONFIG_PFMLIB_CELL=y
Packit Service a1973e
endif
Packit Service a1973e
Packit Service a1973e
# handle special cases for 64-bit builds
Packit Service a1973e
ifeq ($(BITMODE),64)
Packit Service a1973e
ifeq ($(ARCH),powerpc)
Packit Service a1973e
CONFIG_PFMLIB_ARCH_POWERPC64=y
Packit Service a1973e
endif
Packit Service a1973e
endif
Packit Service a1973e
Packit Service a1973e
#
Packit Service a1973e
# you shouldn't have to touch anything beyond this point
Packit Service a1973e
#
Packit Service a1973e
Packit Service a1973e
#
Packit Service a1973e
# The entire package can be compiled using 
Packit Service a1973e
# icc the Intel Itanium Compiler (7.x,8.x, 9.x)
Packit Service a1973e
# or GNU C
Packit Service a1973e
#CC=icc
Packit Service a1973e
CC?=gcc
Packit Service a1973e
LIBS=
Packit Service a1973e
INSTALL=install
Packit Service a1973e
LN?=ln -sf
Packit Service a1973e
PFMINCDIR=$(TOPDIR)/include
Packit Service a1973e
PFMLIBDIR=$(TOPDIR)/lib
Packit Service a1973e
DBG?=-g -Wall -Werror
Packit Service a1973e
# gcc/mips64 bug
Packit Service a1973e
ifeq ($(CONFIG_PFMLIB_ARCH_SICORTEX),y)
Packit Service a1973e
OPTIM?=-O
Packit Service a1973e
else
Packit Service a1973e
OPTIM?=-O2
Packit Service a1973e
endif
Packit Service a1973e
CFLAGS+=$(OPTIM) $(DBG) -I$(PFMINCDIR)
Packit Service a1973e
MKDEP=makedepend
Packit Service a1973e
PFMLIB=$(PFMLIBDIR)/libpfm.a
Packit Service a1973e
Packit Service a1973e
# Reset options for Cray XT
Packit Service a1973e
ifeq ($(CONFIG_PFMLIB_ARCH_CRAYXT),y)
Packit Service a1973e
LDFLAGS+=-static
Packit Service a1973e
CONFIG_PFMLIB_OLD_PFMV2=y
Packit Service a1973e
endif
Packit Service a1973e
Packit Service a1973e
# Reset the compiler for Cray-X2 (load x2-gcc module)
Packit Service a1973e
ifeq ($(CONFIG_PFMLIB_ARCH_CRAYX2),y)
Packit Service a1973e
CC=craynv-cray-linux-gnu-gcc
Packit Service a1973e
LDFLAGS+=-static
Packit Service a1973e
CONFIG_PFMLIB_OLD_PFMV2=y
Packit Service a1973e
endif
Packit Service a1973e
Packit Service a1973e
ifeq ($(CONFIG_PFMLIB_ARCH_SICORTEX),y)
Packit Service a1973e
CONFIG_PFMLIB_OLD_PFMV2=y
Packit Service a1973e
endif
Packit Service a1973e
Packit Service a1973e
ifeq ($(CONFIG_PFMLIB_ARCH_POWERPC64),y)
Packit Service a1973e
CFLAGS+= -m64
Packit Service a1973e
LDFLAGS+= -m64
Packit Service a1973e
LIBDIR=$(PREFIX)/lib64
Packit Service a1973e
endif
Packit Service a1973e
Packit Service a1973e
ifeq ($(CONFIG_PFMLIB_OLD_PFMV2),y)
Packit Service a1973e
CFLAGS +=-DPFMLIB_OLD_PFMV2
Packit Service a1973e
endif