1c80ae8392144f0448ba0c228c3815e509df6d65
[lttng-tools.git] / tests / regression / ust / linking / Makefile.am
1 # -Wsystem-headers is needed to print warnings in the tracepoint
2 # description file.
3 AM_CPPFLAGS = -I$(srcdir) -I$(top_builddir)/include -Wsystem-headers
4
5 # Set LIBS to nothing so the application does not link on useless
6 # libraries.
7 LIBS =
8
9 # Build a version of the test app with built-in tracepoints
10 demo_builtin_SOURCES = demo.c tp.c tp2.c tp3.c ust_tests_demo.h \
11 ust_tests_demo2.h ust_tests_demo3.h
12 demo_builtin_LDADD = -llttng-ust
13 demo_builtin_CFLAGS = -Werror=old-style-definition
14
15 # Build a version statically linked to the providers
16 # contains ust_tests_demo.h and ust_tests_demo2.h provider probes
17 noinst_LTLIBRARIES = liblttng-ust-provider-ust-tests-demo-static.la \
18 liblttng-ust-provider-ust-tests-demo3-static.la
19
20 liblttng_ust_provider_ust_tests_demo_static_la_SOURCES = \
21 tp.c ust_tests_demo.h \
22 tp2.c ust_tests_demo2.h
23 liblttng_ust_provider_ust_tests_demo_static_la_LIBADD = \
24 -llttng-ust
25
26 # contains ust_tests_demo3.h provider probes
27 liblttng_ust_provider_ust_tests_demo3_static_la_SOURCES = \
28 tp3.c ust_tests_demo3.h
29 liblttng_ust_provider_ust_tests_demo3_static_la_LIBADD = \
30 -llttng-ust
31
32 demo_static_SOURCES = demo.c
33 demo_static_LDADD = liblttng-ust-provider-ust-tests-demo-static.la \
34 liblttng-ust-provider-ust-tests-demo3-static.la
35
36 if LTTNG_TOOLS_BUILD_WITH_LIBDL
37 demo_builtin_LDADD += -ldl
38 demo_static_LDADD += -ldl
39 endif
40 if LTTNG_TOOLS_BUILD_WITH_LIBC_DL
41 demo_builtin_LDADD += -lc
42 demo_static_LDADD += -lc
43 endif
44
45 noinst_PROGRAMS = demo_builtin demo_static
46
47 COPYSCRIPTS = test_linking test_linking.py demo_preload
48 noinst_SCRIPTS = $(COPYSCRIPTS)
49
50 if NO_SHARED
51
52 EXTRA_DIST = tp.c ust_tests_demo.h tp2.c ust_tests_demo2.h \
53 tp3.c ust_tests_demo3.h demo.c ust_tests_demo.h \
54 $(COPYSCRIPTS)
55
56 else
57 # Force the shared flag on the noinst libraries since they are
58 # only built static by default
59 FORCE_SHARED_LIB_OPTIONS = -module -shared -avoid-version \
60 -rpath $(abs_builddir)
61
62 noinst_LTLIBRARIES += liblttng-ust-provider-ust-tests-demo.la \
63 liblttng-ust-provider-ust-tests-demo3.la
64
65 #contains ust_tests_demo.h and ust_tests_demo2.h provider probes
66 liblttng_ust_provider_ust_tests_demo_la_SOURCES = \
67 tp.c ust_tests_demo.h \
68 tp2.c ust_tests_demo2.h
69 liblttng_ust_provider_ust_tests_demo_la_LIBADD = -llttng-ust
70 liblttng_ust_provider_ust_tests_demo_la_LDFLAGS = \
71 $(FORCE_SHARED_LIB_OPTIONS)
72
73 #contains ust_tests_demo3.h provider probes
74 liblttng_ust_provider_ust_tests_demo3_la_SOURCES = \
75 tp3.c ust_tests_demo3.h
76 liblttng_ust_provider_ust_tests_demo3_la_LIBADD = -llttng-ust
77 liblttng_ust_provider_ust_tests_demo3_la_LDFLAGS = \
78 $(FORCE_SHARED_LIB_OPTIONS)
79
80 noinst_PROGRAMS += demo
81 demo_SOURCES = demo.c ust_tests_demo.h
82 demo_CFLAGS = -DTEST_DYNAMIC_LINKAGE
83
84 if LTTNG_TOOLS_BUILD_WITH_LIBDL
85 demo_LDADD = -ldl
86 endif
87 if LTTNG_TOOLS_BUILD_WITH_LIBC_DL
88 demo_LDADD = -lc
89 endif
90
91 EXTRA_DIST = $(COPYSCRIPTS)
92
93 endif
94
95 all-local:
96 @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
97 for script in $(COPYSCRIPTS); do \
98 cp -f $(srcdir)/$$script $(builddir); \
99 done; \
100 fi
101
102 clean-local:
103 @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
104 for script in $(COPYSCRIPTS); do \
105 rm -f $(builddir)/$$script; \
106 done; \
107 fi
This page took 0.032412 seconds and 4 git commands to generate.