add src/hello.c to augment new command tutorial
[fw/openocd] / src / Makefile.am
1 SUBDIRS = helper jtag xsvf svf target server flash pld
2
3 lib_LTLIBRARIES = libopenocd.la
4 bin_PROGRAMS = openocd
5
6 if ECOSBOARD
7 MAINFILE = ecosboard.c
8 else
9 MAINFILE = main.c
10 endif
11
12 openocd_SOURCES = $(MAINFILE)
13 openocd_LDADD = libopenocd.la
14
15 libopenocd_la_SOURCES = \
16         hello.c \
17         openocd.c
18
19 # set the include path found by configure
20 AM_CPPFLAGS = \
21         -I$(top_srcdir)/src \
22         -I$(top_srcdir)/src/helper \
23         -I$(top_srcdir)/src/jtag \
24         -I$(top_srcdir)/src/target \
25         -I$(top_srcdir)/src/xsvf \
26         -I$(top_srcdir)/src/svf \
27         -I$(top_srcdir)/src/server \
28         -I$(top_srcdir)/src/flash \
29         -I$(top_srcdir)/src/pld
30
31 libopenocd_la_CPPFLAGS = -DPKGBLDDATE=\"`date +%F-%R`\"
32
33 # banner output includes RELSTR appended to $VERSION from the configure script
34 # guess-rev.sh returns either a repository version ID or "-snapshot"
35 if RELEASE
36 libopenocd_la_CPPFLAGS += -DRELSTR=\"\"
37 else
38 libopenocd_la_CPPFLAGS += -DRELSTR=\"`$(top_srcdir)/guess-rev.sh $(top_srcdir)`\"
39 endif
40
41 # 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
48 MINGWLDADD = -lws2_32
49 else
50 MINGWLDADD =
51 endif
52
53 if FT2232_LIBFTDI
54 FTDI2232LIB = -lftdi -lusb
55 else
56 if PRESTO_LIBFTDI
57 FTDI2232LIB = -lftdi -lusb
58 else
59 FTDI2232LIB =
60 endif
61 endif
62
63 if USBPROG
64 LIBUSB = -lusb
65 else
66 if JLINK
67 LIBUSB = -lusb
68 else
69 if RLINK
70 LIBUSB = -lusb
71 else
72 if VSLLINK
73 LIBUSB = -lusb
74 else
75 LIBUSB =
76 endif
77 endif
78 endif
79 endif
80
81 libopenocd_la_LIBADD = \
82         $(top_builddir)/src/xsvf/libxsvf.la \
83         $(top_builddir)/src/svf/libsvf.la \
84         $(top_builddir)/src/pld/libpld.la \
85         $(top_builddir)/src/jtag/libjtag.la \
86         $(top_builddir)/src/flash/libflash.la \
87         $(top_builddir)/src/target/libtarget.la \
88         $(top_builddir)/src/server/libserver.la \
89         $(top_builddir)/src/helper/libhelper.la \
90         $(FTDI2232LIB) $(MINGWLDADD) $(LIBUSB)
91
92 if HTTPD
93 libopenocd_la_LIBADD += -lmicrohttpd
94 endif
95
96 MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
97
98 # The "quick" target builds executables & reinstalls the executables
99 # Primary use: developer types to quicken the edit/compile/debug
100 # cycle.  by not requiring a "full build and full install". Note the
101 # assumption is: You are only rebuilding the EXE.... and everything
102 # else is/was previously installed.
103 #
104 # use at your own risk
105 quick: all install-binPROGRAMS
106