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