Makefile.am 2.12 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

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

# add default CPPFLAGS
38
libopenocd_la_CPPFLAGS += $(AM_CPPFLAGS) $(CPPFLAGS)
39

40
# the library search path.
41
libopenocd_la_LDFLAGS = $(all_libraries)
42

43
44
45
46
47
48
if IS_MINGW
MINGWLDADD = -lwsock32
else
MINGWLDADD =
endif

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

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

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

88
if HTTPD
89
libopenocd_la_LIBADD += -lmicrohttpd
90
91
endif

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

# 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.
#
100
# use at your own risk
101
102
quick: all install-binPROGRAMS