1
0

Makefile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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:=5
  12. PKG_BUILD_FLAGS:=no-mips16 no-lto
  13. PKG_BUILD_PARALLEL:=1
  14. PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
  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. include $(INCLUDE_DIR)/nls.mk
  21. define Package/perf
  22. SECTION:=devel
  23. CATEGORY:=Development
  24. DEPENDS:= +libelf +libdw +PACKAGE_libunwind:libunwind +libpthread +librt +objdump @!IN_SDK @KERNEL_PERF_EVENTS \
  25. +PACKAGE_libbfd:libbfd +PACKAGE_libopcodes:libopcodes
  26. TITLE:=Linux performance monitoring tool
  27. VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE)
  28. URL:=http://www.kernel.org
  29. endef
  30. define Package/perf/description
  31. perf is the Linux performance monitoring tool
  32. endef
  33. HOST_CFLAGS += -I$(LINUX_DIR)/tools/include
  34. TARGET_LDFLAGS += $(INTL_LDFLAGS)
  35. MAKE_FLAGS = \
  36. ARCH="$(LINUX_KARCH)" \
  37. NO_LIBPERL=1 \
  38. NO_LIBPYTHON=1 \
  39. NO_NEWT=1 \
  40. NO_LZMA=1 \
  41. NO_BACKTRACE=1 \
  42. NO_LIBNUMA=1 \
  43. NO_GTK2=1 \
  44. NO_LIBAUDIT=1 \
  45. NO_LIBCRYPTO=1 \
  46. NO_LIBUNWIND=1 \
  47. NO_LIBZSTD=1 \
  48. NO_LIBCAP=1 \
  49. CROSS_COMPILE="$(TARGET_CROSS)" \
  50. CC="$(TARGET_CC)" \
  51. LD="$(TARGET_CROSS)ld" \
  52. EXTRA_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
  53. LDFLAGS="$(TARGET_LDFLAGS)" \
  54. KBUILD_HOSTCFLAGS="$(HOST_CFLAGS)" \
  55. $(if $(findstring c,$(LIBRECMC_VERBOSE)),V=1,V='') \
  56. WERROR=0 \
  57. O=$(PKG_BUILD_DIR) \
  58. prefix=/usr
  59. define Build/Compile
  60. +$(MAKE_FLAGS) $(MAKE) $(PKG_JOBS) \
  61. --no-print-directory \
  62. -C $(LINUX_DIR)/tools/perf
  63. endef
  64. define Package/perf/install
  65. $(INSTALL_DIR) $(1)/usr/bin
  66. $(INSTALL_BIN) $(PKG_BUILD_DIR)/perf $(1)/usr/bin/
  67. endef
  68. $(eval $(call BuildPackage,perf))