a49957948e269f12eee4c65008e161de576a4509
[openocd.git] / src / Makefile.am
1 bin_PROGRAMS = openocd
2
3 if ECOSBOARD
4 MAINFILE = ecosboard.c
5 else
6 MAINFILE = main.c
7 endif
8
9 openocd_SOURCES = $(MAINFILE) openocd.c
10
11 # set the include path found by configure
12 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/src/helper \
13         -I$(top_srcdir)/src/jtag -I$(top_srcdir)/src/target -I$(top_srcdir)/src/xsvf -I$(top_srcdir)/src/svf \
14         -I$(top_srcdir)/src/server -I$(top_srcdir)/src/flash -I$(top_srcdir)/src/pld $(all_includes)
15
16 # pass path to prefix path
17 openocd_CPPFLAGS = \
18  -DPKGLIBDIR=\"$(pkglibdir)\" \
19  -DPKGBLDDATE=\"`date +%F-%R`\"
20
21 if RELEASE
22 openocd_CPPFLAGS += -DRELSTR=\"Release\" -DPKGBLDREV=\"\"
23 else
24 openocd_CPPFLAGS += -DRELSTR=\"svn:\" -DPKGBLDREV=\"`$(top_srcdir)/guess-rev.sh $(top_srcdir)`\"
25 endif
26
27 # add default CPPFLAGS
28 openocd_CPPFLAGS += @CPPFLAGS@
29
30 # the library search path.
31 openocd_LDFLAGS = $(all_libraries) 
32 SUBDIRS = helper jtag xsvf svf target server flash pld
33
34 if IS_MINGW
35 MINGWLDADD = -lwsock32
36 else
37 MINGWLDADD =
38 endif
39
40 if FT2232_LIBFTDI
41 FTDI2232LIB = -lftdi -lusb
42 else
43 if PRESTO_LIBFTDI
44 FTDI2232LIB = -lftdi -lusb
45 else
46 FTDI2232LIB =
47 endif
48 endif
49
50 if USBPROG
51 LIBUSB = -lusb
52 else
53 if JLINK
54 LIBUSB = -lusb
55 else
56 if RLINK
57 LIBUSB = -lusb
58 else
59 if VSLLINK
60 LIBUSB = -lusb
61 else
62 LIBUSB =
63 endif
64 endif
65 endif
66 endif
67
68 openocd_LDADD = $(top_builddir)/src/xsvf/libxsvf.a $(top_builddir)/src/svf/libsvf.a \
69         $(top_builddir)/src/target/libtarget.a $(top_builddir)/src/jtag/libjtag.a \
70         $(top_builddir)/src/helper/libhelper.a \
71         $(top_builddir)/src/server/libserver.a $(top_builddir)/src/helper/libhelper.a \
72         $(top_builddir)/src/flash/libflash.a $(top_builddir)/src/target/libtarget.a \
73         $(top_builddir)/src/pld/libpld.a \
74         $(FTDI2232LIB) $(MINGWLDADD) $(LIBUSB)
75
76 if HTTPD
77 openocd_LDADD += -lmicrohttpd
78 endif
79
80 nobase_dist_pkglib_DATA = \
81         tcl/bitsbytes.tcl                       \
82         tcl/chip/atmel/at91/aic.tcl             \
83         tcl/chip/atmel/at91/at91sam7x128.tcl    \
84         tcl/chip/atmel/at91/at91sam7x256.tcl    \
85         tcl/chip/atmel/at91/pmc.tcl             \
86         tcl/chip/atmel/at91/rtt.tcl             \
87         tcl/chip/atmel/at91/usarts.tcl          \
88         tcl/chip/st/stm32/stm32.tcl             \
89         tcl/chip/st/stm32/stm32_rcc.tcl         \
90         tcl/chip/st/stm32/stm32_regs.tcl        \
91         tcl/cpu/arm/arm7tdmi.tcl                \
92         tcl/cpu/arm/arm920.tcl                  \
93         tcl/cpu/arm/arm946.tcl                  \
94         tcl/cpu/arm/arm966.tcl                  \
95         tcl/cpu/arm/cortex_m3.tcl               \
96         tcl/memory.tcl                          \
97         tcl/mmr_helpers.tcl                     \
98         tcl/readable.tcl
99
100 MAINTAINERCLEANFILES = Makefile.in