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.
 
 
 
 
 
 

136 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. noinst_LTLIBRARIES = libopenocd.la
  14. bin_PROGRAMS = openocd
  15. MAINFILE = main.c
  16. openocd_SOURCES = $(MAINFILE)
  17. openocd_LDADD = libopenocd.la
  18. if INTERNAL_JIMTCL
  19. openocd_LDADD += $(top_builddir)/jimtcl/libjim.a
  20. else
  21. openocd_LDADD += -ljim
  22. endif
  23. if ULINK
  24. openocd_LDADD += -lm
  25. endif
  26. libopenocd_la_SOURCES = \
  27. hello.c \
  28. openocd.c \
  29. startup_tcl.c
  30. noinst_HEADERS = \
  31. hello.h \
  32. openocd.h
  33. libopenocd_la_CPPFLAGS = -DPKGBLDDATE=\"`date +%F-%R`\"
  34. # banner output includes RELSTR appended to $VERSION from the configure script
  35. # guess-rev.sh returns either a repository version ID or "-snapshot"
  36. if RELEASE
  37. libopenocd_la_CPPFLAGS += -DRELSTR=\"\"
  38. libopenocd_la_CPPFLAGS += -DGITVERSION=\"\"
  39. else
  40. libopenocd_la_CPPFLAGS += -DRELSTR=\"`$(top_srcdir)/guess-rev.sh $(top_srcdir)`\"
  41. libopenocd_la_CPPFLAGS += -DGITVERSION=\"`cd $(top_srcdir) && git describe`\"
  42. endif
  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 PRESTO_LIBFTDI
  56. FTDI2232LIB = -lftdi -lusb
  57. else
  58. FTDI2232LIB =
  59. endif
  60. endif
  61. LIBUSB =
  62. if USE_LIBUSB1
  63. LIBUSB += $(LIBUSB1_LIBS)
  64. endif
  65. if USE_LIBUSB0
  66. LIBUSB += $(LIBUSB0_LIBS)
  67. endif
  68. libopenocd_la_LIBADD = \
  69. $(top_builddir)/src/xsvf/libxsvf.la \
  70. $(top_builddir)/src/svf/libsvf.la \
  71. $(top_builddir)/src/pld/libpld.la \
  72. $(top_builddir)/src/jtag/libjtag.la \
  73. $(top_builddir)/src/transport/libtransport.la \
  74. $(top_builddir)/src/flash/libflash.la \
  75. $(top_builddir)/src/target/libtarget.la \
  76. $(top_builddir)/src/server/libserver.la \
  77. $(top_builddir)/src/rtos/librtos.la \
  78. $(top_builddir)/src/helper/libhelper.la \
  79. $(FTDI2232LIB) $(MINGWLDADD) $(LIBUSB)
  80. STARTUP_TCL_SRCS = \
  81. $(srcdir)/helper/startup.tcl \
  82. $(srcdir)/jtag/startup.tcl \
  83. $(srcdir)/target/startup.tcl \
  84. $(srcdir)/flash/startup.tcl \
  85. $(srcdir)/server/startup.tcl
  86. EXTRA_DIST = $(STARTUP_TCL_SRCS)
  87. BUILT_SOURCES = startup.tcl
  88. startup.tcl: $(STARTUP_TCL_SRCS)
  89. cat $^ > $@
  90. BIN2C = $(top_builddir)/src/helper/bin2char$(EXEEXT_FOR_BUILD)
  91. # Convert .tcl to cfile
  92. startup_tcl.c: startup.tcl $(BIN2C)
  93. $(BIN2C) openocd_startup_tcl < $< > $@ || rm -f $@
  94. # add startup_tcl.c to make clean list
  95. CLEANFILES = startup.tcl startup_tcl.c
  96. # we do not want generated file in the dist
  97. dist-hook:
  98. rm -f $(distdir)/startup_tcl.c
  99. MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
  100. # The "quick" target builds executables & reinstalls the executables
  101. # Primary use: developer types to quicken the edit/compile/debug
  102. # cycle. by not requiring a "full build and full install". Note the
  103. # assumption is: You are only rebuilding the EXE.... and everything
  104. # else is/was previously installed.
  105. #
  106. # use at your own risk
  107. quick: all install-binPROGRAMS