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.
 
 
 
 
 
 

118 lines
2.7 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) $(LIBFTDI_CFLAGS)
  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. libopenocd_la_LIBADD = \
  53. $(top_builddir)/src/xsvf/libxsvf.la \
  54. $(top_builddir)/src/svf/libsvf.la \
  55. $(top_builddir)/src/pld/libpld.la \
  56. $(top_builddir)/src/jtag/libjtag.la \
  57. $(top_builddir)/src/transport/libtransport.la \
  58. $(top_builddir)/src/flash/libflash.la \
  59. $(top_builddir)/src/target/libtarget.la \
  60. $(top_builddir)/src/server/libserver.la \
  61. $(top_builddir)/src/rtos/librtos.la \
  62. $(top_builddir)/src/helper/libhelper.la \
  63. $(LIBFTDI_LIBS) $(MINGWLDADD) \
  64. $(HIDAPI_LIBS) $(LIBUSB1_LIBS) $(LIBUSB0_LIBS)
  65. STARTUP_TCL_SRCS = \
  66. $(srcdir)/helper/startup.tcl \
  67. $(srcdir)/jtag/startup.tcl \
  68. $(srcdir)/target/startup.tcl \
  69. $(srcdir)/flash/startup.tcl \
  70. $(srcdir)/server/startup.tcl
  71. EXTRA_DIST = $(STARTUP_TCL_SRCS)
  72. BUILT_SOURCES = startup.tcl
  73. startup.tcl: $(STARTUP_TCL_SRCS)
  74. cat $^ > $@
  75. BIN2C = $(top_builddir)/src/helper/bin2char$(EXEEXT_FOR_BUILD)
  76. # Convert .tcl to cfile
  77. startup_tcl.c: startup.tcl $(BIN2C)
  78. $(BIN2C) openocd_startup_tcl < $< > $@ || rm -f $@
  79. # add startup_tcl.c to make clean list
  80. CLEANFILES = startup.tcl startup_tcl.c
  81. # we do not want generated file in the dist
  82. dist-hook:
  83. rm -f $(distdir)/startup_tcl.c
  84. MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
  85. # The "quick" target builds executables & reinstalls the executables
  86. # Primary use: developer types to quicken the edit/compile/debug
  87. # cycle. by not requiring a "full build and full install". Note the
  88. # assumption is: You are only rebuilding the EXE.... and everything
  89. # else is/was previously installed.
  90. #
  91. # use at your own risk
  92. quick: all install-binPROGRAMS