2 # Copyright (C) 2011-2012 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
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) \
46 ARCH="$(LINUX_KARCH)" \
50 CROSS_COMPILE="$(TARGET_CROSS)" \
52 LD="$(TARGET_CROSS)ld" \
53 CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
54 LDFLAGS="$(TARGET_LDFLAGS)" \
58 define Package/perf/install
59 $(INSTALL_DIR) $(1)/usr/bin
60 $(INSTALL_BIN) $(LINUX_DIR)/tools/perf/perf $(1)/usr/bin/
63 $(eval $(call BuildPackage,perf))