Commit | Line | Data |
---|---|---|
9d16b343 MJ |
1 | # SPDX-License-Identifier: GPL-2.0-only |
2 | ||
91c75285 JG |
3 | # -Wsystem-headers is needed to print warnings in the tracepoint |
4 | # description file. | |
411b3154 SM |
5 | # |
6 | # However, we see some -Wformat-nonliteral warnings in some system headers, | |
7 | # so disable that. | |
8 | AM_CPPFLAGS += -I$(srcdir) -Wsystem-headers -Wno-format-nonliteral | |
91c75285 | 9 | |
19708280 MJ |
10 | # Disable some warnings flags to accomodate the tracepoint headers |
11 | AM_CFLAGS += \ | |
12 | -Wno-redundant-decls | |
13 | ||
91c75285 JG |
14 | # Set LIBS to nothing so the application does not link on useless |
15 | # libraries. | |
16 | LIBS = | |
17 | ||
18 | # Build a version of the test app with built-in tracepoints | |
19 | demo_builtin_SOURCES = demo.c tp.c tp2.c tp3.c ust_tests_demo.h \ | |
20 | ust_tests_demo2.h ust_tests_demo3.h | |
20dd2de1 | 21 | demo_builtin_LDADD = $(UST_LIBS) $(DL_LIBS) |
343af227 | 22 | demo_builtin_CFLAGS = -Werror=old-style-definition $(AM_CFLAGS) |
91c75285 JG |
23 | |
24 | # Build a version statically linked to the providers | |
25 | # contains ust_tests_demo.h and ust_tests_demo2.h provider probes | |
26 | noinst_LTLIBRARIES = liblttng-ust-provider-ust-tests-demo-static.la \ | |
27 | liblttng-ust-provider-ust-tests-demo3-static.la | |
28 | ||
29 | liblttng_ust_provider_ust_tests_demo_static_la_SOURCES = \ | |
30 | tp.c ust_tests_demo.h \ | |
31 | tp2.c ust_tests_demo2.h | |
32 | liblttng_ust_provider_ust_tests_demo_static_la_LIBADD = \ | |
20dd2de1 | 33 | $(UST_LIBS) |
91c75285 JG |
34 | |
35 | # contains ust_tests_demo3.h provider probes | |
36 | liblttng_ust_provider_ust_tests_demo3_static_la_SOURCES = \ | |
37 | tp3.c ust_tests_demo3.h | |
38 | liblttng_ust_provider_ust_tests_demo3_static_la_LIBADD = \ | |
20dd2de1 | 39 | $(UST_LIBS) |
91c75285 JG |
40 | |
41 | demo_static_SOURCES = demo.c | |
42 | demo_static_LDADD = liblttng-ust-provider-ust-tests-demo-static.la \ | |
b1c46f87 MJ |
43 | liblttng-ust-provider-ust-tests-demo3-static.la \ |
44 | $(DL_LIBS) | |
91c75285 JG |
45 | |
46 | noinst_PROGRAMS = demo_builtin demo_static | |
47 | ||
cdbfb1b9 MD |
48 | COPYSCRIPTS = test_linking test_linking.py demo_preload |
49 | noinst_SCRIPTS = $(COPYSCRIPTS) | |
50 | ||
51 | if NO_SHARED | |
52 | ||
53 | EXTRA_DIST = tp.c ust_tests_demo.h tp2.c ust_tests_demo2.h \ | |
54 | tp3.c ust_tests_demo3.h demo.c ust_tests_demo.h \ | |
55 | $(COPYSCRIPTS) | |
56 | ||
57 | else | |
91c75285 JG |
58 | # Force the shared flag on the noinst libraries since they are |
59 | # only built static by default | |
60 | FORCE_SHARED_LIB_OPTIONS = -module -shared -avoid-version \ | |
61 | -rpath $(abs_builddir) | |
62 | ||
63 | noinst_LTLIBRARIES += liblttng-ust-provider-ust-tests-demo.la \ | |
64 | liblttng-ust-provider-ust-tests-demo3.la | |
65 | ||
66 | #contains ust_tests_demo.h and ust_tests_demo2.h provider probes | |
67 | liblttng_ust_provider_ust_tests_demo_la_SOURCES = \ | |
68 | tp.c ust_tests_demo.h \ | |
69 | tp2.c ust_tests_demo2.h | |
20dd2de1 | 70 | liblttng_ust_provider_ust_tests_demo_la_LIBADD = $(UST_LIBS) |
91c75285 JG |
71 | liblttng_ust_provider_ust_tests_demo_la_LDFLAGS = \ |
72 | $(FORCE_SHARED_LIB_OPTIONS) | |
73 | ||
74 | #contains ust_tests_demo3.h provider probes | |
75 | liblttng_ust_provider_ust_tests_demo3_la_SOURCES = \ | |
76 | tp3.c ust_tests_demo3.h | |
20dd2de1 | 77 | liblttng_ust_provider_ust_tests_demo3_la_LIBADD = $(UST_LIBS) |
91c75285 JG |
78 | liblttng_ust_provider_ust_tests_demo3_la_LDFLAGS = \ |
79 | $(FORCE_SHARED_LIB_OPTIONS) | |
80 | ||
81 | noinst_PROGRAMS += demo | |
82 | demo_SOURCES = demo.c ust_tests_demo.h | |
343af227 | 83 | demo_CFLAGS = -DTEST_DYNAMIC_LINKAGE $(AM_CFLAGS) |
b1c46f87 | 84 | demo_LDADD = $(DL_LIBS) |
91c75285 | 85 | |
cdbfb1b9 | 86 | EXTRA_DIST = $(COPYSCRIPTS) |
91c75285 | 87 | |
cdbfb1b9 | 88 | endif |
c83e7ca0 DG |
89 | |
90 | all-local: | |
91 | @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ | |
cdbfb1b9 | 92 | for script in $(COPYSCRIPTS); do \ |
c83e7ca0 DG |
93 | cp -f $(srcdir)/$$script $(builddir); \ |
94 | done; \ | |
95 | fi | |
96 | ||
97 | clean-local: | |
98 | @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ | |
cdbfb1b9 | 99 | for script in $(COPYSCRIPTS); do \ |
c83e7ca0 DG |
100 | rm -f $(builddir)/$$script; \ |
101 | done; \ | |
102 | fi |