You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

99 lines
2.7 KiB

  1. #
  2. # Copyright (C) 2015 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. PKG_NAME:=openocd
  9. PKG_SOURCE_VERSION:=v0.10.0-1000-gdb23c13d
  10. PKG_VERSION:=$(PKG_SOURCE_VERSION)
  11. PKG_RELEASE:=1
  12. PKG_SOURCE_PROTO:=git
  13. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  14. PKG_SOURCE_URL:=git://git.code.sf.net/p/openocd/code
  15. PKG_MIRROR_HASH:=6f8c0ecf240427654ad5e911b44f78996da931209280f4a19c1215802ff14638
  16. PKG_LICENSE:=GPL-2.0
  17. PKG_LICENSE_FILES:=COPYING
  18. PKG_MAINTAINER:=Paul Fertser <fercerpav@gmail.com>
  19. PKG_CPE_ID:=cpe:/a:openocd:open_on-chip_debugger
  20. PKG_BUILD_PARALLEL:=1
  21. PKG_INSTALL:=1
  22. PKG_FIXUP:=autoreconf
  23. PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_openocd_with_usb
  24. include $(INCLUDE_DIR)/package.mk
  25. include $(INCLUDE_DIR)/nls.mk
  26. define Package/openocd
  27. SECTION:=utils
  28. CATEGORY:=Utilities
  29. TITLE:=OpenOCD Utility
  30. URL:=http://openocd.sf.net/
  31. DEPENDS:=+PACKAGE_openocd_with_usb:libusb-1.0 \
  32. +PACKAGE_openocd_with_usb:libusb-compat \
  33. +PACKAGE_openocd_with_usb:libftdi1 \
  34. +PACKAGE_openocd_with_usb:hidapi
  35. endef
  36. define Package/openocd/config
  37. if PACKAGE_openocd
  38. config PACKAGE_openocd_with_usb
  39. bool "Build with support for USB adapters."
  40. default y
  41. endif
  42. endef
  43. define Package/openocd/description
  44. OpenOCD provides on-chip programming and debugging support with a
  45. layered architecture of JTAG interface and TAP support including:
  46. - (X)SVF playback to facilitate automated boundary scan and FPGA/CPLD
  47. programming;
  48. - debug target support (e.g. ARM, MIPS): single-stepping,
  49. breakpoints/watchpoints, gprof profiling, etc;
  50. - flash chip drivers (e.g. CFI, NAND, internal flash);
  51. - embedded TCL interpreter for easy scripting.
  52. Several network interfaces are available for interacting with OpenOCD:
  53. telnet, TCL, and GDB. The GDB server enables OpenOCD to function as a
  54. "remote target" for source-level debugging of embedded systems using
  55. the GNU GDB program (and the others who talk GDB protocol, e.g. IDA
  56. Pro).
  57. endef
  58. define Build/Prepare
  59. $(call Build/Prepare/Default)
  60. -$(RM) $(PKG_BUILD_DIR)/guess-rev.sh
  61. endef
  62. CONFIGURE_ARGS += \
  63. --prefix="/usr" \
  64. --disable-werror \
  65. MAKEINFO=true \
  66. $(if $(CONFIG_PACKAGE_openocd_with_usb),,PKG_CONFIG=false) \
  67. --enable-dummy \
  68. --enable-sysfsgpio
  69. TARGET_CFLAGS += -DRELSTR=\\\"-$(PKG_VERSION)-$(PKG_RELEASE)-OpenWrt\\\"
  70. define Build/Compile
  71. +$(MAKE_VARS) \
  72. $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(MAKE_PATH)
  73. endef
  74. define Package/openocd/install
  75. $(INSTALL_DIR) $(1)/usr/bin
  76. $(INSTALL_DIR) $(1)/usr/share/openocd
  77. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/openocd $(1)/usr/bin/
  78. $(CP) $(PKG_INSTALL_DIR)/usr/share/openocd/scripts $(1)/usr/share/openocd
  79. endef
  80. $(eval $(call BuildPackage,openocd))