Makefile 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. include $(INCLUDE_DIR)/package.mk
  14. define Package/perf
  15. SECTION:=devel
  16. CATEGORY:=Development
  17. DEPENDS:= @USE_GLIBC +libelf1 +libdw +libpthread +librt +binutils
  18. TITLE:=Linux performance monitoring tool
  19. VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE)
  20. URL:=http://www.kernel.org
  21. endef
  22. define Package/perf/description
  23. perf is the Linux performance monitoring tool
  24. endef
  25. # Perf's makefile and headers are not relocatable and must be built from the
  26. # Linux sources directory
  27. define Build/Prepare
  28. $(RM) -r $(PKG_BUILD_DIR)
  29. $(LN) $(LINUX_DIR)/tools/perf $(PKG_BUILD_DIR)
  30. endef
  31. # MAKE_FLAGS should be passed again upon cleaning because Perf's makefile
  32. # always performs checks before processing any rule
  33. define Build/Clean
  34. -$(MAKE) -C $(PKG_BUILD_DIR) \
  35. NO_DWARF=1 \
  36. $(MAKE_FLAGS) \
  37. clean
  38. endef
  39. MAKE_FLAGS = \
  40. ARCH="$(LINUX_KARCH)" \
  41. NO_LIBPERL=1 \
  42. NO_LIBPYTHON=1 \
  43. NO_NEWT=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. WERROR=0 \
  50. V=1 \
  51. prefix=/usr
  52. define Package/perf/install
  53. $(INSTALL_DIR) $(1)/usr/bin
  54. $(INSTALL_BIN) $(LINUX_DIR)/tools/perf/perf $(1)/usr/bin/
  55. endef
  56. $(eval $(call BuildPackage,perf))