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
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)" \
52 CROSS_COMPILE="$(TARGET_CROSS)" \
54 LD="$(TARGET_CROSS)ld" \
55 CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
56 LDFLAGS="$(TARGET_LDFLAGS)" \
57 $(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \
62 MAKE_FLAGS += EXTRA_CFLAGS="-include $(CURDIR)/musl-compat.h -D__UCLIBC__"
66 +$(MAKE_FLAGS) $(MAKE) $(PKG_JOBS) \
72 define Package/perf/install
73 $(INSTALL_DIR) $(1)/usr/bin
74 $(INSTALL_BIN) $(PKG_BUILD_DIR)/perf $(1)/usr/bin/
77 $(eval $(call BuildPackage,perf))