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