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