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)
18 # Perf's makefile and headers are not relocatable and must be built from the
19 # Linux sources directory
20 PKG_BUILD_DIR:=$(LINUX_DIR)/tools/perf-$(TARGET_DIR_NAME)
22 include $(INCLUDE_DIR)/package.mk
27 DEPENDS:= @!USE_UCLIBC +libelf1 +libdw +libpthread +librt +binutils
28 TITLE:=Linux performance monitoring tool
29 VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE)
30 URL:=http://www.kernel.org
33 define Package/perf/description
34 perf is the Linux performance monitoring tool
38 $(CP) $(LINUX_DIR)/tools/perf/* $(PKG_BUILD_DIR)/
42 ARCH="$(LINUX_KARCH)" \
51 CROSS_COMPILE="$(TARGET_CROSS)" \
53 LD="$(TARGET_CROSS)ld" \
54 CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
55 LDFLAGS="$(TARGET_LDFLAGS)" \
56 $(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \
61 MAKE_FLAGS += EXTRA_CFLAGS="-include $(CURDIR)/musl-compat.h -D__UCLIBC__"
65 +$(MAKE_FLAGS) $(MAKE) $(PKG_JOBS) \
71 define Package/perf/install
72 $(INSTALL_DIR) $(1)/usr/bin
73 $(INSTALL_BIN) $(PKG_BUILD_DIR)/perf $(1)/usr/bin/
76 $(eval $(call BuildPackage,perf))