Remove support for the GPL incompatible FTDI D2XX library
[openocd.git] / src / Makefile.am
1 include $(top_srcdir)/common.mk
2
3 SUBDIRS = \
4         jtag \
5         helper \
6         target \
7         transport \
8         flash \
9         svf \
10         xsvf \
11         pld \
12         server \
13         rtos
14
15 noinst_LTLIBRARIES = libopenocd.la
16 bin_PROGRAMS = openocd
17
18 MAINFILE = main.c
19
20 openocd_SOURCES = $(MAINFILE)
21 openocd_LDADD = libopenocd.la
22
23 if INTERNAL_JIMTCL
24 openocd_LDADD += $(top_builddir)/jimtcl/libjim.a
25 else
26 openocd_LDADD += -ljim
27 endif
28
29 if ULINK
30 openocd_LDADD += -lm
31 endif
32
33 libopenocd_la_SOURCES = \
34         hello.c \
35         openocd.c
36
37 noinst_HEADERS = \
38         hello.h \
39         openocd.h
40
41 libopenocd_la_CPPFLAGS = -DPKGBLDDATE=\"`date +%F-%R`\"
42
43 # banner output includes RELSTR appended to $VERSION from the configure script
44 # guess-rev.sh returns either a repository version ID or "-snapshot"
45 if RELEASE
46 libopenocd_la_CPPFLAGS += -DRELSTR=\"\"
47 libopenocd_la_CPPFLAGS += -DGITVERSION=\"\"
48 else
49 libopenocd_la_CPPFLAGS += -DRELSTR=\"`$(top_srcdir)/guess-rev.sh $(top_srcdir)`\"
50 libopenocd_la_CPPFLAGS += -DGITVERSION=\"`cd $(top_srcdir) && git describe`\"
51 endif
52
53 # add default CPPFLAGS
54 libopenocd_la_CPPFLAGS += $(AM_CPPFLAGS) $(CPPFLAGS)
55
56 # the library search path.
57 libopenocd_la_LDFLAGS = $(all_libraries)
58
59 if IS_MINGW
60 MINGWLDADD = -lws2_32
61 else
62 MINGWLDADD =
63 endif
64
65 libopenocd_la_LIBADD = \
66         $(top_builddir)/src/xsvf/libxsvf.la \
67         $(top_builddir)/src/svf/libsvf.la \
68         $(top_builddir)/src/pld/libpld.la \
69         $(top_builddir)/src/jtag/libjtag.la \
70         $(top_builddir)/src/transport/libtransport.la \
71         $(top_builddir)/src/flash/libflash.la \
72         $(top_builddir)/src/target/libtarget.la \
73         $(top_builddir)/src/server/libserver.la \
74         $(top_builddir)/src/rtos/librtos.la \
75         $(top_builddir)/src/helper/libhelper.la \
76         $(LIBFTDI_LIBS) $(MINGWLDADD) \
77         $(HIDAPI_LIBS) $(LIBUSB0_LIBS) $(LIBUSB1_LIBS)
78
79 if !INTERNAL_LIBJAYLINK
80 libopenocd_la_LIBADD += $(libjaylink_LIBS)
81 endif
82
83 STARTUP_TCL_SRCS = \
84         $(srcdir)/helper/startup.tcl \
85         $(srcdir)/jtag/startup.tcl \
86         $(srcdir)/target/startup.tcl \
87         $(srcdir)/flash/startup.tcl \
88         $(srcdir)/server/startup.tcl
89
90 EXTRA_DIST = $(STARTUP_TCL_SRCS)
91
92 BUILT_SOURCES = startup_tcl.inc
93
94 startup.tcl: $(STARTUP_TCL_SRCS)
95         cat $^ > $@
96
97 BIN2C = $(top_srcdir)/src/helper/bin2char.sh
98
99 # Convert .tcl to c-array
100 startup_tcl.inc: startup.tcl $(BIN2C)
101         $(BIN2C) < $< > $@ || { rm -f $@; false; }
102
103 # add generated files to make clean list
104 CLEANFILES = startup.tcl startup_tcl.inc
105
106 # we do not want generated file in the dist
107 dist-hook:
108         rm -f $(distdir)/startup_tcl.inc
109
110 MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
111
112 # The "quick" target builds executables & reinstalls the executables
113 # Primary use: developer types to quicken the edit/compile/debug
114 # cycle.  by not requiring a "full build and full install". Note the
115 # assumption is: You are only rebuilding the EXE.... and everything
116 # else is/was previously installed.
117 #
118 # use at your own risk
119 quick: all install-binPROGRAMS
120