2010-11-12 05:41:55 -06:00
|
|
|
include $(top_srcdir)/common.mk
|
|
|
|
|
2009-12-04 06:42:38 -06:00
|
|
|
SUBDIRS = \
|
|
|
|
jtag \
|
2010-09-20 06:44:03 -05:00
|
|
|
helper \
|
2009-12-04 06:42:38 -06:00
|
|
|
target \
|
2011-06-13 08:42:46 -05:00
|
|
|
transport \
|
2009-12-04 06:42:38 -06:00
|
|
|
flash \
|
|
|
|
svf \
|
|
|
|
xsvf \
|
|
|
|
pld \
|
2011-04-14 03:25:01 -05:00
|
|
|
server \
|
|
|
|
rtos
|
2009-05-10 17:03:57 -05:00
|
|
|
|
|
|
|
lib_LTLIBRARIES = libopenocd.la
|
2008-07-17 01:21:29 -05:00
|
|
|
bin_PROGRAMS = openocd
|
2008-03-11 16:32:03 -05:00
|
|
|
|
|
|
|
if ECOSBOARD
|
2008-09-25 09:31:10 -05:00
|
|
|
MAINFILE = ecosboard.c
|
2008-03-11 16:32:03 -05:00
|
|
|
else
|
2008-07-17 12:34:53 -05:00
|
|
|
MAINFILE = main.c
|
2008-03-11 16:32:03 -05:00
|
|
|
endif
|
|
|
|
|
2009-09-21 13:40:55 -05:00
|
|
|
openocd_SOURCES = $(MAINFILE)
|
2010-11-17 04:26:21 -06:00
|
|
|
openocd_LDADD = libopenocd.la
|
|
|
|
|
|
|
|
if INTERNAL_JIMTCL
|
|
|
|
openocd_LDADD += $(top_builddir)/jimtcl/libjim.a
|
|
|
|
else
|
|
|
|
openocd_LDADD += -ljim
|
|
|
|
endif
|
2009-05-10 17:03:57 -05:00
|
|
|
|
2009-11-11 03:20:49 -06:00
|
|
|
libopenocd_la_SOURCES = \
|
|
|
|
hello.c \
|
2009-11-17 10:30:51 -06:00
|
|
|
openocd.c \
|
|
|
|
startup_tcl.c
|
2006-06-02 05:36:31 -05:00
|
|
|
|
2009-11-14 09:29:16 -06:00
|
|
|
noinst_HEADERS = \
|
2009-12-02 20:24:27 -06:00
|
|
|
hello.h \
|
2009-11-14 09:29:16 -06:00
|
|
|
openocd.h
|
|
|
|
|
2009-05-27 02:49:58 -05:00
|
|
|
libopenocd_la_CPPFLAGS = -DPKGBLDDATE=\"`date +%F-%R`\"
|
2009-01-19 22:03:31 -06:00
|
|
|
|
2009-10-07 00:43:05 -05:00
|
|
|
# banner output includes RELSTR appended to $VERSION from the configure script
|
|
|
|
# guess-rev.sh returns either a repository version ID or "-snapshot"
|
2009-01-19 22:03:31 -06:00
|
|
|
if RELEASE
|
2009-10-07 00:43:05 -05:00
|
|
|
libopenocd_la_CPPFLAGS += -DRELSTR=\"\"
|
2009-01-19 22:03:31 -06:00
|
|
|
else
|
2009-10-07 00:43:05 -05:00
|
|
|
libopenocd_la_CPPFLAGS += -DRELSTR=\"`$(top_srcdir)/guess-rev.sh $(top_srcdir)`\"
|
2009-01-19 22:03:31 -06:00
|
|
|
endif
|
2010-09-10 06:16:13 -05:00
|
|
|
libopenocd_la_CPPFLAGS += -DGITVERSION=\"`cd $(top_srcdir) && git describe`\"
|
2009-01-19 22:03:31 -06:00
|
|
|
|
|
|
|
# add default CPPFLAGS
|
2009-05-10 17:03:57 -05:00
|
|
|
libopenocd_la_CPPFLAGS += $(AM_CPPFLAGS) $(CPPFLAGS)
|
2007-12-10 10:55:14 -06:00
|
|
|
|
2006-06-02 05:36:31 -05:00
|
|
|
# the library search path.
|
2009-09-21 13:40:55 -05:00
|
|
|
libopenocd_la_LDFLAGS = $(all_libraries)
|
2006-06-02 05:36:31 -05:00
|
|
|
|
2006-07-17 09:13:27 -05:00
|
|
|
if IS_MINGW
|
2009-10-19 19:48:19 -05:00
|
|
|
MINGWLDADD = -lws2_32
|
2006-07-17 09:13:27 -05:00
|
|
|
else
|
|
|
|
MINGWLDADD =
|
|
|
|
endif
|
|
|
|
|
2006-08-11 12:49:41 -05:00
|
|
|
if FT2232_LIBFTDI
|
2008-05-01 14:31:13 -05:00
|
|
|
FTDI2232LIB = -lftdi -lusb
|
2006-06-02 05:36:31 -05:00
|
|
|
else
|
2009-12-26 17:05:06 -06:00
|
|
|
if USB_BLASTER_LIBFTDI
|
|
|
|
FTDI2232LIB = -lftdi -lusb
|
|
|
|
else
|
2007-08-14 04:48:54 -05:00
|
|
|
if PRESTO_LIBFTDI
|
2008-05-01 14:31:13 -05:00
|
|
|
FTDI2232LIB = -lftdi -lusb
|
2007-08-14 05:05:40 -05:00
|
|
|
else
|
2006-06-02 05:36:31 -05:00
|
|
|
FTDI2232LIB =
|
|
|
|
endif
|
2007-08-14 05:05:40 -05:00
|
|
|
endif
|
2009-12-26 17:05:06 -06:00
|
|
|
endif
|
2006-06-02 05:36:31 -05:00
|
|
|
|
2007-07-15 06:19:33 -05:00
|
|
|
if USBPROG
|
|
|
|
LIBUSB = -lusb
|
|
|
|
else
|
2008-05-14 09:13:38 -05:00
|
|
|
if JLINK
|
|
|
|
LIBUSB = -lusb
|
|
|
|
else
|
2008-12-18 22:25:22 -06:00
|
|
|
if RLINK
|
|
|
|
LIBUSB = -lusb
|
|
|
|
else
|
2008-12-26 20:56:55 -06:00
|
|
|
if VSLLINK
|
|
|
|
LIBUSB = -lusb
|
|
|
|
else
|
2007-07-15 06:19:33 -05:00
|
|
|
LIBUSB =
|
|
|
|
endif
|
2008-05-14 09:13:38 -05:00
|
|
|
endif
|
2008-12-18 22:25:22 -06:00
|
|
|
endif
|
2008-12-26 20:56:55 -06:00
|
|
|
endif
|
2007-07-15 06:19:33 -05:00
|
|
|
|
2009-05-10 17:03:57 -05:00
|
|
|
libopenocd_la_LIBADD = \
|
|
|
|
$(top_builddir)/src/xsvf/libxsvf.la \
|
|
|
|
$(top_builddir)/src/svf/libsvf.la \
|
|
|
|
$(top_builddir)/src/pld/libpld.la \
|
|
|
|
$(top_builddir)/src/jtag/libjtag.la \
|
2011-06-13 08:42:46 -05:00
|
|
|
$(top_builddir)/src/transport/libtransport.la \
|
2009-05-10 17:03:57 -05:00
|
|
|
$(top_builddir)/src/flash/libflash.la \
|
|
|
|
$(top_builddir)/src/target/libtarget.la \
|
|
|
|
$(top_builddir)/src/server/libserver.la \
|
2011-04-14 03:25:01 -05:00
|
|
|
$(top_builddir)/src/rtos/librtos.la \
|
2009-05-10 17:03:57 -05:00
|
|
|
$(top_builddir)/src/helper/libhelper.la \
|
2008-12-26 19:15:50 -06:00
|
|
|
$(FTDI2232LIB) $(MINGWLDADD) $(LIBUSB)
|
2008-07-04 01:31:43 -05:00
|
|
|
|
2009-11-17 10:30:51 -06:00
|
|
|
STARTUP_TCL_SRCS = \
|
2009-11-17 10:29:20 -06:00
|
|
|
$(srcdir)/helper/startup.tcl \
|
|
|
|
$(srcdir)/jtag/startup.tcl \
|
|
|
|
$(srcdir)/target/startup.tcl \
|
|
|
|
$(srcdir)/flash/startup.tcl \
|
|
|
|
$(srcdir)/server/startup.tcl
|
2009-11-17 10:30:51 -06:00
|
|
|
|
|
|
|
EXTRA_DIST = $(STARTUP_TCL_SRCS)
|
|
|
|
|
|
|
|
BUILT_SOURCES = startup.tcl
|
|
|
|
|
|
|
|
startup.tcl: $(STARTUP_TCL_SRCS)
|
|
|
|
cat $^ > $@
|
|
|
|
|
2009-11-22 06:24:45 -06:00
|
|
|
BIN2C = $(top_builddir)/src/helper/bin2char$(EXEEXT_FOR_BUILD)
|
2009-11-17 10:30:51 -06:00
|
|
|
|
|
|
|
# Convert .tcl to cfile
|
|
|
|
startup_tcl.c: startup.tcl $(BIN2C)
|
2009-11-17 11:15:09 -06:00
|
|
|
$(BIN2C) openocd_startup_tcl < $< > $@ || rm -f $@
|
2009-11-17 10:30:51 -06:00
|
|
|
|
|
|
|
# add startup_tcl.c to make clean list
|
|
|
|
CLEANFILES = startup.tcl startup_tcl.c
|
|
|
|
|
|
|
|
|
2009-06-09 05:28:16 -05:00
|
|
|
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
|
2009-06-23 21:00:19 -05:00
|
|
|
|
|
|
|
# The "quick" target builds executables & reinstalls the executables
|
|
|
|
# Primary use: developer types to quicken the edit/compile/debug
|
|
|
|
# cycle. by not requiring a "full build and full install". Note the
|
|
|
|
# assumption is: You are only rebuilding the EXE.... and everything
|
|
|
|
# else is/was previously installed.
|
|
|
|
#
|
2009-09-21 13:40:55 -05:00
|
|
|
# use at your own risk
|
2009-06-23 21:00:19 -05:00
|
|
|
quick: all install-binPROGRAMS
|
|
|
|
|