Merge branch 'dsp5680xx_cherry' into merging__dsp5680xx_cherry__into__ft2232_gpio_danger
[openocd/dsp568013.git] / src / Makefile.am
blob9c026e2b62b88f423537fc6a0744f7cb34611ffd
1 include $(top_srcdir)/common.mk
3 SUBDIRS = \
4         jtag \
5         interface \
6         helper \
7         target \
8         transport \
9         flash \
10         svf \
11         xsvf \
12         pld \
13         server \
14         rtos
16 lib_LTLIBRARIES = libopenocd.la
17 bin_PROGRAMS = openocd
19 if ECOSBOARD
20 MAINFILE = ecosboard.c
21 else
22 MAINFILE = main.c
23 endif
25 openocd_SOURCES = $(MAINFILE)
26 openocd_LDADD = libopenocd.la
28 if INTERNAL_JIMTCL
29 openocd_LDADD += $(top_builddir)/jimtcl/libjim.a
30 else
31 openocd_LDADD += -ljim
32 endif
34 if ULINK
35 openocd_LDADD += -lm
36 endif
38 libopenocd_la_SOURCES = \
39         hello.c \
40         openocd.c \
41         startup_tcl.c
43 noinst_HEADERS = \
44         hello.h \
45         openocd.h
47 libopenocd_la_CPPFLAGS = -DPKGBLDDATE=\"`date +%F-%R`\"
49 # banner output includes RELSTR appended to $VERSION from the configure script
50 # guess-rev.sh returns either a repository version ID or "-snapshot"
51 if RELEASE
52 libopenocd_la_CPPFLAGS += -DRELSTR=\"\"
53 libopenocd_la_CPPFLAGS += -DGITVERSION=\"\"
54 else
55 libopenocd_la_CPPFLAGS += -DRELSTR=\"`$(top_srcdir)/guess-rev.sh $(top_srcdir)`\"
56 libopenocd_la_CPPFLAGS += -DGITVERSION=\"`cd $(top_srcdir) && git describe`\"
57 endif
59 # add default CPPFLAGS
60 libopenocd_la_CPPFLAGS += $(AM_CPPFLAGS) $(CPPFLAGS)
62 # the library search path.
63 libopenocd_la_LDFLAGS = $(all_libraries)
65 if IS_MINGW
66 MINGWLDADD = -lws2_32
67 else
68 MINGWLDADD =
69 endif
71 if FT2232_LIBFTDI
72 FTDI2232LIB = -lftdi -lusb
73 else
74 if USB_BLASTER_LIBFTDI
75 FTDI2232LIB = -lftdi -lusb
76 else
77 if PRESTO_LIBFTDI
78 FTDI2232LIB = -lftdi -lusb
79 else
80 FTDI2232LIB =
81 endif
82 endif
83 endif
85 LIBUSB =
86 if USE_LIBUSB1
87 LIBUSB += -lusb-1.0
88 endif
90 if USE_LIBUSB0
91 LIBUSB += -lusb
92 endif
94 libopenocd_la_LIBADD = \
95         $(top_builddir)/src/xsvf/libxsvf.la \
96         $(top_builddir)/src/svf/libsvf.la \
97         $(top_builddir)/src/pld/libpld.la \
98         $(top_builddir)/src/jtag/libjtag.la \
99         $(top_builddir)/src/interface/libinterface.la \
100         $(top_builddir)/src/transport/libtransport.la \
101         $(top_builddir)/src/flash/libflash.la \
102         $(top_builddir)/src/target/libtarget.la \
103         $(top_builddir)/src/server/libserver.la \
104         $(top_builddir)/src/rtos/librtos.la \
105         $(top_builddir)/src/helper/libhelper.la \
106         $(FTDI2232LIB) $(MINGWLDADD) $(LIBUSB)
108 STARTUP_TCL_SRCS = \
109         $(srcdir)/helper/startup.tcl \
110         $(srcdir)/jtag/startup.tcl \
111         $(srcdir)/target/startup.tcl \
112         $(srcdir)/flash/startup.tcl \
113         $(srcdir)/server/startup.tcl
115 EXTRA_DIST = $(STARTUP_TCL_SRCS)
117 BUILT_SOURCES = startup.tcl
119 startup.tcl: $(STARTUP_TCL_SRCS)
120         cat $^ > $@
122 BIN2C = $(top_builddir)/src/helper/bin2char$(EXEEXT_FOR_BUILD)
124 # Convert .tcl to cfile
125 startup_tcl.c: startup.tcl $(BIN2C)
126         $(BIN2C) openocd_startup_tcl < $< > $@ || rm -f $@
128 # add startup_tcl.c to make clean list
129 CLEANFILES = startup.tcl startup_tcl.c
131 # we do not want generated file in the dist
132 dist-hook:
133         rm -f $(distdir)/startup_tcl.c
134         
135 MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
137 # The "quick" target builds executables & reinstalls the executables
138 # Primary use: developer types to quicken the edit/compile/debug
139 # cycle.  by not requiring a "full build and full install". Note the
140 # assumption is: You are only rebuilding the EXE.... and everything
141 # else is/was previously installed.
143 # use at your own risk
144 quick: all install-binPROGRAMS