You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

145 lines
2.9 KiB

  1. include $(top_srcdir)/common.mk
  2. SUBDIRS = \
  3. jtag \
  4. helper \
  5. target \
  6. transport \
  7. flash \
  8. svf \
  9. xsvf \
  10. pld \
  11. server \
  12. rtos
  13. lib_LTLIBRARIES = libopenocd.la
  14. bin_PROGRAMS = openocd
  15. if ECOSBOARD
  16. MAINFILE = ecosboard.c
  17. else
  18. MAINFILE = main.c
  19. endif
  20. openocd_SOURCES = $(MAINFILE)
  21. openocd_LDADD = libopenocd.la
  22. if INTERNAL_JIMTCL
  23. openocd_LDADD += $(top_builddir)/jimtcl/libjim.a
  24. else
  25. openocd_LDADD += -ljim
  26. endif
  27. libopenocd_la_SOURCES = \
  28. hello.c \
  29. openocd.c \
  30. startup_tcl.c
  31. noinst_HEADERS = \
  32. hello.h \
  33. openocd.h
  34. libopenocd_la_CPPFLAGS = -DPKGBLDDATE=\"`date +%F-%R`\"
  35. # banner output includes RELSTR appended to $VERSION from the configure script
  36. # guess-rev.sh returns either a repository version ID or "-snapshot"
  37. if RELEASE
  38. libopenocd_la_CPPFLAGS += -DRELSTR=\"\"
  39. else
  40. libopenocd_la_CPPFLAGS += -DRELSTR=\"`$(top_srcdir)/guess-rev.sh $(top_srcdir)`\"
  41. endif
  42. libopenocd_la_CPPFLAGS += -DGITVERSION=\"`cd $(top_srcdir) && git describe`\"
  43. # add default CPPFLAGS
  44. libopenocd_la_CPPFLAGS += $(AM_CPPFLAGS) $(CPPFLAGS)
  45. # the library search path.
  46. libopenocd_la_LDFLAGS = $(all_libraries)
  47. if IS_MINGW
  48. MINGWLDADD = -lws2_32
  49. else
  50. MINGWLDADD =
  51. endif
  52. if FT2232_LIBFTDI
  53. FTDI2232LIB = -lftdi -lusb
  54. else
  55. if USB_BLASTER_LIBFTDI
  56. FTDI2232LIB = -lftdi -lusb
  57. else
  58. if PRESTO_LIBFTDI
  59. FTDI2232LIB = -lftdi -lusb
  60. else
  61. FTDI2232LIB =
  62. endif
  63. endif
  64. endif
  65. if USBPROG
  66. LIBUSB = -lusb
  67. else
  68. if JLINK
  69. LIBUSB = -lusb
  70. else
  71. if RLINK
  72. LIBUSB = -lusb
  73. else
  74. if VSLLINK
  75. LIBUSB = -lusb
  76. else
  77. LIBUSB =
  78. endif
  79. endif
  80. endif
  81. endif
  82. libopenocd_la_LIBADD = \
  83. $(top_builddir)/src/xsvf/libxsvf.la \
  84. $(top_builddir)/src/svf/libsvf.la \
  85. $(top_builddir)/src/pld/libpld.la \
  86. $(top_builddir)/src/jtag/libjtag.la \
  87. $(top_builddir)/src/transport/libtransport.la \
  88. $(top_builddir)/src/flash/libflash.la \
  89. $(top_builddir)/src/target/libtarget.la \
  90. $(top_builddir)/src/server/libserver.la \
  91. $(top_builddir)/src/rtos/librtos.la \
  92. $(top_builddir)/src/helper/libhelper.la \
  93. $(FTDI2232LIB) $(MINGWLDADD) $(LIBUSB)
  94. STARTUP_TCL_SRCS = \
  95. $(srcdir)/helper/startup.tcl \
  96. $(srcdir)/jtag/startup.tcl \
  97. $(srcdir)/target/startup.tcl \
  98. $(srcdir)/flash/startup.tcl \
  99. $(srcdir)/server/startup.tcl
  100. EXTRA_DIST = $(STARTUP_TCL_SRCS)
  101. BUILT_SOURCES = startup.tcl
  102. startup.tcl: $(STARTUP_TCL_SRCS)
  103. cat $^ > $@
  104. BIN2C = $(top_builddir)/src/helper/bin2char$(EXEEXT_FOR_BUILD)
  105. # Convert .tcl to cfile
  106. startup_tcl.c: startup.tcl $(BIN2C)
  107. $(BIN2C) openocd_startup_tcl < $< > $@ || rm -f $@
  108. # add startup_tcl.c to make clean list
  109. CLEANFILES = startup.tcl startup_tcl.c
  110. MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
  111. # The "quick" target builds executables & reinstalls the executables
  112. # Primary use: developer types to quicken the edit/compile/debug
  113. # cycle. by not requiring a "full build and full install". Note the
  114. # assumption is: You are only rebuilding the EXE.... and everything
  115. # else is/was previously installed.
  116. #
  117. # use at your own risk
  118. quick: all install-binPROGRAMS