server/telnet: Restructure commands
[openocd.git] / src / Makefile.am
blob4d1c1a25098f329776d35f2fd645073e2d34bd44
1 # SPDX-License-Identifier: GPL-2.0-or-later
3 noinst_LTLIBRARIES += %D%/libopenocd.la
4 bin_PROGRAMS += %D%/openocd
6 %C%_openocd_SOURCES = \
7         %D%/main.c
9 %C%_libopenocd_la_SOURCES = \
10         %D%/hello.c %D%/hello.h \
11         %D%/openocd.c %D%/openocd.h
13 %C%_openocd_LDADD = %D%/libopenocd.la
15 %C%_openocd_LDADD += $(MINGWLDADD)
17 if INTERNAL_JIMTCL
18 %C%_openocd_LDADD += $(top_builddir)/jimtcl/libjim.a
19 else
20 if HAVE_JIMTCL_PKG_CONFIG
21 %C%_openocd_LDADD += $(JIMTCL_LIBS)
22 else
23 %C%_openocd_LDADD += -ljim
24 endif
25 endif
27 %C%_libopenocd_la_CPPFLAGS =
29 # banner output includes RELSTR appended to $VERSION from the configure script
30 # guess-rev.sh returns either a repository version ID or "-snapshot"
31 if RELEASE
32 %C%_libopenocd_la_CPPFLAGS += -DRELSTR=\"\"
33 %C%_libopenocd_la_CPPFLAGS += -DGITVERSION=\"\"
34 else
35 %C%_libopenocd_la_CPPFLAGS += -DRELSTR=\"`$(top_srcdir)/guess-rev.sh $(top_srcdir)`\"
36 %C%_libopenocd_la_CPPFLAGS += -DGITVERSION=\"`cd $(top_srcdir) && git describe`\"
37 %C%_libopenocd_la_CPPFLAGS += -DPKGBLDDATE=\"`date +%F-%R`\"
38 endif
40 # add default CPPFLAGS
41 %C%_libopenocd_la_CPPFLAGS += $(AM_CPPFLAGS) $(CPPFLAGS)
43 # the library search path.
44 %C%_libopenocd_la_LDFLAGS = $(all_libraries)
46 if IS_MINGW
47 MINGWLDADD = -lws2_32
48 else
49 MINGWLDADD =
50 endif
52 %C%_libopenocd_la_LIBADD = \
53         %D%/xsvf/libxsvf.la \
54         %D%/svf/libsvf.la \
55         %D%/pld/libpld.la \
56         %D%/jtag/libjtag.la \
57         %D%/transport/libtransport.la \
58         %D%/flash/libflash.la \
59         %D%/target/libtarget.la \
60         %D%/server/libserver.la \
61         %D%/rtos/librtos.la \
62         %D%/helper/libhelper.la \
63         %D%/rtt/librtt.la
65 BIN2C = $(srcdir)/%D%/helper/bin2char.sh
67 STARTUP_TCL_SRCS =
68 EXTRA_DIST += $(STARTUP_TCL_SRCS)
70 BUILT_SOURCES += %D%/startup_tcl.inc
72 # Convert .tcl to c-array
73 %D%/startup_tcl.inc: $(STARTUP_TCL_SRCS)
74         mkdir -p %D%
75         cat $^ | $(BIN2C) > $@ || { rm -f $@; false; }
77 # add generated files to make clean list
78 CLEANFILES += %D%/startup_tcl.inc
80 # we do not want generated file in the dist
81 #dist-hook:
82 #       rm -f $(distdir)/%D%/startup_tcl.inc
84 include %D%/helper/Makefile.am
85 include %D%/jtag/Makefile.am
86 include %D%/transport/Makefile.am
87 include %D%/xsvf/Makefile.am
88 include %D%/svf/Makefile.am
89 include %D%/target/Makefile.am
90 include %D%/rtos/Makefile.am
91 include %D%/server/Makefile.am
92 include %D%/flash/Makefile.am
93 include %D%/pld/Makefile.am
94 include %D%/rtt/Makefile.am