Makefile.am 2.22 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
openocd_SOURCES = $(MAINFILE)
13
14
15
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
libopenocd_la_CPPFLAGS = -DPKGBLDDATE=\"`date +%F-%R`\"
kc8apf's avatar
kc8apf committed
30

31
32
# banner output includes RELSTR appended to $VERSION from the configure script
# guess-rev.sh returns either a repository version ID or "-snapshot"
kc8apf's avatar
kc8apf committed
33
if RELEASE
34
libopenocd_la_CPPFLAGS += -DRELSTR=\"\"
kc8apf's avatar
kc8apf committed
35
else
36
libopenocd_la_CPPFLAGS += -DRELSTR=\"`$(top_srcdir)/guess-rev.sh $(top_srcdir)`\"
kc8apf's avatar
kc8apf committed
37
38
39
endif

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

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

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

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

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

79
80
81
82
83
84
85
86
87
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 \
88
	$(FTDI2232LIB) $(MINGWLDADD) $(LIBUSB)
oharboe's avatar
oharboe committed
89

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

94
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
95
96
97
98
99
100
101

# The "quick" target builds executables & reinstalls the executables
# Primary use: developer types to quicken the edit/compile/debug
# cycle.  by not requiring a "full build and full install". Note the
# assumption is: You are only rebuilding the EXE.... and everything
# else is/was previously installed.
#
102
# use at your own risk
103
104
quick: all install-binPROGRAMS