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.

Makefile.am 3.0 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. if ULINK
  28. openocd_LDADD += -lm
  29. endif
  30. libopenocd_la_SOURCES = \
  31. hello.c \
  32. openocd.c \
  33. startup_tcl.c
  34. noinst_HEADERS = \
  35. hello.h \
  36. openocd.h
  37. libopenocd_la_CPPFLAGS = -DPKGBLDDATE=\"`date +%F-%R`\"
  38. # banner output includes RELSTR appended to $VERSION from the configure script
  39. # guess-rev.sh returns either a repository version ID or "-snapshot"
  40. if RELEASE
  41. libopenocd_la_CPPFLAGS += -DRELSTR=\"\"
  42. libopenocd_la_CPPFLAGS += -DGITVERSION=\"\"
  43. else
  44. libopenocd_la_CPPFLAGS += -DRELSTR=\"`$(top_srcdir)/guess-rev.sh $(top_srcdir)`\"
  45. libopenocd_la_CPPFLAGS += -DGITVERSION=\"`cd $(top_srcdir) && git describe`\"
  46. endif
  47. # add default CPPFLAGS
  48. libopenocd_la_CPPFLAGS += $(AM_CPPFLAGS) $(CPPFLAGS)
  49. # the library search path.
  50. libopenocd_la_LDFLAGS = $(all_libraries)
  51. if IS_MINGW
  52. MINGWLDADD = -lws2_32
  53. else
  54. MINGWLDADD =
  55. endif
  56. if FT2232_LIBFTDI
  57. FTDI2232LIB = -lftdi -lusb
  58. else
  59. if USB_BLASTER_LIBFTDI
  60. FTDI2232LIB = -lftdi -lusb
  61. else
  62. if PRESTO_LIBFTDI
  63. FTDI2232LIB = -lftdi -lusb
  64. else
  65. FTDI2232LIB =
  66. endif
  67. endif
  68. endif
  69. LIBUSB =
  70. if USE_LIBUSB1
  71. LIBUSB += -lusb-1.0
  72. endif
  73. if USE_LIBUSB0
  74. LIBUSB += -lusb
  75. endif
  76. libopenocd_la_LIBADD = \
  77. $(top_builddir)/src/xsvf/libxsvf.la \
  78. $(top_builddir)/src/svf/libsvf.la \
  79. $(top_builddir)/src/pld/libpld.la \
  80. $(top_builddir)/src/jtag/libjtag.la \
  81. $(top_builddir)/src/transport/libtransport.la \
  82. $(top_builddir)/src/flash/libflash.la \
  83. $(top_builddir)/src/target/libtarget.la \
  84. $(top_builddir)/src/server/libserver.la \
  85. $(top_builddir)/src/rtos/librtos.la \
  86. $(top_builddir)/src/helper/libhelper.la \
  87. $(FTDI2232LIB) $(MINGWLDADD) $(LIBUSB)
  88. STARTUP_TCL_SRCS = \
  89. $(srcdir)/helper/startup.tcl \
  90. $(srcdir)/jtag/startup.tcl \
  91. $(srcdir)/target/startup.tcl \
  92. $(srcdir)/flash/startup.tcl \
  93. $(srcdir)/server/startup.tcl
  94. EXTRA_DIST = $(STARTUP_TCL_SRCS)
  95. BUILT_SOURCES = startup.tcl
  96. startup.tcl: $(STARTUP_TCL_SRCS)
  97. cat $^ > $@
  98. BIN2C = $(top_builddir)/src/helper/bin2char$(EXEEXT_FOR_BUILD)
  99. # Convert .tcl to cfile
  100. startup_tcl.c: startup.tcl $(BIN2C)
  101. $(BIN2C) openocd_startup_tcl < $< > $@ || rm -f $@
  102. # add startup_tcl.c to make clean list
  103. CLEANFILES = startup.tcl startup_tcl.c
  104. # we do not want generated file in the dist
  105. dist-hook:
  106. rm -f $(distdir)/startup_tcl.c
  107. MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
  108. # The "quick" target builds executables & reinstalls the executables
  109. # Primary use: developer types to quicken the edit/compile/debug
  110. # cycle. by not requiring a "full build and full install". Note the
  111. # assumption is: You are only rebuilding the EXE.... and everything
  112. # else is/was previously installed.
  113. #
  114. # use at your own risk
  115. quick: all install-binPROGRAMS