perf: build in a copy of the source dir instead of relying on make clean
[openwrt/staging/wigyori.git] / package / devel / perf / Makefile
1 #
2 # Copyright (C) 2011-2013 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9 include $(INCLUDE_DIR)/kernel.mk
10
11 PKG_NAME:=perf
12 PKG_VERSION:=$(LINUX_VERSION)
13 PKG_RELEASE:=2
14
15 PKG_USE_MIPS16:=0
16
17 # Perf's makefile and headers are not relocatable and must be built from the
18 # Linux sources directory
19 PKG_BUILD_DIR:=$(LINUX_DIR)/tools/perf-$(TARGET_DIR_NAME)
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/perf
24 SECTION:=devel
25 CATEGORY:=Development
26 DEPENDS:= @USE_GLIBC +libelf1 +libdw +libpthread +librt +binutils
27 TITLE:=Linux performance monitoring tool
28 VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE)
29 URL:=http://www.kernel.org
30 endef
31
32 define Package/perf/description
33 perf is the Linux performance monitoring tool
34 endef
35
36 define Build/Prepare
37 $(CP) $(LINUX_DIR)/tools/perf/* $(PKG_BUILD_DIR)/
38 endef
39
40 MAKE_FLAGS = \
41 ARCH="$(LINUX_KARCH)" \
42 NO_LIBPERL=1 \
43 NO_LIBPYTHON=1 \
44 NO_NEWT=1 \
45 NO_LZMA=1 \
46 CROSS_COMPILE="$(TARGET_CROSS)" \
47 CC="$(TARGET_CC)" \
48 LD="$(TARGET_CROSS)ld" \
49 CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
50 LDFLAGS="$(TARGET_LDFLAGS)" \
51 WERROR=0 \
52 V=1 \
53 prefix=/usr
54
55 define Package/perf/install
56 $(INSTALL_DIR) $(1)/usr/bin
57 $(INSTALL_BIN) $(PKG_BUILD_DIR)/perf $(1)/usr/bin/
58 endef
59
60 $(eval $(call BuildPackage,perf))