1# 2# Copyright (C) 2011-2013 OpenWrt.org 3# 4# This is free software, licensed under the GNU General Public License v2. 5# See /LICENSE for more information. 6# 7 8include $(TOPDIR)/rules.mk 9include $(INCLUDE_DIR)/kernel.mk 10 11PKG_NAME:=perf 12PKG_VERSION:=$(LINUX_VERSION) 13PKG_RELEASE:=2 14 15PKG_USE_MIPS16:=0 16PKG_BUILD_PARALLEL:=1 17PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name> 18 19# Perf's makefile and headers are not relocatable and must be built from the 20# Linux sources directory 21PKG_BUILD_DIR:=$(LINUX_DIR)/tools/perf-$(TARGET_DIR_NAME) 22 23include $(INCLUDE_DIR)/package.mk 24 25define Package/perf 26 SECTION:=devel 27 CATEGORY:=Development 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 32endef 33 34define Package/perf/description 35 perf is the Linux performance monitoring tool 36endef 37 38define Build/Prepare 39 $(CP) $(LINUX_DIR)/tools/perf/* $(PKG_BUILD_DIR)/ 40endef 41 42MAKE_FLAGS = \ 43 ARCH="$(LINUX_KARCH)" \ 44 NO_LIBPERL=1 \ 45 NO_LIBPYTHON=1 \ 46 NO_NEWT=1 \ 47 NO_LZMA=1 \ 48 NO_BACKTRACE=1 \ 49 NO_LIBNUMA=1 \ 50 NO_GTK2=1 \ 51 NO_LIBAUDIT=1 \ 52 NO_LIBCRYPTO=1 \ 53 CROSS_COMPILE="$(TARGET_CROSS)" \ 54 CC="$(TARGET_CC)" \ 55 LD="$(TARGET_CROSS)ld" \ 56 CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ 57 LDFLAGS="$(TARGET_LDFLAGS)" \ 58 $(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \ 59 WERROR=0 \ 60 prefix=/usr 61 62ifdef CONFIG_USE_MUSL 63 MAKE_FLAGS += EXTRA_CFLAGS="-I$(CURDIR)/musl-include -include $(CURDIR)/musl-compat.h -D__UCLIBC__" 64endif 65 66define Build/Compile 67 +$(MAKE_FLAGS) $(MAKE) $(PKG_JOBS) \ 68 -C $(PKG_BUILD_DIR) \ 69 -f Makefile.perf \ 70 --no-print-directory 71endef 72 73define Package/perf/install 74 $(INSTALL_DIR) $(1)/usr/bin 75 $(INSTALL_BIN) $(PKG_BUILD_DIR)/perf $(1)/usr/bin/ 76endef 77 78$(eval $(call BuildPackage,perf)) 79