+AM_CPPFLAGS = \
+ -I$(top_srcdir)/src \
+ -I$(top_builddir)/src
-if FTD2XXDIR
-if IS_MINGW
-FTD2XXINC = -I@WITH_FTD2XX@
-else
-FTD2XXINC = -I@WITH_FTD2XX@/
+METASOURCES = AUTO
+noinst_LTLIBRARIES = libjtag.la
+
+SUBDIRS =
+DRIVERFILES =
+libjtag_la_LIBADD =
+
+CLEANFILES =
+
+BUILT_SOURCES =
+
+BUILT_SOURCES += minidriver_imp.h
+CLEANFILES += minidriver_imp.h
+
+if MINIDRIVER
+
+if ZY1000
+DRIVERFILES += zy1000/zy1000.c
+JTAG_MINIDRIVER_DIR = $(srcdir)/zy1000
endif
-else
-FTD2XXINC =
+if MINIDRIVER_DUMMY
+DRIVERFILES += minidummy/minidummy.c commands.c
+JTAG_MINIDRIVER_DIR = $(srcdir)/minidummy
endif
-INCLUDES = -I$(top_srcdir)/src/helper $(FTD2XXINC) $(all_includes)
-METASOURCES = AUTO
-noinst_LIBRARIES = libjtag.a
+MINIDRIVER_IMP_DIR = $(srcdir)/minidriver
-if BITBANG
-BITBANGFILES = bitbang.c
-else
-BITBANGFILES =
-endif
+jtag_minidriver.h: $(JTAG_MINIDRIVER_DIR)/jtag_minidriver.h
+ cp $< $@
-if PARPORT
-PARPORTFILES = parport.c
-else
-PARPORTFILES =
-endif
+BUILT_SOURCES += jtag_minidriver.h
-if FT2232_LIBFTDI
-FT2232FILES = ft2232.c
-else
-FT2232FILES =
-endif
+CLEANFILES += jtag_minidriver.h
-if FT2232_FTD2XX
-FT2232FILES = ft2232.c
else
-FT2232FILES =
-endif
-if AMTJTAGACCEL
-AMTJTAGACCELFILES = amt_jtagaccel.c
-else
-AMTJTAGACCELFILES =
-endif
+MINIDRIVER_IMP_DIR = $(srcdir)/drivers
+DRIVERFILES += commands.c
-if EP93XX
-EP93XXFILES = ep93xx.c
-else
-EP93XXFILES =
-endif
+SUBDIRS += drivers
+libjtag_la_LIBADD += $(top_builddir)/src/jtag/drivers/libocdjtagdrivers.la
-if AT91RM9200
-AT91RM9200FILES = at91rm9200.c
-else
-AT91RM9200FILES =
endif
-if GW16012
-GW16012FILES = gw16012.c
-else
-GW16012FILES =
-endif
+# endif // MINIDRIVER
+
+minidriver_imp.h: $(MINIDRIVER_IMP_DIR)/minidriver_imp.h
+ cp $< $@
+
+
+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
-libjtag_a_SOURCES = jtag.c $(BITBANGFILES) $(PARPORTFILES) $(FT2232FILES) $(AMTJTAGACCELFILES) $(EP93XXFILES) $(AT91RM9200FILES) $(GW16012FILES)
+EXTRA_DIST = startup.tcl
-noinst_HEADERS = bitbang.h jtag.h
+MAINTAINERCLEANFILES = $(srcdir)/Makefile.in