openocd.mk 5.0 KB

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