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.

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