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.
 
 
 
 
 
 

153 lines
3.0 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. libopenocd_la_CPPFLAGS += -DGITVERSION=\"\"
  40. else
  41. libopenocd_la_CPPFLAGS += -DRELSTR=\"`$(top_srcdir)/guess-rev.sh $(top_srcdir)`\"
  42. libopenocd_la_CPPFLAGS += -DGITVERSION=\"`cd $(top_srcdir) && git describe`\"
  43. endif
  44. # add default CPPFLAGS
  45. libopenocd_la_CPPFLAGS += $(AM_CPPFLAGS) $(CPPFLAGS)
  46. # the library search path.
  47. libopenocd_la_LDFLAGS = $(all_libraries)
  48. if IS_MINGW
  49. MINGWLDADD = -lws2_32
  50. else
  51. MINGWLDADD =
  52. endif
  53. if FT2232_LIBFTDI
  54. FTDI2232LIB = -lftdi -lusb
  55. else
  56. if USB_BLASTER_LIBFTDI
  57. FTDI2232LIB = -lftdi -lusb
  58. else
  59. if PRESTO_LIBFTDI
  60. FTDI2232LIB = -lftdi -lusb
  61. else
  62. FTDI2232LIB =
  63. endif
  64. endif
  65. endif
  66. if USBPROG
  67. LIBUSB = -lusb
  68. else
  69. if JLINK
  70. LIBUSB = -lusb
  71. else
  72. if RLINK
  73. LIBUSB = -lusb
  74. else
  75. if ULINK
  76. LIBUSB = -lusb
  77. else
  78. if VSLLINK
  79. LIBUSB = -lusb
  80. else
  81. LIBUSB =
  82. endif
  83. endif
  84. endif
  85. endif
  86. endif
  87. libopenocd_la_LIBADD = \
  88. $(top_builddir)/src/xsvf/libxsvf.la \
  89. $(top_builddir)/src/svf/libsvf.la \
  90. $(top_builddir)/src/pld/libpld.la \
  91. $(top_builddir)/src/jtag/libjtag.la \
  92. $(top_builddir)/src/transport/libtransport.la \
  93. $(top_builddir)/src/flash/libflash.la \
  94. $(top_builddir)/src/target/libtarget.la \
  95. $(top_builddir)/src/server/libserver.la \
  96. $(top_builddir)/src/rtos/librtos.la \
  97. $(top_builddir)/src/helper/libhelper.la \
  98. $(FTDI2232LIB) $(MINGWLDADD) $(LIBUSB)
  99. STARTUP_TCL_SRCS = \
  100. $(srcdir)/helper/startup.tcl \
  101. $(srcdir)/jtag/startup.tcl \
  102. $(srcdir)/target/startup.tcl \
  103. $(srcdir)/flash/startup.tcl \
  104. $(srcdir)/server/startup.tcl
  105. EXTRA_DIST = $(STARTUP_TCL_SRCS)
  106. BUILT_SOURCES = startup.tcl
  107. startup.tcl: $(STARTUP_TCL_SRCS)
  108. cat $^ > $@
  109. BIN2C = $(top_builddir)/src/helper/bin2char$(EXEEXT_FOR_BUILD)
  110. # Convert .tcl to cfile
  111. startup_tcl.c: startup.tcl $(BIN2C)
  112. $(BIN2C) openocd_startup_tcl < $< > $@ || rm -f $@
  113. # add startup_tcl.c to make clean list
  114. CLEANFILES = startup.tcl startup_tcl.c
  115. # we do not want generated file in the dist
  116. dist-hook:
  117. rm -f $(distdir)/startup_tcl.c
  118. MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
  119. # The "quick" target builds executables & reinstalls the executables
  120. # Primary use: developer types to quicken the edit/compile/debug
  121. # cycle. by not requiring a "full build and full install". Note the
  122. # assumption is: You are only rebuilding the EXE.... and everything
  123. # else is/was previously installed.
  124. #
  125. # use at your own risk
  126. quick: all install-binPROGRAMS