tap-driver.sh: flush stdout after each test result
[babeltrace.git] / cli / Makefile.am
CommitLineData
5a3ee633 1PLUGINS_PATH = $(abs_top_builddir)/plugins
c3ddb532
PP
2LTTNG_UTILS_PLUGIN_PATH =
3
4if ENABLE_DEBUG_INFO
5LTTNG_UTILS_PLUGIN_PATH += :$(PLUGINS_PATH)/lttng-utils
6endif
7
52238017
MJ
8if BABELTRACE_BUILD_WITH_MINGW
9IN_TREE_PLUGIN_PATH := $(shell cygpath -pm "$(PLUGINS_PATH)/ctf:$(PLUGINS_PATH)/text:$(PLUGINS_PATH)/utils$(LTTNG_UTILS_PLUGIN_PATH)")
10else
c3ddb532 11IN_TREE_PLUGIN_PATH = $(PLUGINS_PATH)/ctf:$(PLUGINS_PATH)/text:$(PLUGINS_PATH)/utils$(LTTNG_UTILS_PLUGIN_PATH)
52238017 12endif
c3ddb532 13
05c03100 14AM_CPPFLAGS += '-DCONFIG_IN_TREE_PLUGIN_PATH="$(IN_TREE_PLUGIN_PATH)"'
4c8bfb7e 15
ec2c5e50
MJ
16bin_PROGRAMS = babeltrace2.bin babeltrace2-log.bin
17noinst_PROGRAMS = babeltrace2 babeltrace2-log
4c8bfb7e 18
ec2c5e50
MJ
19babeltrace2_bin_SOURCES = \
20 babeltrace2.c \
21 babeltrace2-cfg.c \
22 babeltrace2-cfg.h \
23 babeltrace2-cfg-cli-args.c \
24 babeltrace2-cfg-cli-args.h \
25 babeltrace2-cfg-cli-args-connect.c \
26 babeltrace2-cfg-cli-args-connect.h \
27 babeltrace2-cfg-cli-args-default.h \
28 babeltrace2-cfg-cli-args-default.c \
ea9f8b29 29 logging.c logging.h
847bf71a 30
e7c058b4
MD
31# -Wl,--no-as-needed is needed for recent gold linker who seems to think
32# it knows better and considers libraries with constructors having
30827463 33# side-effects as dead code.
ec2c5e50 34babeltrace2_bin_LDFLAGS = $(LD_NO_AS_NEEDED)
c3ddb532
PP
35
36# Add all the convenience libraries used by Babeltrace plugins and the
9ffc0257 37# library. They will be used when embedding plugins (--enable-built-in-plugins),
c3ddb532
PP
38# otherwise we're looking after multiple definitions of the same symbols if
39# a plugin's archive (.a) includes the convenience library because
40# we're using --whole-archive below (needed to make sure the linker does
41# not discard the plugins since the CLI does not use their symbols
42# directly).
ec2c5e50 43babeltrace2_bin_LDADD = \
a12f3d62 44 $(top_builddir)/lib/libbabeltrace2.la \
9d1e7de0 45 $(top_builddir)/compat/libcompat.la \
a12f3d62
MJ
46 $(top_builddir)/common/libbabeltrace2-common.la \
47 $(top_builddir)/logging/libbabeltrace2-logging.la \
4817cd5b 48 $(POPT_LIBS)
1e3d1cee 49
9ffc0257 50if ENABLE_BUILT_IN_PLUGINS
c3ddb532
PP
51# Takes a plugin name and outputs the needed LDFLAGS to embed it.
52#
53# The --whole-archive option is important here. From the GNU linker's
54# documentation:
55#
56# For each archive mentioned on the command line after the
57# --whole-archive option, include every object file in the archive in
58# the link, rather than searching the archive for the required object
59# files.
60#
61# In our case, we find the plugins thanks to special sections in the
62# binary that are filled by plugin objects. If the linker discards those
63# symbols because the CLI does not use them directly, the CLI reports
64# no plugins found (plugins are effectively not embedded).
1244e794 65pluginarchive = $(LD_WHOLE_ARCHIVE)$(PLUGINS_PATH)/$(1)/.libs/babeltrace-plugin-$(1).a$(LD_NO_WHOLE_ARCHIVE)
c3ddb532
PP
66
67# Built-in plugins
ec2c5e50
MJ
68babeltrace2_bin_LDFLAGS += $(call pluginarchive,ctf)
69babeltrace2_bin_LDFLAGS += $(call pluginarchive,text)
70babeltrace2_bin_LDFLAGS += $(call pluginarchive,utils)
c3ddb532
PP
71
72if ENABLE_DEBUG_INFO
ec2c5e50
MJ
73babeltrace2_bin_LDFLAGS += $(call pluginarchive,lttng-utils)
74babeltrace2_bin_LDADD += $(ELFUTILS_LIBS)
c3ddb532 75endif
cba174d5
JG
76endif
77
58819898 78if BABELTRACE_BUILD_WITH_MINGW
ec2c5e50 79babeltrace2_bin_LDADD += -lws2_32 -lrpcrt4 -lintl -liconv -lole32 -lpthread
58819898 80endif
b545080b 81
c1870f57 82# Only used for in-tree execution and tests
ec2c5e50
MJ
83babeltrace2_SOURCES = $(babeltrace2_bin_SOURCES)
84babeltrace2_LDFLAGS = $(babeltrace2_bin_LDFLAGS)
85babeltrace2_LDADD = $(babeltrace2_bin_LDADD)
86babeltrace2_CFLAGS = $(AM_CFLAGS) -DBT_SET_DEFAULT_IN_TREE_CONFIGURATION
899a1d74 87
ec2c5e50
MJ
88# babeltrace2-log rules and config below
89babeltrace2_log_bin_SOURCES = babeltrace2-log.c
90babeltrace2_log_bin_LDADD = \
4817cd5b 91 $(top_builddir)/compat/libcompat.la \
a12f3d62
MJ
92 $(top_builddir)/common/libbabeltrace2-common.la \
93 $(top_builddir)/logging/libbabeltrace2-logging.la \
4817cd5b 94 $(POPT_LIBS)
ec2c5e50 95babeltrace2_log_bin_CFLAGS = $(AM_CFLAGS) '-DBT_CLI_PATH="$(abs_top_builddir)/cli/babeltrace2$(EXEEXT)"'
899a1d74 96
4817cd5b 97# Only used for in-tree execution and tests
ec2c5e50
MJ
98babeltrace2_log_SOURCES = $(babeltrace2_log_bin_SOURCES)
99babeltrace2_log_LDADD = $(babeltrace2_log_bin_LDADD)
100babeltrace2_log_CFLAGS = $(AM_CFLAGS) '-DBT_CLI_PATH="$(bindir)/babeltrace2$(EXEEXT)"'
This page took 0.054528 seconds and 4 git commands to generate.