+AM_CPPFLAGS = \
+ -I$(top_srcdir)/src \
+ -I$(top_builddir)/src
-
-INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/src/helper $(all_includes) -I$(top_srcdir)/src/target
METASOURCES = AUTO
-noinst_LIBRARIES = libjtag.a
+noinst_LTLIBRARIES = libjtag.la
-if BITBANG
-BITBANGFILES = bitbang.c
-else
-BITBANGFILES =
-endif
+SUBDIRS =
+DRIVERFILES =
+libjtag_la_LIBADD =
-if PARPORT
-PARPORTFILES = parport.c
-else
-PARPORTFILES =
-endif
+CLEANFILES =
-if DUMMY
-DUMMYFILES = dummy.c
-else
-DUMMYFILES =
-endif
+BUILT_SOURCES =
-if FT2232_LIBFTDI
-FT2232FILES = ft2232.c
-else
-if FT2232_FTD2XX
-FT2232FILES = ft2232.c
-else
-FT2232FILES =
+BUILT_SOURCES += minidriver_imp.h
+CLEANFILES += minidriver_imp.h
+
+if MINIDRIVER
+
+if ZY1000
+DRIVERFILES += zy1000/zy1000.c
+JTAG_MINIDRIVER_DIR = $(srcdir)/zy1000
endif
+if MINIDRIVER_DUMMY
+DRIVERFILES += minidummy/minidummy.c commands.c
+JTAG_MINIDRIVER_DIR = $(srcdir)/minidummy
endif
-if AMTJTAGACCEL
-AMTJTAGACCELFILES = amt_jtagaccel.c
-else
-AMTJTAGACCELFILES =
-endif
+MINIDRIVER_IMP_DIR = $(srcdir)/minidriver
-if EP93XX
-EP93XXFILES = ep93xx.c
-else
-EP93XXFILES =
-endif
+jtag_minidriver.h: $(JTAG_MINIDRIVER_DIR)/jtag_minidriver.h
+ cp $< $@
-if ECOSBOARD
-ECOSBOARDFILES = zy1000.c
-else
-ECOSBOARDFILES =
-endif
+BUILT_SOURCES += jtag_minidriver.h
-if AT91RM9200
-AT91RM9200FILES = at91rm9200.c
-else
-AT91RM9200FILES =
-endif
+CLEANFILES += jtag_minidriver.h
-if GW16012
-GW16012FILES = gw16012.c
else
-GW16012FILES =
-endif
-if BITQ
-BITQFILES = bitq.c
-else
-BITQFILES =
-endif
+MINIDRIVER_IMP_DIR = $(srcdir)/drivers
+DRIVERFILES += commands.c
-if PRESTO_LIBFTDI
-PRESTOFILES = presto.c
-else
-if PRESTO_FTD2XX
-PRESTOFILES = presto.c
-else
-PRESTOFILES =
-endif
-endif
+SUBDIRS += drivers
+libjtag_la_LIBADD += $(top_builddir)/src/jtag/drivers/libocdjtagdrivers.la
-if USBPROG
-USBPROGFILES = usbprog.c
-else
-USBPROGFILES =
endif
-if JLINK
-JLINKFILES = jlink.c
-else
-JLINKFILES =
-endif
+# endif // MINIDRIVER
-if RLINK
-RLINKFILES = rlink/rlink.c rlink/rlink_speed_table.c
-else
-RLINKFILES =
-endif
+minidriver_imp.h: $(MINIDRIVER_IMP_DIR)/minidriver_imp.h
+ cp $< $@
-if VSLLINK
-VSLLINKFILES = vsllink.c
-else
-VSLLINKFILES =
-endif
-libjtag_a_SOURCES = jtag.c $(BITBANGFILES) $(PARPORTFILES) $(DUMMYFILES) $(FT2232FILES) $(AMTJTAGACCELFILES) $(EP93XXFILES) \
- $(AT91RM9200FILES) $(GW16012FILES) $(BITQFILES) $(PRESTOFILES) $(USBPROGFILES) $(ECOSBOARDFILES) $(JLINKFILES) $(RLINKFILES) $(VSLLINKFILES)
+libjtag_la_SOURCES = \
+ adapter.c \
+ core.c \
+ interface.c \
+ interfaces.c \
+ tcl.c \
+ transport.c \
+ $(DRIVERFILES)
+
+noinst_HEADERS = \
+ commands.h \
+ driver.h \
+ interface.h \
+ interfaces.h \
+ minidriver.h \
+ jtag.h \
+ transport.h \
+ minidriver/minidriver_imp.h \
+ minidummy/jtag_minidriver.h
-noinst_HEADERS = bitbang.h jtag.h bitq.h rlink/dtc_cmd.h rlink/ep1_cmd.h rlink/rlink.h rlink/st7.h
+EXTRA_DIST = startup.tcl
-MAINTAINERCLEANFILES = Makefile.in
+MAINTAINERCLEANFILES = $(srcdir)/Makefile.in