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