7cf504cedbc7db7de51660e9cada617f1d4fe7fc
[openwrt/svn-archive/archive.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 include $(INCLUDE_DIR)/package.mk
18
19 define Package/perf
20 SECTION:=devel
21 CATEGORY:=Development
22 DEPENDS:= @USE_GLIBC +libelf1 +libdw +libpthread +librt +binutils
23 TITLE:=Linux performance monitoring tool
24 VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE)
25 URL:=http://www.kernel.org
26 endef
27
28 define Package/perf/description
29 perf is the Linux performance monitoring tool
30 endef
31
32 # Perf's makefile and headers are not relocatable and must be built from the
33 # Linux sources directory
34 define Build/Prepare
35 $(RM) -r $(PKG_BUILD_DIR)
36 ln -s $(LINUX_DIR)/tools/perf $(PKG_BUILD_DIR)
37 endef
38
39 # MAKE_FLAGS should be passed again upon cleaning because Perf's makefile
40 # always performs checks before processing any rule
41 define Build/Clean
42 -$(MAKE) -C $(PKG_BUILD_DIR) \
43 NO_DWARF=1 \
44 $(MAKE_FLAGS) \
45 clean
46 endef
47
48 MAKE_FLAGS = \
49 ARCH="$(LINUX_KARCH)" \
50 NO_LIBPERL=1 \
51 NO_LIBPYTHON=1 \
52 NO_NEWT=1 \
53 CROSS_COMPILE="$(TARGET_CROSS)" \
54 CC="$(TARGET_CC)" \
55 LD="$(TARGET_CROSS)ld" \
56 CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
57 LDFLAGS="$(TARGET_LDFLAGS)" \
58 V=1 \
59 prefix=/usr
60
61 define Package/perf/install
62 $(INSTALL_DIR) $(1)/usr/bin
63 $(INSTALL_BIN) $(LINUX_DIR)/tools/perf/perf $(1)/usr/bin/
64 endef
65
66 $(eval $(call BuildPackage,perf))