Move all sources to 'src/'
[lttng-ust.git] / doc / examples / Makefile.am
CommitLineData
c0c0989a
MJ
1# SPDX-License-Identifier: LGPL-2.1-only
2
a106a9f8 3doc_examplesdir = ${docdir}/examples
7ccf75d3
MD
4doc_examples_easy_ustdir = ${docdir}/examples/easy-ust
5doc_examples_gen_tpdir = ${docdir}/examples/gen-tp
60302adc 6doc_examples_demodir = ${docdir}/examples/demo
a106a9f8 7doc_examples_hello_static_libdir = ${docdir}/examples/hello-static-lib
af9f5e3c 8doc_examples_demo_tracefdir = ${docdir}/examples/demo-tracef
eb8246a0 9doc_examples_demo_tracelogdir = ${docdir}/examples/demo-tracelog
f9364363 10doc_examples_clock_overridedir = ${docdir}/examples/clock-override
5e1b7b8b 11doc_examples_getcpu_overridedir = ${docdir}/examples/getcpu-override
5f836e39 12doc_examples_cmakedir = ${docdir}/examples/cmake-multiple-shared-libraries
a106a9f8 13
41ad81d8 14if ENABLE_JAVA_AGENT_WITH_JUL
849202d4
DG
15doc_examples_java_juldir = ${docdir}/examples/java-jul
16dist_doc_examples_java_jul_DATA = java-jul/Makefile \
501f6777 17 java-jul/Hello.java \
7b250cea 18 java-jul/run \
cf6634ba 19 java-jul/ApplicationContextExample.java \
7b250cea
MD
20 java-jul/FilterChangeListenerExample.java \
21 java-jul/README
849202d4 22SUBDIRS_JUL = java-jul
849202d4
DG
23endif
24
41ad81d8 25if ENABLE_JAVA_AGENT_WITH_LOG4J
be347eb9
MJ
26doc_examples_java_log4jdir = ${docdir}/examples/java-log4j
27dist_doc_examples_java_log4j_DATA = java-log4j/Makefile \
28 java-log4j/Hello.java \
29 java-log4j/run
30SUBDIRS_LOG4J = java-log4j
31endif
32
41ad81d8 33if ENABLE_PYTHON_AGENT
37258731
PP
34doc_examples_pythondir = ${docdir}/examples/python
35dist_doc_examples_python_DATA = python/hello.py
36endif
37
5f836e39 38if HAVE_CMAKE
41ad81d8 39if HAVE_CXX
5f836e39
SB
40SUBDIRS_CMAKE = cmake-multiple-shared-libraries
41endif
42endif
43
a106a9f8 44dist_doc_examples_DATA = README
7ccf75d3
MD
45
46dist_doc_examples_easy_ust_DATA = easy-ust/Makefile \
47 easy-ust/sample.c \
48 easy-ust/sample_component_provider.h easy-ust/tp.c
49
5f836e39
SB
50dist_doc_examples_cmake_DATA = \
51 cmake-multiple-shared-libraries/CMakeLists.txt \
52 cmake-multiple-shared-libraries/cmake/FindLTTngUST.cmake \
53 cmake-multiple-shared-libraries/aligner.cpp \
54 cmake-multiple-shared-libraries/aligner-lib.cpp \
55 cmake-multiple-shared-libraries/aligner-lib.h \
56 cmake-multiple-shared-libraries/README.md \
57 cmake-multiple-shared-libraries/tester.cpp \
58 cmake-multiple-shared-libraries/tester-lib.cpp \
59 cmake-multiple-shared-libraries/tester-lib.h \
60 cmake-multiple-shared-libraries/tracepoint-provider.cpp \
61 cmake-multiple-shared-libraries/tracepoint-provider.h \
62 cmake-multiple-shared-libraries/trace.sh
63
7ccf75d3
MD
64dist_doc_examples_gen_tp_DATA = gen-tp/Makefile \
65 gen-tp/sample.c gen-tp/sample_tracepoint.tp
60302adc
JG
66
67dist_doc_examples_demo_DATA = demo/demo.c \
68 demo/demo-trace \
69 demo/Makefile \
70 demo/README \
71 demo/tp2.c \
72 demo/tp3.c \
73 demo/tp.c \
74 demo/ust_tests_demo2.h \
75 demo/ust_tests_demo3.h \
76 demo/ust_tests_demo.h
a106a9f8
JG
77
78dist_doc_examples_hello_static_lib_DATA = hello-static-lib/Makefile \
79 hello-static-lib/hello.c \
80 hello-static-lib/README \
81 hello-static-lib/ust_tests_hello.h \
82 hello-static-lib/tp.c
83
af9f5e3c
MD
84dist_doc_examples_demo_tracef_DATA = demo-tracef/Makefile \
85 demo-tracef/demo-tracef.c \
43eeccf8 86 demo-tracef/demo-vtracef.c \
af9f5e3c
MD
87 demo-tracef/README
88
eb8246a0
MD
89dist_doc_examples_demo_tracelog_DATA = demo-tracelog/Makefile \
90 demo-tracelog/demo-tracelog.c \
c7193abd 91 demo-tracelog/demo-vtracelog.c \
eb8246a0
MD
92 demo-tracelog/README
93
f9364363
MD
94dist_doc_examples_clock_override_DATA = clock-override/Makefile \
95 clock-override/lttng-ust-clock-override-example.c \
96 clock-override/run-clock-override \
97 clock-override/README
98
5e1b7b8b
MD
99dist_doc_examples_getcpu_override_DATA = getcpu-override/Makefile \
100 getcpu-override/lttng-ust-getcpu-override-example.c \
101 getcpu-override/run-getcpu-override \
102 getcpu-override/README
103
92414a62 104# Copies are for VPATH build support
5e1b7b8b 105SUBDIRS_PROXY = easy-ust demo hello-static-lib demo-tracef clock-override \
eb8246a0 106 getcpu-override demo-tracelog
2b90f1d3 107
41ad81d8 108if ENABLE_GEN_TP_EXAMPLES
2b90f1d3
JG
109SUBDIRS_PROXY += gen-tp
110endif
92414a62
MD
111
112all-local:
dc5af9e3 113 $(AM_V_at)if [ x"$(srcdir)" != x"$(builddir)" ]; then \
5f836e39 114 for subdir in $(SUBDIRS_PROXY) $(SUBDIRS_JUL) $(SUBDIRS_LOG4J) $(SUBDIRS_CMAKE); do \
a41cceb9 115 cp -pfR $(srcdir)/$$subdir $(builddir); \
c8ab8d34 116 chmod -R u+w $(builddir)/$$subdir; \
92414a62 117 done; \
0faf99b8
MD
118 fi; \
119 if [ x"$(shell echo "$(top_srcdir)" | grep "^/" | wc -l)" = x"1" ]; then \
0faf99b8
MD
120 rel_src_subdir=""; \
121 else \
0faf99b8
MD
122 rel_src_subdir="../"; \
123 fi; \
124 if [ x"$(shell echo "$(top_builddir)" | grep "^/" | wc -l)" = x"1" ]; then \
0faf99b8
MD
125 rel_build_subdir=""; \
126 else \
0faf99b8
MD
127 rel_build_subdir="../"; \
128 fi; \
92414a62 129 for subdir in $(SUBDIRS_PROXY); do \
54435b75
SM
130 ( \
131 cd $$subdir && \
132 $(MAKE) all \
133 AR="$(AR)" \
134 CC="$(CC)" \
a4e2c093 135 PYTHON="$(PYTHON)" \
54435b75
SM
136 CPPFLAGS="$(CPPFLAGS)" \
137 AM_CPPFLAGS="$(AM_CPPFLAGS) \
138 -I$$rel_src_subdir$(top_srcdir)/include/ \
139 -I$$rel_build_subdir$(top_builddir)/include/" \
140 CFLAGS='$(CFLAGS)' \
141 AM_CFLAGS='$(AM_CFLAGS)' \
142 LDFLAGS="$(LDFLAGS)" \
9d4c8b2d 143 AM_LDFLAGS='$(AM_LDFLAGS) -L../../../src/liblttng-ust/.libs -Wl,-rpath="$(PWD)/../../src/liblttng-ust/.libs/" -Wl,-rpath-link="$(PWD)/../../src/liblttng-ust/.libs/"' \
7433d32d 144 LTTNG_GEN_TP_PATH="$$rel_src_subdir$(top_srcdir)/tools/" \
54435b75
SM
145 AM_V_P="$(AM_V_P)" \
146 AM_V_at="$(AM_V_at)" \
147 $(AM_MAKEFLAGS) \
148 ) || exit 1; \
0faf99b8
MD
149 done; \
150 if [ x"$(SUBDIRS_JUL)" != x"" ]; then \
849202d4 151 for subdir in $(SUBDIRS_JUL); do \
54435b75
SM
152 ( \
153 cd $$subdir && \
154 $(MAKE) all \
b1035e61 155 CLASSPATH="$(CLASSPATH)" \
9d4c8b2d
MJ
156 JAVA_CLASSPATH_OVERRIDE_JUL="../../../src/liblttng-ust-java-agent/java/lttng-ust-agent-jul" \
157 JAVA_CLASSPATH_OVERRIDE_COMMON="../../../src/liblttng-ust-java-agent/java/lttng-ust-agent-common" \
b6b4fee0 158 $(AM_MAKEFLAGS) \
54435b75 159 ) || exit 1; \
849202d4 160 done; \
be347eb9
MJ
161 fi; \
162 if [ x"$(SUBDIRS_LOG4J)" != x"" ]; then \
163 for subdir in $(SUBDIRS_LOG4J); do \
54435b75
SM
164 ( \
165 cd $$subdir && \
166 $(MAKE) all \
b1035e61 167 CLASSPATH="$(CLASSPATH)" \
9d4c8b2d
MJ
168 JAVA_CLASSPATH_OVERRIDE_LOG4J="../../../src/liblttng-ust-java-agent/java/lttng-ust-agent-log4j" \
169 JAVA_CLASSPATH_OVERRIDE_COMMON="../../../src/liblttng-ust-java-agent/java/lttng-ust-agent-common" \
54435b75
SM
170 $(AM_MAKEFLAGS) \
171 ) || exit 1; \
be347eb9 172 done; \
e5b701c8 173 fi; \
5f836e39
SB
174 if [ x"$(SUBDIRS_CMAKE)" != x"" ]; then \
175 for subdir in $(SUBDIRS_CMAKE); do \
068160b1 176 ( \
e5b701c8 177 cd $$subdir && \
4c70c05c 178 $(MKDIR_P) build && \
068160b1 179 cd build && \
8aeb3cae 180 AR="$(AR)" \
54435b75
SM
181 CC="$(CC)" \
182 CXX="$(CXX)" \
d41d33d0 183 $(CMAKE) \
54435b75 184 -DCMAKE_INCLUDE_PATH="$(abs_top_srcdir)/include;$(abs_top_builddir)/include" \
9d4c8b2d 185 -DCMAKE_LIBRARY_PATH="$(abs_top_builddir)/src/liblttng-ust/.libs" \
fb54defd
MJ
186 -DCMAKE_C_FLAGS="$(AM_CFLAGS) $(CPPFLAGS) $(CFLAGS)" \
187 -DCMAKE_CXX_FLAGS="$(AM_CXXFLAGS) $(CXXFLAGS) $(CPPFLAGS)" \
54435b75
SM
188 -DCMAKE_EXE_LINKER_FLAGS="$(AM_LDFLAGS) $(LDFLAGS)" \
189 .. && \
190 $(MAKE) \
068160b1 191 ) || exit 1; \
5f836e39
SB
192 done; \
193 fi;
194
92414a62
MD
195
196clean-local:
dc5af9e3 197 $(AM_V_at)for subdir in $(SUBDIRS_PROXY); do \
0faf99b8 198 if [ -d $$subdir ]; then \
849202d4 199 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) clean && cd ..) || exit 1; \
0faf99b8
MD
200 fi; \
201 done; \
202 if [ x"$(SUBDIRS_JUL)" != x"" ]; then \
203 for subdir in $(SUBDIRS_JUL); do \
204 if [ -d $$subdir ]; then \
205 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) clean && cd ..) || exit 1; \
206 fi; \
849202d4 207 done; \
0faf99b8 208 fi; \
be347eb9
MJ
209 if [ x"$(SUBDIRS_LOG4J)" != x"" ]; then \
210 for subdir in $(SUBDIRS_LOG4J); do \
211 if [ -d $$subdir ]; then \
212 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) clean && cd ..) || exit 1; \
213 fi; \
214 done; \
215 fi; \
5f836e39
SB
216 if [ x"$(SUBDIRS_CMAKE)" != x"" ]; then \
217 for subdir in $(SUBDIRS_CMAKE); do \
218 if [ -d $$subdir ]; then \
219 (cd $$subdir && rm -rf build && cd ..) || exit 1; \
220 fi; \
221 done; \
222 fi; \
0faf99b8 223 if [ x"$(srcdir)" != x"$(builddir)" ]; then \
5f836e39 224 for subdir in $(SUBDIRS_PROXY) $(SUBDIRS_JUL) $(SUBDIRS_LOG4J) $(SUBDIRS_CMAKE); do \
92414a62
MD
225 rm -rf $(builddir)/$$subdir; \
226 done; \
0faf99b8 227 fi;
This page took 0.040972 seconds and 4 git commands to generate.