2 # Copyright (C) 2011-2013 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
9 include $(INCLUDE_DIR)/kernel.mk
12 PKG_VERSION:=$(LINUX_VERSION)
15 include $(INCLUDE_DIR)/package.mk
20 DEPENDS:= +libelf1 +libdw +libpthread +librt +binutils
21 TITLE:=Linux performance monitoring tool
22 VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE)
23 URL:=http://www.kernel.org
26 define Package/perf/description
27 perf is the Linux performance monitoring tool
30 # Perf's makefile and headers are not relocatable and must be built from the
31 # Linux sources directory
33 $(RM) -r $(PKG_BUILD_DIR)
34 ln -s $(LINUX_DIR)/tools/perf $(PKG_BUILD_DIR)
37 # MAKE_FLAGS should be passed again upon cleaning because Perf's makefile
38 # always performs checks before processing any rule
40 -$(MAKE) -C $(PKG_BUILD_DIR) \
47 ARCH="$(LINUX_KARCH)" \
51 CROSS_COMPILE="$(TARGET_CROSS)" \
53 LD="$(TARGET_CROSS)ld" \
54 CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
55 LDFLAGS="$(TARGET_LDFLAGS)" \
59 define Package/perf/install
60 $(INSTALL_DIR) $(1)/usr/bin
61 $(INSTALL_BIN) $(LINUX_DIR)/tools/perf/perf $(1)/usr/bin/
64 $(eval $(call BuildPackage,perf))