Makefile 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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:= +libelf1 +libdw +libpthread +librt +objdump @!LINUX_3_18 @!IN_SDK
  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. CROSS_COMPILE="$(TARGET_CROSS)" \
  46. CC="$(TARGET_CC)" \
  47. LD="$(TARGET_CROSS)ld" \
  48. CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
  49. LDFLAGS="$(TARGET_LDFLAGS)" \
  50. $(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \
  51. WERROR=0 \
  52. prefix=/usr
  53. ifdef CONFIG_USE_MUSL
  54. MAKE_FLAGS += EXTRA_CFLAGS="-I$(CURDIR)/musl-include -include $(CURDIR)/musl-compat.h -D__UCLIBC__"
  55. endif
  56. define Build/Compile
  57. +$(MAKE_FLAGS) $(MAKE) $(PKG_JOBS) \
  58. -C $(PKG_BUILD_DIR) \
  59. -f Makefile.perf \
  60. --no-print-directory
  61. endef
  62. define Package/perf/install
  63. $(INSTALL_DIR) $(1)/usr/bin
  64. $(INSTALL_BIN) $(PKG_BUILD_DIR)/perf $(1)/usr/bin/
  65. endef
  66. $(eval $(call BuildPackage,perf))