summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am10
-rw-r--r--src/helper/Makefile.am9
-rw-r--r--src/helper/replacements.h14
-rw-r--r--src/jtag/Makefile.am8
4 files changed, 36 insertions, 5 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index aa315506..aa7b19f2 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,5 +1,13 @@
bin_PROGRAMS = openocd
-openocd_SOURCES = openocd.c
+
+if ECOSBOARD
+MAINFILE = ecosboard.c
+else
+MAINFILE = openocd.c
+endif
+
+
+openocd_SOURCES = $(MAINFILE)
# set the include path found by configure
INCLUDES = -I$(top_srcdir)/src/helper \
diff --git a/src/helper/Makefile.am b/src/helper/Makefile.am
index 91fe01b6..e518bc7f 100644
--- a/src/helper/Makefile.am
+++ b/src/helper/Makefile.am
@@ -2,7 +2,14 @@ INCLUDES = $(all_includes)
METASOURCES = AUTO
AM_CPPFLAGS = -DPKGDATADIR=\"$(pkgdatadir)\" -DPKGLIBDIR=\"$(pkglibdir)\" @CPPFLAGS@
noinst_LIBRARIES = libhelper.a
-libhelper_a_SOURCES = binarybuffer.c configuration.c options.c log.c interpreter.c command.c time_support.c \
+
+if ECOSBOARD
+CONFIGFILES =
+else
+CONFIGFILES = options.c
+endif
+
+libhelper_a_SOURCES = binarybuffer.c $(CONFIGFILES) configuration.c log.c interpreter.c command.c time_support.c \
replacements.c fileio.c
noinst_HEADERS = binarybuffer.h configuration.h types.h log.h command.h \
interpreter.h time_support.h replacements.h fileio.h
diff --git a/src/helper/replacements.h b/src/helper/replacements.h
index fcfa8bc8..79a7a1bd 100644
--- a/src/helper/replacements.h
+++ b/src/helper/replacements.h
@@ -26,6 +26,12 @@
#include "types.h"
+#if BUILD_ECOSBOARD
+#include <pkgconf/system.h>
+#include <stdlib.h>
+#include <sys/select.h>
+#endif
+
/* include necessary headers for socket functionality */
#ifdef _WIN32
#include <winsock2.h>
@@ -112,15 +118,19 @@ extern size_t strnlen(const char *s, size_t maxlen);
#endif /* HAVE_STRNLEN */
#ifndef HAVE_USLEEP
+#ifdef _WIN32
static __inline unsigned usleep(unsigned int usecs)
{
-#ifdef _WIN32
Sleep((usecs/1000));
return 0;
+}
#else
+#if BUILD_ECOSBOARD
+void usleep(int us);
+#else
#error no usleep defined for your platform
#endif
-}
+#endif
#endif /* HAVE_USLEEP */
/* Windows specific */
diff --git a/src/jtag/Makefile.am b/src/jtag/Makefile.am
index 04e50ffd..4a0f5d27 100644
--- a/src/jtag/Makefile.am
+++ b/src/jtag/Makefile.am
@@ -47,6 +47,12 @@ else
EP93XXFILES =
endif
+if ECOSBOARD
+ECOSBOARDFILES = eCosBoard.c
+else
+ECOSBOARDFILES =
+endif
+
if AT91RM9200
AT91RM9200FILES = at91rm9200.c
else
@@ -82,6 +88,6 @@ USBPROGFILES =
endif
libjtag_a_SOURCES = jtag.c $(BITBANGFILES) $(PARPORTFILES) $(FT2232FILES) $(AMTJTAGACCELFILES) $(EP93XXFILES) \
- $(AT91RM9200FILES) $(GW16012FILES) $(BITQFILES) $(PRESTOFILES) $(USBPROGFILES)
+ $(AT91RM9200FILES) $(GW16012FILES) $(BITQFILES) $(PRESTOFILES) $(USBPROGFILES) $(ECOSBOARDFILES)
noinst_HEADERS = bitbang.h jtag.h