Convert to non-recursive make
[openocd.git] / src / jtag / Makefile.am
index 4ca0c78..50ee263 100644 (file)
@@ -1,58 +1,72 @@
-AM_CPPFLAGS = \
-       -I$(top_srcdir)/src \
-       -I$(top_srcdir)/src/helper \
-       -I$(top_srcdir)/src/target
+noinst_LTLIBRARIES += %D%/libjtag.la
 
-METASOURCES = AUTO
-noinst_LTLIBRARIES = libjtag.la
+JTAG_SRCS =
+%C%_libjtag_la_LIBADD =
 
-SUBDIRS =
-DRIVERFILES =
-libjtag_la_LIBADD =
+BUILT_SOURCES += %D%/minidriver_imp.h
+CLEANFILES += %D%/minidriver_imp.h
 
 if MINIDRIVER
 
-# for minidriver_imp.h
-AM_CPPFLAGS += -I$(srcdir)/minidriver
-
 if ZY1000
-DRIVERFILES += zy1000/zy1000.c
-AM_CPPFLAGS += -I$(srcdir)/zy1000
+JTAG_SRCS += %D%/zy1000/zy1000.c
+JTAG_MINIDRIVER_DIR = %D%/zy1000
 endif
 if MINIDRIVER_DUMMY
-DRIVERFILES += minidummy/minidummy.c commands.c
-AM_CPPFLAGS += -I$(srcdir)/minidummy
+JTAG_SRCS += %D%/minidummy/minidummy.c %D%/commands.c
+JTAG_MINIDRIVER_DIR = %D%/minidummy
 endif
 
+MINIDRIVER_IMP_DIR = %D%/minidriver
+
+%D%/jtag_minidriver.h: $(JTAG_MINIDRIVER_DIR)/jtag_minidriver.h
+       cp $< $@
+
+BUILT_SOURCES += %D%/jtag_minidriver.h
+
+CLEANFILES += %D%/jtag_minidriver.h
+
 else
 
-DRIVERFILES += commands.c
+MINIDRIVER_IMP_DIR = %D%/drivers
+JTAG_SRCS += %D%/commands.c
 
-SUBDIRS += drivers
-libjtag_la_LIBADD += $(top_builddir)/src/jtag/drivers/libocdjtagdrivers.la
+if HLADAPTER
+include %D%/hla/Makefile.am
+%C%_libjtag_la_LIBADD += $(top_builddir)/%D%/hla/libocdhla.la
+endif
 
-# for minidriver_imp.h
-AM_CPPFLAGS += -I$(srcdir)/drivers
+if AICE
+include %D%/aice/Makefile.am
+%C%_libjtag_la_LIBADD += $(top_builddir)/%D%/aice/libocdaice.la
+endif
+
+include %D%/drivers/Makefile.am
+%C%_libjtag_la_LIBADD += $(top_builddir)/%D%/drivers/libocdjtagdrivers.la
 
 endif
 # endif // MINIDRIVER
 
-libjtag_la_SOURCES = \
-       core.c \
-       interface.c \
-       interfaces.c \
-       tcl.c \
-       $(DRIVERFILES)
-
-noinst_HEADERS = \
-       commands.h \
-       interface.h \
-       interfaces.h \
-       minidriver.h \
-       jtag.h \
-       minidriver/minidriver_imp.h \
-       minidummy/jtag_minidriver.h
-
-EXTRA_DIST = startup.tcl
-
-MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
+%D%/minidriver_imp.h: $(MINIDRIVER_IMP_DIR)/minidriver_imp.h
+       cp $< $@
+
+
+%C%_libjtag_la_SOURCES = \
+       %D%/adapter.c \
+       %D%/core.c \
+       %D%/interface.c \
+       %D%/interfaces.c \
+       %D%/tcl.c \
+       %D%/commands.h \
+       %D%/driver.h \
+       %D%/interface.h \
+       %D%/interfaces.h \
+       %D%/minidriver.h \
+       %D%/jtag.h \
+       %D%/minidriver/minidriver_imp.h \
+       %D%/minidummy/jtag_minidriver.h \
+       %D%/swd.h \
+       %D%/tcl.h \
+       $(JTAG_SRCS)
+
+STARTUP_TCL_SRCS += %D%/startup.tcl