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@openwrt.org>
19 # Perf's makefile and headers are not relocatable and must be built from the
20 # Linux sources directory
21 PKG_BUILD_DIR:=$(LINUX_DIR)/tools/perf-$(TARGET_DIR_NAME)
23 include $(INCLUDE_DIR)/package.mk
28 DEPENDS:= +libelf1 +libdw +libpthread +librt +objdump @!LINUX_3_18
29 TITLE:=Linux performance monitoring tool
30 VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE)
31 URL:=http://www.kernel.org
34 define Package/perf/description
35 perf is the Linux performance monitoring tool
39 $(CP) $(LINUX_DIR)/tools/perf/* $(PKG_BUILD_DIR)/
43 ARCH="$(LINUX_KARCH)" \
53 CROSS_COMPILE="$(TARGET_CROSS)" \
55 LD="$(TARGET_CROSS)ld" \
56 CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
57 LDFLAGS="$(TARGET_LDFLAGS)" \
58 $(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \
63 MAKE_FLAGS += EXTRA_CFLAGS="-I$(CURDIR)/musl-include -include $(CURDIR)/musl-compat.h -D__UCLIBC__"
67 +$(MAKE_FLAGS) $(MAKE) $(PKG_JOBS) \
73 define Package/perf/install
74 $(INSTALL_DIR) $(1)/usr/bin
75 $(INSTALL_BIN) $(PKG_BUILD_DIR)/perf $(1)/usr/bin/
78 $(eval $(call BuildPackage,perf))