Makefile.am 2.8 KB
Newer Older
Spencer Oliver's avatar
Spencer Oliver committed
1
2
include $(top_srcdir)/common.mk

3
4
SUBDIRS = \
	jtag \
5
	helper \
6
7
8
9
10
	target \
	flash \
	svf \
	xsvf \
	pld \
11
12
	server \
	rtos
13
14

lib_LTLIBRARIES = libopenocd.la
15
bin_PROGRAMS = openocd
16
17

if ECOSBOARD
oharboe's avatar
oharboe committed
18
MAINFILE = ecosboard.c
19
else
20
MAINFILE = main.c
21
22
endif

23
openocd_SOURCES = $(MAINFILE)
24
25
26
27
28
29
30
openocd_LDADD = libopenocd.la

if INTERNAL_JIMTCL
openocd_LDADD += $(top_builddir)/jimtcl/libjim.a
else
openocd_LDADD += -ljim
endif
31

32
33
libopenocd_la_SOURCES = \
	hello.c \
Zachary T Welch's avatar
Zachary T Welch committed
34
35
	openocd.c \
	startup_tcl.c
36

37
noinst_HEADERS = \
38
	hello.h \
39
40
	openocd.h

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

43
44
# 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
45
if RELEASE
46
libopenocd_la_CPPFLAGS += -DRELSTR=\"\"
kc8apf's avatar
kc8apf committed
47
else
48
libopenocd_la_CPPFLAGS += -DRELSTR=\"`$(top_srcdir)/guess-rev.sh $(top_srcdir)`\"
kc8apf's avatar
kc8apf committed
49
endif
50
libopenocd_la_CPPFLAGS += -DGITVERSION=\"`cd $(top_srcdir) && git describe`\"
kc8apf's avatar
kc8apf committed
51
52

# add default CPPFLAGS
53
libopenocd_la_CPPFLAGS += $(AM_CPPFLAGS) $(CPPFLAGS)
54

55
# the library search path.
56
libopenocd_la_LDFLAGS = $(all_libraries)
57

58
if IS_MINGW
Redirect 'Slash' NIL's avatar
Redirect 'Slash' NIL committed
59
MINGWLDADD = -lws2_32
60
61
62
63
else
MINGWLDADD =
endif

64
if FT2232_LIBFTDI
65
FTDI2232LIB = -lftdi -lusb
66
else
67
68
69
if USB_BLASTER_LIBFTDI
FTDI2232LIB = -lftdi -lusb
else
70
if PRESTO_LIBFTDI
71
FTDI2232LIB = -lftdi -lusb
drath's avatar
drath committed
72
else
73
74
FTDI2232LIB =
endif
drath's avatar
drath committed
75
endif
76
endif
77

78
79
80
if USBPROG
LIBUSB = -lusb
else
81
82
83
if JLINK
LIBUSB = -lusb
else
84
85
86
if RLINK
LIBUSB = -lusb
else
duane's avatar
duane committed
87
88
89
if VSLLINK
LIBUSB = -lusb
else
90
91
LIBUSB =
endif
92
endif
93
endif
duane's avatar
duane committed
94
endif
95

96
97
98
99
100
101
102
103
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 \
104
	$(top_builddir)/src/rtos/librtos.la \
105
	$(top_builddir)/src/helper/libhelper.la \
106
	$(FTDI2232LIB) $(MINGWLDADD) $(LIBUSB)
oharboe's avatar
oharboe committed
107

Zachary T Welch's avatar
Zachary T Welch committed
108
STARTUP_TCL_SRCS = \
109
110
111
112
113
	$(srcdir)/helper/startup.tcl \
	$(srcdir)/jtag/startup.tcl \
	$(srcdir)/target/startup.tcl \
	$(srcdir)/flash/startup.tcl \
	$(srcdir)/server/startup.tcl
Zachary T Welch's avatar
Zachary T Welch committed
114
115
116
117
118
119
120
121

EXTRA_DIST = $(STARTUP_TCL_SRCS)

BUILT_SOURCES = startup.tcl

startup.tcl: $(STARTUP_TCL_SRCS)
	cat $^ > $@

122
BIN2C = $(top_builddir)/src/helper/bin2char$(EXEEXT_FOR_BUILD)
Zachary T Welch's avatar
Zachary T Welch committed
123
124
125

# Convert .tcl to cfile
startup_tcl.c: startup.tcl $(BIN2C)
126
	$(BIN2C) openocd_startup_tcl < $< > $@ || rm -f $@
Zachary T Welch's avatar
Zachary T Welch committed
127
128
129
130
131

# add startup_tcl.c to make clean list
CLEANFILES = startup.tcl startup_tcl.c


132
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
133
134
135
136
137
138
139

# 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.
#
140
# use at your own risk
141
142
quick: all install-binPROGRAMS