Makefile 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. include $(TOPDIR)/rules.mk
  8. include $(INCLUDE_DIR)/kernel.mk
  9. PKG_NAME:=perf
  10. PKG_VERSION:=$(LINUX_VERSION)
  11. PKG_RELEASE:=2
  12. PKG_USE_MIPS16:=0
  13. PKG_BUILD_PARALLEL:=1
  14. PKG_MAINTAINER:=Felix Fietkau <[email protected]>
  15. PKG_FLAGS:=nonshared
  16. # Perf's makefile and headers are not relocatable and must be built from the
  17. # Linux sources directory
  18. PKG_BUILD_DIR:=$(LINUX_DIR)/tools/perf-$(TARGET_DIR_NAME)
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/perf
  21. SECTION:=devel
  22. CATEGORY:=Development
  23. DEPENDS:= +libelf +libdw +(mips||mipsel||powerpc||i386||x86_64||arm||aarch64):libunwind +libpthread +librt +objdump @!IN_SDK @!TARGET_arc770 @KERNEL_PERF_EVENTS
  24. TITLE:=Linux performance monitoring tool
  25. VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE)
  26. URL:=http://www.kernel.org
  27. endef
  28. define Package/perf/description
  29. perf is the Linux performance monitoring tool
  30. endef
  31. MAKE_FLAGS = \
  32. ARCH="$(LINUX_KARCH)" \
  33. NO_LIBPERL=1 \
  34. NO_LIBPYTHON=1 \
  35. NO_NEWT=1 \
  36. NO_LZMA=1 \
  37. NO_BACKTRACE=1 \
  38. NO_LIBNUMA=1 \
  39. NO_GTK2=1 \
  40. NO_LIBAUDIT=1 \
  41. NO_LIBCRYPTO=1 \
  42. NO_LIBUNWIND=1 \
  43. CROSS_COMPILE="$(TARGET_CROSS)" \
  44. CC="$(TARGET_CC)" \
  45. LD="$(TARGET_CROSS)ld" \
  46. CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
  47. LDFLAGS="$(TARGET_LDFLAGS)" \
  48. $(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \
  49. WERROR=0 \
  50. O=$(PKG_BUILD_DIR) \
  51. prefix=/usr
  52. define Build/Compile
  53. +$(MAKE_FLAGS) $(MAKE) $(PKG_JOBS) \
  54. --no-print-directory \
  55. -C $(LINUX_DIR)/tools/perf
  56. endef
  57. define Package/perf/install
  58. $(INSTALL_DIR) $(1)/usr/bin
  59. $(INSTALL_BIN) $(PKG_BUILD_DIR)/perf $(1)/usr/bin/
  60. endef
  61. $(eval $(call BuildPackage,perf))