xref: /OK3568_Linux_fs/buildroot/package/openocd/openocd.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun################################################################################
2*4882a593Smuzhiyun#
3*4882a593Smuzhiyun# openocd
4*4882a593Smuzhiyun#
5*4882a593Smuzhiyun################################################################################
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunOPENOCD_VERSION = 0.11.0
8*4882a593SmuzhiyunOPENOCD_SOURCE = openocd-$(OPENOCD_VERSION).tar.bz2
9*4882a593SmuzhiyunOPENOCD_SITE = http://sourceforge.net/projects/openocd/files/openocd/$(OPENOCD_VERSION)
10*4882a593SmuzhiyunOPENOCD_LICENSE = GPL-2.0+
11*4882a593SmuzhiyunOPENOCD_LICENSE_FILES = COPYING
12*4882a593Smuzhiyun# 0002-configure-enable-build-on-uclinux.patch patches configure.ac
13*4882a593SmuzhiyunOPENOCD_AUTORECONF = YES
14*4882a593SmuzhiyunOPENOCD_CONF_ENV = CFLAGS="$(TARGET_CFLAGS) -std=gnu99"
15*4882a593Smuzhiyun
16*4882a593SmuzhiyunOPENOCD_CONF_OPTS = \
17*4882a593Smuzhiyun	--oldincludedir=$(STAGING_DIR)/usr/include \
18*4882a593Smuzhiyun	--includedir=$(STAGING_DIR)/usr/include \
19*4882a593Smuzhiyun	--disable-doxygen-html \
20*4882a593Smuzhiyun	--disable-internal-jimtcl \
21*4882a593Smuzhiyun	--disable-shared \
22*4882a593Smuzhiyun	--enable-dummy \
23*4882a593Smuzhiyun	--disable-werror
24*4882a593Smuzhiyun
25*4882a593Smuzhiyun# Rely on the Config.in options of each individual adapter selecting
26*4882a593Smuzhiyun# the dependencies they need.
27*4882a593Smuzhiyun
28*4882a593SmuzhiyunOPENOCD_DEPENDENCIES = \
29*4882a593Smuzhiyun	host-pkgconf \
30*4882a593Smuzhiyun	jimtcl \
31*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_LIBFTDI1),libftdi1) \
32*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_LIBUSB),libusb) \
33*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_LIBUSB_COMPAT),libusb-compat) \
34*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_LIBHID),libhid) \
35*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_HIDAPI),hidapi) \
36*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_LIBGPIOD),libgpiod)
37*4882a593Smuzhiyun
38*4882a593Smuzhiyun# Adapters
39*4882a593SmuzhiyunOPENOCD_CONF_OPTS += \
40*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_OPENOCD_FTDI),--enable-ftdi,--disable-ftdi) \
41*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_OPENOCD_STLINK),--enable-stlink,--disable-stlink) \
42*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_OPENOCD_TI_ICDI),--enable-ti-icdi,--disable-ti-icdi) \
43*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_OPENOCD_ULINK),--enable-ulink,--disable-ulink) \
44*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_OPENOCD_UBLASTER2),--enable-usb-blaster-2,--disable-usb-blaster-2) \
45*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_OPENOCD_JLINK),--enable-jlink,--disable-jlink) \
46*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_OPENOCD_OSDBM),--enable-osbdm,--disable-osbdm) \
47*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_OPENOCD_OPENDOUS),--enable-opendous,--disable-opendous) \
48*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_OPENOCD_AICE),--enable-aice,--disable-aice) \
49*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_OPENOCD_VSLLINK),--enable-vsllink,--disable-vsllink) \
50*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_OPENOCD_USBPROG),--enable-usbprog,--disable-usbprog) \
51*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_OPENOCD_RLINK),--enable-rlink,--disable-rlink) \
52*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_OPENOCD_XDS110),--enable-xds110,--disable-xds110) \
53*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_OPENOCD_ARMEW),--enable-armjtagew,--disable-armjtagew) \
54*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_OPENOCD_CMSIS_DAP),--enable-cmsis-dap,--disable-cmsis-dap) \
55*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_OPENOCD_PARPORT),--enable-parport,--disable-parport) \
56*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_OPENOCD_VPI),--enable-jtag_vpi,--disable-jtag_vpi) \
57*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_OPENOCD_UBLASTER),--enable-usb-blaster,--disable-usb-blaster) \
58*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_OPENOCD_AMTJT),--enable-amtjtagaccel,--disable-amjtagaccel) \
59*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_OPENOCD_ZY1000_MASTER),--enable-zy1000-master,--disable-zy1000-master) \
60*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_OPENOCD_ZY1000),--enable-zy1000,--disable-zy1000) \
61*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_OPENOCD_EP93XX),--enable-ep93xx,--disable-ep93xx) \
62*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_OPENOCD_AT91RM),--enable-at91rm9200,--disable-at91rm9200) \
63*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_OPENOCD_BCM2835),--enable-bcm2835gpio,--disable-bcm2835gpio) \
64*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_OPENOCD_GW16012),--enable-gw16012,--disable-gw16012) \
65*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_OPENOCD_PRESTO),--enable-presto,--disable-presto) \
66*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_OPENOCD_OPENJTAG),--enable-openjtag,--disable-openjtag) \
67*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_OPENOCD_BUSPIRATE),--enable-buspirate,--disable-buspirate) \
68*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_OPENOCD_SYSFS),--enable-sysfsgpio,--disable-sysfsgpio)
69*4882a593Smuzhiyun
70*4882a593Smuzhiyun# Enable all configuration options for host build.
71*4882a593Smuzhiyun#
72*4882a593Smuzhiyun# Note that deprecated options have been removed. CMSIS_DAP needs
73*4882a593Smuzhiyun# hidapi (currently not included in buildroot) and zy1000 stuff fails
74*4882a593Smuzhiyun# to build, so they've been removed too.
75*4882a593Smuzhiyun#
76*4882a593SmuzhiyunHOST_OPENOCD_CONF_OPTS = \
77*4882a593Smuzhiyun	--enable-ftdi \
78*4882a593Smuzhiyun	--enable-stlink \
79*4882a593Smuzhiyun	--enable-ti-icdi \
80*4882a593Smuzhiyun	--enable-ulink \
81*4882a593Smuzhiyun	--enable-usb-blaster-2 \
82*4882a593Smuzhiyun	--enable-jlink \
83*4882a593Smuzhiyun	--enable-osbdm \
84*4882a593Smuzhiyun	--enable-opendous \
85*4882a593Smuzhiyun	--enable-aice \
86*4882a593Smuzhiyun	--enable-vsllink \
87*4882a593Smuzhiyun	--enable-usbprog \
88*4882a593Smuzhiyun	--enable-rlink \
89*4882a593Smuzhiyun	--enable-armjtagew \
90*4882a593Smuzhiyun	--enable-parport \
91*4882a593Smuzhiyun	--enable-jtag_vpi \
92*4882a593Smuzhiyun	--enable-usb-blaster \
93*4882a593Smuzhiyun	--enable-amtjtagaccel \
94*4882a593Smuzhiyun	--enable-gw16012 \
95*4882a593Smuzhiyun	--enable-presto \
96*4882a593Smuzhiyun	--enable-openjtag \
97*4882a593Smuzhiyun	--enable-buspirate \
98*4882a593Smuzhiyun	--enable-sysfsgpio \
99*4882a593Smuzhiyun	--oldincludedir=$(HOST_DIR)/include \
100*4882a593Smuzhiyun	--includedir=$(HOST_DIR)/include \
101*4882a593Smuzhiyun	--disable-doxygen-html \
102*4882a593Smuzhiyun	--disable-internal-jimtcl \
103*4882a593Smuzhiyun	--disable-shared \
104*4882a593Smuzhiyun	--enable-dummy \
105*4882a593Smuzhiyun	--disable-werror
106*4882a593Smuzhiyun
107*4882a593SmuzhiyunHOST_OPENOCD_DEPENDENCIES = host-jimtcl host-libftdi host-libusb host-libusb-compat
108*4882a593Smuzhiyun
109*4882a593Smuzhiyun# Avoid documentation rebuild. On PowerPC64(le), we patch the
110*4882a593Smuzhiyun# configure script. Due to this, the version.texi files gets
111*4882a593Smuzhiyun# regenerated, and then since it has a newer date than openocd.info,
112*4882a593Smuzhiyun# openocd build system rebuilds the documentation. Unfortunately, this
113*4882a593Smuzhiyun# documentation rebuild fails on old machines. We work around this by
114*4882a593Smuzhiyun# faking the date of the generated version.texi file, to make the
115*4882a593Smuzhiyun# build system believe the documentation doesn't need to be
116*4882a593Smuzhiyun# regenerated.
117*4882a593Smuzhiyundefine OPENOCD_FIX_VERSION_TEXI
118*4882a593Smuzhiyun	touch -r $(@D)/doc/openocd.info $(@D)/doc/version.texi
119*4882a593Smuzhiyunendef
120*4882a593SmuzhiyunOPENOCD_POST_BUILD_HOOKS += OPENOCD_FIX_VERSION_TEXI
121*4882a593SmuzhiyunHOST_OPENOCD_POST_BUILD_HOOKS += OPENOCD_FIX_VERSION_TEXI
122*4882a593Smuzhiyun
123*4882a593Smuzhiyun$(eval $(autotools-package))
124*4882a593Smuzhiyun$(eval $(host-autotools-package))
125