Makefile.am 2.23 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
openocd_LDADD = libopenocd.la

15
16
17
libopenocd_la_SOURCES = \
	hello.c \
	openocd.c
18
19

# set the include path found by configure
20
21
22
23
24
25
26
27
28
29
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
30

31
libopenocd_la_CPPFLAGS = -DPKGBLDDATE=\"`date +%F-%R`\"
kc8apf's avatar
kc8apf committed
32

33
34
# 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
35
if RELEASE
36
libopenocd_la_CPPFLAGS += -DRELSTR=\"\"
kc8apf's avatar
kc8apf committed
37
else
38
libopenocd_la_CPPFLAGS += -DRELSTR=\"`$(top_srcdir)/guess-rev.sh $(top_srcdir)`\"
kc8apf's avatar
kc8apf committed
39
40
41
endif

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

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

47
if IS_MINGW
Redirect 'Slash' NIL's avatar
Redirect 'Slash' NIL committed
48
MINGWLDADD = -lws2_32
49
50
51
52
else
MINGWLDADD =
endif

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

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

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

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

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

# 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.
#
104
# use at your own risk
105
106
quick: all install-binPROGRAMS