Charles Hardin <ckhardin@gmail.com> - hopefully final word on startup.tcl => c conversion
[openocd.git] / src / Makefile.am
1 bin_PROGRAMS = openocd bin2char
2
3 bin2char_SOURCES = bin2char.c
4
5 if ECOSBOARD
6 MAINFILE = ecosboard.c
7 else
8 MAINFILE = main.c jim.c
9 endif
10
11 openocd_SOURCES = $(MAINFILE) openocd.c startup_tcl.c
12
13 # set the include path found by configure
14 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/src/helper \
15         -I$(top_srcdir)/src/jtag -I$(top_srcdir)/src/target -I$(top_srcdir)/src/xsvf -I$(top_srcdir)/src/server \
16         -I$(top_srcdir)/src/flash -I$(top_srcdir)/src/pld $(all_includes)
17
18 # pass path to prefix path
19 openocd_CPPFLAGS = \
20  -DPKGLIBDIR=\"$(pkglibdir)\" \
21  -DPKGBLDDATE=\"`date +%F-%R`\" \
22  -DPKGBLDREV=\"`$(top_srcdir)/guess-rev.sh`\" \
23  @CPPFLAGS@
24
25 # the library search path.
26 openocd_LDFLAGS = $(all_libraries) 
27 SUBDIRS = helper jtag xsvf target server flash pld
28
29 if IS_MINGW
30 MINGWLDADD = -lwsock32
31 else
32 MINGWLDADD =
33 endif
34
35 if FT2232_LIBFTDI
36 FTDI2232LIB = -lftdi -lusb
37 else
38 if PRESTO_LIBFTDI
39 FTDI2232LIB = -lftdi -lusb
40 else
41 FTDI2232LIB =
42 endif
43 endif
44
45 if USBPROG
46 LIBUSB = -lusb
47 else
48 if JLINK
49 LIBUSB = -lusb
50 else
51 LIBUSB =
52 endif
53 endif
54
55 if IS_WIN32
56 if FTD2XXDIR
57 FTD2XXLDADD = @WITH_FTD2XX@/FTD2XX.lib
58 else
59 FTD2XXLDADD = -lftd2xx
60 endif
61 else
62 FTD2XXLDADD = -lftd2xx 
63 endif
64   
65 if FT2232_FTD2XX
66 FTD2XXLIB = $(FTD2XXLDADD)
67 else
68 if PRESTO_FTD2XX
69 FTD2XXLIB = $(FTD2XXLDADD)
70 else
71 FTD2XXLIB =
72 endif
73 endif
74
75 openocd_LDADD = $(top_builddir)/src/xsvf/libxsvf.a \
76         $(top_builddir)/src/target/libtarget.a $(top_builddir)/src/jtag/libjtag.a \
77         $(top_builddir)/src/helper/libhelper.a \
78         $(top_builddir)/src/server/libserver.a $(top_builddir)/src/helper/libhelper.a \
79         $(top_builddir)/src/flash/libflash.a $(top_builddir)/src/target/libtarget.a \
80         $(top_builddir)/src/pld/libpld.a \
81         $(FTDI2232LIB) $(FTD2XXLIB) $(MINGWLDADD) $(LIBUSB)
82
83 nobase_dist_pkglib_DATA = \
84         tcl/bitsbytes.tcl  \
85         tcl/chip/atmel/at91/aic.tcl  \
86         tcl/chip/atmel/at91/at91sam7x128.tcl  \
87         tcl/chip/atmel/at91/at91sam7x256.tcl  \
88         tcl/chip/atmel/at91/pmc.tcl  \
89         tcl/chip/atmel/at91/rtt.tcl  \
90         tcl/chip/atmel/at91/usarts.tcl  \
91         tcl/cpu/arm/arm7tdmi.tcl  \
92         tcl/cpu/arm/arm920.tcl  \
93         tcl/cpu/arm/arm946.tcl  \
94         tcl/cpu/arm/arm966.tcl  \
95         tcl/memory.tcl  \
96         tcl/mmr_helpers.tcl  \
97         tcl/readable.tcl  
98
99 # Convert .tcl to cfile
100 startup_tcl.c: bin2char startup.tcl
101         ./bin2char startup_tcl < $(srcdir)/startup.tcl > startup_tcl.c