Moves the creation of startup_tcl.c from src/helper/ to src/.
Prepares to split the startup.tcl file into its per-module parts.

Signed-off-by: Zachary T Welch <[email protected]>
---
 .gitignore             |    1 +
 src/Makefile.am        |   23 ++++++++++++++++++++++-
 src/helper/Makefile.am |   11 ++---------
 3 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/.gitignore b/.gitignore
index f8a5381..114fc05 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,6 +13,7 @@
 # editor files
 *.swp
 
+src/startup.tcl
 startup_tcl.c
 xscale_debug.h
 
diff --git a/src/Makefile.am b/src/Makefile.am
index 77ae5ae..2f17ba4 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -14,7 +14,8 @@ openocd_LDADD = libopenocd.la
 
 libopenocd_la_SOURCES = \
        hello.c \
-       openocd.c
+       openocd.c \
+       startup_tcl.c
 
 noinst_HEADERS = \
        openocd.h
@@ -97,6 +98,26 @@ if HTTPD
 libopenocd_la_LIBADD += -lmicrohttpd
 endif
 
+STARTUP_TCL_SRCS = \
+       $(srcdir)/helper/startup.tcl
+
+EXTRA_DIST = $(STARTUP_TCL_SRCS)
+
+BUILT_SOURCES = startup.tcl
+
+startup.tcl: $(STARTUP_TCL_SRCS)
+       cat $^ > $@
+
+BIN2C = $(builddir)/helper/bin2char$(EXEEXT_FOR_BUILD)
+
+# Convert .tcl to cfile
+startup_tcl.c: startup.tcl $(BIN2C)
+       $(BIN2C) startup_tcl < $< > $@ || rm -f $@
+
+# add startup_tcl.c to make clean list
+CLEANFILES = startup.tcl startup_tcl.c
+
+
 MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
 
 # The "quick" target builds executables & reinstalls the executables
diff --git a/src/helper/Makefile.am b/src/helper/Makefile.am
index 67250a1..9557f5b 100644
--- a/src/helper/Makefile.am
+++ b/src/helper/Makefile.am
@@ -23,8 +23,7 @@ libhelper_la_SOURCES = \
        time_support.c \
        replacements.c \
        fileio.c \
-       membuf.c \
-       startup_tcl.c
+       membuf.c
 
 if IOUTIL
 libhelper_la_SOURCES += ioutil.c
@@ -49,7 +48,6 @@ noinst_HEADERS = \
        jim.h \
        jim-eventloop.h \
        system.h \
-       startup.tcl \
        bin2char.c
 
 BIN2C = bin2char$(EXEEXT_FOR_BUILD)
@@ -59,11 +57,6 @@ BUILT_SOURCES = $(BIN2C)
 $(BIN2C): bin2char.c
        ${CC_FOR_BUILD} ${CFLAGS_FOR_BUILD} $(srcdir)/bin2char.c -o $@
 
-# Convert .tcl to cfile
-startup_tcl.c: startup.tcl $(BIN2C)
-       ./$(BIN2C) startup_tcl < $(srcdir)/startup.tcl > $@
-
-# add startup_tcl.c to make clean list
-CLEANFILES = startup_tcl.c bin2char$(EXEEXT_FOR_BUILD)
+CLEANFILES = bin2char$(EXEEXT_FOR_BUILD)
 
 MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
-- 
1.6.4.4

_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to