Makefile 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. # Perf's makefile and headers are not relocatable and must be built from the
  16. # Linux sources directory
  17. PKG_BUILD_DIR:=$(LINUX_DIR)/tools/perf-$(TARGET_DIR_NAME)
  18. include $(INCLUDE_DIR)/package.mk
  19. define Package/perf
  20. SECTION:=devel
  21. CATEGORY:=Development
  22. DEPENDS:= +libelf1 +libdw +libpthread +librt +objdump @!LINUX_3_18
  23. TITLE:=Linux performance monitoring tool
  24. VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE)
  25. URL:=http://www.kernel.org
  26. endef
  27. define Package/perf/description
  28. perf is the Linux performance monitoring tool
  29. endef
  30. define Build/Prepare
  31. $(CP) $(LINUX_DIR)/tools/perf/* $(PKG_BUILD_DIR)/
  32. endef
  33. MAKE_FLAGS = \
  34. ARCH="$(LINUX_KARCH)" \
  35. NO_LIBPERL=1 \
  36. NO_LIBPYTHON=1 \
  37. NO_NEWT=1 \
  38. NO_LZMA=1 \
  39. NO_BACKTRACE=1 \
  40. NO_LIBNUMA=1 \
  41. NO_GTK2=1 \
  42. NO_LIBAUDIT=1 \
  43. NO_LIBCRYPTO=1 \
  44. CROSS_COMPILE="$(TARGET_CROSS)" \
  45. CC="$(TARGET_CC)" \
  46. LD="$(TARGET_CROSS)ld" \
  47. CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
  48. LDFLAGS="$(TARGET_LDFLAGS)" \
  49. $(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \
  50. WERROR=0 \
  51. prefix=/usr
  52. ifdef CONFIG_USE_MUSL
  53. MAKE_FLAGS += EXTRA_CFLAGS="-I$(CURDIR)/musl-include -include $(CURDIR)/musl-compat.h -D__UCLIBC__"
  54. endif
  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))