Browse Source

openocd: add OpenOCD, a tool to work with on-chip debug and JTAG

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Paul Fertser 10 years ago
parent
commit
361c320678
1 changed files with 77 additions and 0 deletions
  1. 77
    0
      utils/openocd/Makefile

+ 77
- 0
utils/openocd/Makefile View File

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