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)
17 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
20 # Perf's makefile and headers are not relocatable and must be built from the
21 # Linux sources directory
22 PKG_BUILD_DIR:=$(LINUX_DIR)/tools/perf-$(TARGET_DIR_NAME)
24 include $(INCLUDE_DIR)/package.mk
29 DEPENDS:= +libelf1 +libdw +libpthread +librt +objdump @!LINUX_3_18 @!IN_SDK @!TARGET_arc770
30 TITLE:=Linux performance monitoring tool
31 VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE)
32 URL:=http://www.kernel.org
35 define Package/perf/description
36 perf is the Linux performance monitoring tool
40 $(CP) $(LINUX_DIR)/tools/perf/* $(PKG_BUILD_DIR)/
44 ARCH="$(LINUX_KARCH)" \
55 CROSS_COMPILE="$(TARGET_CROSS)" \
57 LD="$(TARGET_CROSS)ld" \
58 CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
59 LDFLAGS="$(TARGET_LDFLAGS)" \
60 $(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \
64 ifdef CONFIG_LINUX_4_4
66 MAKE_FLAGS += EXTRA_CFLAGS="-I$(CURDIR)/musl-include -include $(CURDIR)/musl-compat.h -D__UCLIBC__"
71 +$(MAKE_FLAGS) $(MAKE) $(PKG_JOBS) \
77 define Package/perf/install
78 $(INSTALL_DIR) $(1)/usr/bin
79 $(INSTALL_BIN) $(PKG_BUILD_DIR)/perf $(1)/usr/bin/
82 $(eval $(call BuildPackage,perf))