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.

92 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-rc1
  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:=c4a0a6cad821946608c843f557b993e7cfeb0f193e4c0f149ebfbfbfd57054a6
  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:=+libusb-1.0 \
  32. +libusb-compat \
  33. +libftdi1 \
  34. +hidapi \
  35. +libgpiod
  36. endef
  37. define Package/openocd/description
  38. OpenOCD provides on-chip programming and debugging support with a
  39. layered architecture of JTAG interface and TAP support including:
  40. - (X)SVF playback to facilitate automated boundary scan and FPGA/CPLD
  41. programming;
  42. - debug target support (e.g. ARM, MIPS): single-stepping,
  43. breakpoints/watchpoints, gprof profiling, etc;
  44. - flash chip drivers (e.g. CFI, NAND, internal flash);
  45. - embedded TCL interpreter for easy scripting.
  46. Several network interfaces are available for interacting with OpenOCD:
  47. telnet, TCL, and GDB. The GDB server enables OpenOCD to function as a
  48. "remote target" for source-level debugging of embedded systems using
  49. the GNU GDB program (and the others who talk GDB protocol, e.g. IDA
  50. Pro).
  51. endef
  52. define Build/Prepare
  53. $(call Build/Prepare/Default)
  54. -$(RM) $(PKG_BUILD_DIR)/guess-rev.sh
  55. endef
  56. CONFIGURE_ARGS += \
  57. --prefix="/usr" \
  58. --disable-werror \
  59. MAKEINFO=true \
  60. --enable-dummy \
  61. --enable-sysfsgpio \
  62. --enable-linuxgpiod
  63. TARGET_CFLAGS += -DRELSTR=\\\"-$(PKG_VERSION)-$(PKG_RELEASE)-OpenWrt\\\"
  64. define Build/Compile
  65. +$(MAKE_VARS) \
  66. $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(MAKE_PATH)
  67. endef
  68. define Package/openocd/install
  69. $(INSTALL_DIR) $(1)/usr/bin
  70. $(INSTALL_DIR) $(1)/usr/share/openocd
  71. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/openocd $(1)/usr/bin/
  72. $(CP) $(PKG_INSTALL_DIR)/usr/share/openocd/scripts $(1)/usr/share/openocd
  73. endef
  74. $(eval $(call BuildPackage,openocd))