Makefile.am 1.81 KB
Newer Older
1
2
3
SUBDIRS = helper jtag xsvf svf target server flash pld

lib_LTLIBRARIES = libopenocd.la
4
bin_PROGRAMS = openocd
5
6

if ECOSBOARD
oharboe's avatar
oharboe committed
7
MAINFILE = ecosboard.c
8
else
9
MAINFILE = main.c
10
11
endif

12
13
14
15
openocd_SOURCES = $(MAINFILE) 
openocd_LDADD = libopenocd.la

libopenocd_la_SOURCES = openocd.c
16
17

# set the include path found by configure
18
19
20
21
22
23
24
25
26
27
AM_CPPFLAGS = \
	-I$(top_srcdir)/src \
	-I$(top_srcdir)/src/helper \
	-I$(top_srcdir)/src/jtag \
	-I$(top_srcdir)/src/target \
	-I$(top_srcdir)/src/xsvf \
	-I$(top_srcdir)/src/svf \
	-I$(top_srcdir)/src/server \
	-I$(top_srcdir)/src/flash \
	-I$(top_srcdir)/src/pld
28

29
# pass path to prefix path
30
libopenocd_la_CPPFLAGS = \
31
 -DPKGLIBDIR=\"$(pkglibdir)\" \
kc8apf's avatar
kc8apf committed
32
33
34
 -DPKGBLDDATE=\"`date +%F-%R`\"

if RELEASE
35
libopenocd_la_CPPFLAGS += -DRELSTR=\"Release\" -DPKGBLDREV=\"\"
kc8apf's avatar
kc8apf committed
36
else
37
libopenocd_la_CPPFLAGS += -DRELSTR=\"svn:\" -DPKGBLDREV=\"`$(top_srcdir)/guess-rev.sh $(top_srcdir)`\"
kc8apf's avatar
kc8apf committed
38
39
40
endif

# add default CPPFLAGS
41
libopenocd_la_CPPFLAGS += $(AM_CPPFLAGS) $(CPPFLAGS)
42

43
# the library search path.
44
libopenocd_la_LDFLAGS = $(all_libraries) 
45

46
47
48
49
50
51
if IS_MINGW
MINGWLDADD = -lwsock32
else
MINGWLDADD =
endif

52
if FT2232_LIBFTDI
53
FTDI2232LIB = -lftdi -lusb
54
else
55
if PRESTO_LIBFTDI
56
FTDI2232LIB = -lftdi -lusb
drath's avatar
drath committed
57
else
58
59
FTDI2232LIB =
endif
drath's avatar
drath committed
60
endif
61

62
63
64
if USBPROG
LIBUSB = -lusb
else
65
66
67
if JLINK
LIBUSB = -lusb
else
68
69
70
if RLINK
LIBUSB = -lusb
else
duane's avatar
duane committed
71
72
73
if VSLLINK
LIBUSB = -lusb
else
74
75
LIBUSB =
endif
76
endif
77
endif
duane's avatar
duane committed
78
endif
79

80
81
82
83
84
85
86
87
88
libopenocd_la_LIBADD = \
	$(top_builddir)/src/xsvf/libxsvf.la \
	$(top_builddir)/src/svf/libsvf.la \
	$(top_builddir)/src/pld/libpld.la \
	$(top_builddir)/src/jtag/libjtag.la \
	$(top_builddir)/src/flash/libflash.la \
	$(top_builddir)/src/target/libtarget.la \
	$(top_builddir)/src/server/libserver.la \
	$(top_builddir)/src/helper/libhelper.la \
89
	$(FTDI2232LIB) $(MINGWLDADD) $(LIBUSB)
oharboe's avatar
oharboe committed
90

91
if HTTPD
92
libopenocd_la_LIBADD += -lmicrohttpd
93
94
endif

95
MAINTAINERCLEANFILES = Makefile.in