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