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.
 
 
 
 
 
 

141 lines
2.8 KiB

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