i dont like having to hand maintain lists. so this autogenerates cmd_list.h based on the cmd_*.c files. -mike
--- src/cmd/cmd_list.h (revision 1910)
+++ src/cmd/cmd_list.h (working copy)
@@ -31,56 +31,13 @@
*
*/
-
-/*
- * Please keep this list sorted alphabetically
- */
-
-_URJ_CMD(addpart)
-_URJ_CMD(bfin)
-_URJ_CMD(bit)
-#ifdef ENABLE_BSDL
-_URJ_CMD(bsdl)
+#ifndef ENABLE_BSDL
+#define URJ_CMD_SKIP_bsdl
#endif
-_URJ_CMD(bus)
-_URJ_CMD(cable)
-_URJ_CMD(debug)
-_URJ_CMD(detect)
-_URJ_CMD(detectflash)
-_URJ_CMD(discovery)
-_URJ_CMD(dr)
-_URJ_CMD(endian)
-_URJ_CMD(eraseflash)
-_URJ_CMD(flashmem)
-_URJ_CMD(frequency)
-_URJ_CMD(get)
-_URJ_CMD(help)
-_URJ_CMD(idcode)
-_URJ_CMD(include)
-_URJ_CMD(initbus)
-_URJ_CMD(instruction)
-_URJ_CMD(part)
-_URJ_CMD(peek)
-_URJ_CMD(pld)
-_URJ_CMD(pod)
-_URJ_CMD(poke)
-_URJ_CMD(print)
-_URJ_CMD(quit)
-_URJ_CMD(readmem)
-_URJ_CMD(register)
-_URJ_CMD(reset)
-_URJ_CMD(salias)
-_URJ_CMD(scan)
-_URJ_CMD(script)
-_URJ_CMD(set)
-_URJ_CMD(shell)
-_URJ_CMD(shift)
-_URJ_CMD(signal)
-#ifdef ENABLE_SVF
-_URJ_CMD(svf)
+#ifndef ENABLE_SVF
+#define URJ_CMD_SKIP_svf
#endif
-_URJ_CMD(test)
-_URJ_CMD(usleep)
-_URJ_CMD(writemem)
+
+#include "generated_cmd_list.h"
#undef _URJ_CMD
--- src/cmd/Makefile.am (revision 1910)
+++ src/cmd/Makefile.am (working copy)
@@ -25,9 +25,7 @@ include $(top_srcdir)/Makefile.rules
noinst_LTLIBRARIES = libcmd.la
-libcmd_la_SOURCES = \
- cmd.h \
- cmd_list.h \
+all_cmd_files = \
cmd_frequency.c \
cmd_cable.c \
cmd_reset.c \
@@ -69,11 +67,28 @@ libcmd_la_SOURCES = \
cmd_pld.c
if ENABLE_SVF
-libcmd_la_SOURCES += cmd_svf.c
+all_cmd_files += cmd_svf.c
endif
if ENABLE_BSDL
-libcmd_la_SOURCES += cmd_bsdl.c
+all_cmd_files += cmd_bsdl.c
endif
+libcmd_la_SOURCES = \
+ cmd.h \
+ cmd_list.h \
+ $(all_cmd_files)
+
+cmd_list.h: generated_cmd_list.h
+generated_cmd_list.h: $(all_cmd_files)
+ $(AM_V_GEN)set -e; \
+ cmds=`$(SED) -n '/^const urj_cmd_t urj_cmd_/{s:.*urj_cmd_::;s:
=.*::;p}' $^`; \
+ for c in $$cmds ; do \
+ printf '#ifndef URJ_CMD_SKIP_%s\n_URJ_CMD(%s)\n#endif\n' $$c
$$c; \
+ done > [email protected]; \
+ cmp -s $@ [email protected] && rm -f [email protected] || mv [email protected] $@
+
+EXTRA_DIST = generated_cmd_list.h
+MAINTAINERCLEANFILES = generated_cmd_list.h
+
AM_CFLAGS = $(WARNINGCFLAGS)
signature.asc
Description: This is a digitally signed message part.
------------------------------------------------------------------------------ Simplify data backup and recovery for your virtual environment with vRanger. Installation's a snap, and flexible recovery options mean your data is safe, secure and there when you need it. Data protection magic? Nope - It's vRanger. Get your free trial download today. http://p.sf.net/sfu/quest-sfdev2dev
_______________________________________________ UrJTAG-development mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/urjtag-development
