2010-11-12 11:41:55 +00:00
|
|
|
include $(top_srcdir)/common.mk
|
|
|
|
|
2009-12-04 12:42:38 +00:00
|
|
|
SUBDIRS = \
|
|
|
|
jtag \
|
2010-09-20 11:44:03 +00:00
|
|
|
helper \
|
2009-12-04 12:42:38 +00:00
|
|
|
target \
|
2011-06-13 13:42:46 +00:00
|
|
|
transport \
|
2009-12-04 12:42:38 +00:00
|
|
|
flash \
|
|
|
|
svf \
|
|
|
|
xsvf \
|
|
|
|
pld \
|
2011-04-14 08:25:01 +00:00
|
|
|
server \
|
|
|
|
rtos
|
2009-05-10 22:03:57 +00:00
|
|
|
|
2013-07-06 22:41:49 +00:00
|
|
|
noinst_LTLIBRARIES = libopenocd.la
|
2008-07-17 06:21:29 +00:00
|
|
|
bin_PROGRAMS = openocd
|
2008-03-11 21:32:03 +00:00
|
|
|
|
2008-07-17 17:34:53 +00:00
|
|
|
MAINFILE = main.c
|
2008-03-11 21:32:03 +00:00
|
|
|
|
2009-09-21 18:40:55 +00:00
|
|
|
openocd_SOURCES = $(MAINFILE)
|
2010-11-17 10:26:21 +00:00
|
|
|
openocd_LDADD = libopenocd.la
|
|
|
|
|
|
|
|
if INTERNAL_JIMTCL
|
|
|
|
openocd_LDADD += $(top_builddir)/jimtcl/libjim.a
|
|
|
|
else
|
|
|
|
openocd_LDADD += -ljim
|
|
|
|
endif
|
2009-05-10 22:03:57 +00:00
|
|
|
|
2011-08-04 20:30:25 +00:00
|
|
|
if ULINK
|
|
|
|
openocd_LDADD += -lm
|
|
|
|
endif
|
|
|
|
|
2009-11-11 09:20:49 +00:00
|
|
|
libopenocd_la_SOURCES = \
|
|
|
|
hello.c \
|
2014-06-18 21:10:45 +00:00
|
|
|
openocd.c
|
2006-06-02 10:36:31 +00:00
|
|
|
|
2009-11-14 15:29:16 +00:00
|
|
|
noinst_HEADERS = \
|
2009-12-03 02:24:27 +00:00
|
|
|
hello.h \
|
2009-11-14 15:29:16 +00:00
|
|
|
openocd.h
|
|
|
|
|
2009-05-27 07:49:58 +00:00
|
|
|
libopenocd_la_CPPFLAGS = -DPKGBLDDATE=\"`date +%F-%R`\"
|
2009-01-20 04:03:31 +00:00
|
|
|
|
2009-10-07 05:43:05 +00: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-20 04:03:31 +00:00
|
|
|
if RELEASE
|
2009-10-07 05:43:05 +00:00
|
|
|
libopenocd_la_CPPFLAGS += -DRELSTR=\"\"
|
2011-07-09 21:44:39 +00:00
|
|
|
libopenocd_la_CPPFLAGS += -DGITVERSION=\"\"
|
2009-01-20 04:03:31 +00:00
|
|
|
else
|
2009-10-07 05:43:05 +00:00
|
|
|
libopenocd_la_CPPFLAGS += -DRELSTR=\"`$(top_srcdir)/guess-rev.sh $(top_srcdir)`\"
|
2010-09-10 11:16:13 +00:00
|
|
|
libopenocd_la_CPPFLAGS += -DGITVERSION=\"`cd $(top_srcdir) && git describe`\"
|
2011-07-09 21:44:39 +00:00
|
|
|
endif
|
2009-01-20 04:03:31 +00:00
|
|
|
|
|
|
|
# add default CPPFLAGS
|
2014-03-30 19:15:42 +00:00
|
|
|
libopenocd_la_CPPFLAGS += $(AM_CPPFLAGS) $(CPPFLAGS)
|
2007-12-10 16:55:14 +00:00
|
|
|
|
2006-06-02 10:36:31 +00:00
|
|
|
# the library search path.
|
2009-09-21 18:40:55 +00:00
|
|
|
libopenocd_la_LDFLAGS = $(all_libraries)
|
2006-06-02 10:36:31 +00:00
|
|
|
|
2006-07-17 14:13:27 +00:00
|
|
|
if IS_MINGW
|
2009-10-20 00:48:19 +00:00
|
|
|
MINGWLDADD = -lws2_32
|
2006-07-17 14:13:27 +00:00
|
|
|
else
|
|
|
|
MINGWLDADD =
|
|
|
|
endif
|
|
|
|
|
2009-05-10 22:03:57 +00: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 13:42:46 +00:00
|
|
|
$(top_builddir)/src/transport/libtransport.la \
|
2009-05-10 22:03:57 +00:00
|
|
|
$(top_builddir)/src/flash/libflash.la \
|
|
|
|
$(top_builddir)/src/target/libtarget.la \
|
|
|
|
$(top_builddir)/src/server/libserver.la \
|
2011-04-14 08:25:01 +00:00
|
|
|
$(top_builddir)/src/rtos/librtos.la \
|
2009-05-10 22:03:57 +00:00
|
|
|
$(top_builddir)/src/helper/libhelper.la \
|
2013-10-30 15:52:10 +00:00
|
|
|
$(LIBFTDI_LIBS) $(MINGWLDADD) \
|
2013-12-19 21:33:19 +00:00
|
|
|
$(HIDAPI_LIBS) $(LIBUSB1_LIBS) $(LIBUSB0_LIBS)
|
2008-07-04 06:31:43 +00:00
|
|
|
|
2009-11-17 16:30:51 +00:00
|
|
|
STARTUP_TCL_SRCS = \
|
2009-11-17 16:29:20 +00:00
|
|
|
$(srcdir)/helper/startup.tcl \
|
|
|
|
$(srcdir)/jtag/startup.tcl \
|
|
|
|
$(srcdir)/target/startup.tcl \
|
|
|
|
$(srcdir)/flash/startup.tcl \
|
|
|
|
$(srcdir)/server/startup.tcl
|
2009-11-17 16:30:51 +00:00
|
|
|
|
|
|
|
EXTRA_DIST = $(STARTUP_TCL_SRCS)
|
|
|
|
|
2014-06-18 21:10:45 +00:00
|
|
|
BUILT_SOURCES = startup_tcl.inc
|
2009-11-17 16:30:51 +00:00
|
|
|
|
|
|
|
startup.tcl: $(STARTUP_TCL_SRCS)
|
|
|
|
cat $^ > $@
|
|
|
|
|
2014-05-11 18:15:55 +00:00
|
|
|
BIN2C = $(top_srcdir)/src/helper/bin2char.sh
|
2009-11-17 16:30:51 +00:00
|
|
|
|
2014-06-18 21:10:45 +00:00
|
|
|
# Convert .tcl to c-array
|
|
|
|
startup_tcl.inc: startup.tcl $(BIN2C)
|
|
|
|
$(BIN2C) < $< > $@ || { rm -f $@; false; }
|
2009-11-17 16:30:51 +00:00
|
|
|
|
2014-06-18 21:10:45 +00:00
|
|
|
# add generated files to make clean list
|
|
|
|
CLEANFILES = startup.tcl startup_tcl.inc
|
2009-11-17 16:30:51 +00:00
|
|
|
|
2011-06-17 11:22:37 +00:00
|
|
|
# we do not want generated file in the dist
|
|
|
|
dist-hook:
|
2014-06-18 21:10:45 +00:00
|
|
|
rm -f $(distdir)/startup_tcl.inc
|
2013-12-19 21:33:19 +00:00
|
|
|
|
2009-06-09 10:28:16 +00:00
|
|
|
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
|
2009-06-24 02:00:19 +00: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 18:40:55 +00:00
|
|
|
# use at your own risk
|
2009-06-24 02:00:19 +00:00
|
|
|
quick: all install-binPROGRAMS
|
|
|
|
|