Makefile 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 <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. 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. define Build/Prepare
  32. $(CP) $(LINUX_DIR)/tools/perf/* $(PKG_BUILD_DIR)/
  33. endef
  34. MAKE_FLAGS = \
  35. ARCH="$(LINUX_KARCH)" \
  36. NO_LIBPERL=1 \
  37. NO_LIBPYTHON=1 \
  38. NO_NEWT=1 \
  39. NO_LZMA=1 \
  40. NO_BACKTRACE=1 \
  41. NO_LIBNUMA=1 \
  42. NO_GTK2=1 \
  43. NO_LIBAUDIT=1 \
  44. NO_LIBCRYPTO=1 \
  45. NO_LIBUNWIND=1 \
  46. NO_LIBCAP=1 \
  47. CROSS_COMPILE="$(TARGET_CROSS)" \
  48. CC="$(TARGET_CC)" \
  49. LD="$(TARGET_CROSS)ld" \
  50. CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
  51. LDFLAGS="$(TARGET_LDFLAGS)" \
  52. $(if $(findstring c,$(LIBRECMC_VERBOSE)),V=1,V='') \
  53. WERROR=0 \
  54. prefix=/usr
  55. define Build/Compile
  56. +$(MAKE_FLAGS) $(MAKE) $(PKG_JOBS) \
  57. -C $(PKG_BUILD_DIR) \
  58. -f Makefile.perf \
  59. --no-print-directory
  60. endef
  61. define Package/perf/install
  62. $(INSTALL_DIR) $(1)/usr/bin
  63. $(INSTALL_BIN) $(PKG_BUILD_DIR)/perf $(1)/usr/bin/
  64. endef
  65. $(eval $(call BuildPackage,perf))