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