Move to kernel style SPDX license identifiers
[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
be347eb9 14if BUILD_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
be347eb9
MJ
25if BUILD_JAVA_AGENT_WITH_LOG4J
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
37258731
PP
33if BUILD_PYTHON_AGENT
34doc_examples_pythondir = ${docdir}/examples/python
35dist_doc_examples_python_DATA = python/hello.py
36endif
37
5f836e39 38if HAVE_CMAKE
ebb9f8ff 39if CXX_WORKS
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
JG
107
108if BUILD_GEN_TP_EXAMPLES
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)" \
135 CPPFLAGS="$(CPPFLAGS)" \
136 AM_CPPFLAGS="$(AM_CPPFLAGS) \
137 -I$$rel_src_subdir$(top_srcdir)/include/ \
138 -I$$rel_build_subdir$(top_builddir)/include/" \
139 CFLAGS='$(CFLAGS)' \
140 AM_CFLAGS='$(AM_CFLAGS)' \
141 LDFLAGS="$(LDFLAGS)" \
142 AM_LDFLAGS='$(AM_LDFLAGS) -L../../../liblttng-ust/.libs -Wl,-rpath="$(PWD)/../../liblttng-ust/.libs/" -Wl,-rpath-link="$(PWD)/../../liblttng-ust/.libs/"' \
143 LTTNG_GEN_TP_PATH="../../../tools/" \
144 AM_V_P="$(AM_V_P)" \
145 AM_V_at="$(AM_V_at)" \
146 $(AM_MAKEFLAGS) \
147 ) || exit 1; \
0faf99b8
MD
148 done; \
149 if [ x"$(SUBDIRS_JUL)" != x"" ]; then \
849202d4 150 for subdir in $(SUBDIRS_JUL); do \
54435b75
SM
151 ( \
152 cd $$subdir && \
153 $(MAKE) all \
b1035e61 154 CLASSPATH="$(CLASSPATH)" \
54435b75
SM
155 JAVA_CLASSPATH_OVERRIDE_JUL="../../../liblttng-ust-java-agent/java/lttng-ust-agent-jul" \
156 JAVA_CLASSPATH_OVERRIDE_COMMON="../../../liblttng-ust-java-agent/java/lttng-ust-agent-common" \
b6b4fee0 157 $(AM_MAKEFLAGS) \
54435b75 158 ) || exit 1; \
849202d4 159 done; \
be347eb9
MJ
160 fi; \
161 if [ x"$(SUBDIRS_LOG4J)" != x"" ]; then \
162 for subdir in $(SUBDIRS_LOG4J); do \
54435b75
SM
163 ( \
164 cd $$subdir && \
165 $(MAKE) all \
b1035e61 166 CLASSPATH="$(CLASSPATH)" \
54435b75
SM
167 JAVA_CLASSPATH_OVERRIDE_LOG4J="../../../liblttng-ust-java-agent/java/lttng-ust-agent-log4j" \
168 JAVA_CLASSPATH_OVERRIDE_COMMON="../../../liblttng-ust-java-agent/java/lttng-ust-agent-common" \
169 $(AM_MAKEFLAGS) \
170 ) || exit 1; \
be347eb9 171 done; \
e5b701c8 172 fi; \
5f836e39
SB
173 if [ x"$(SUBDIRS_CMAKE)" != x"" ]; then \
174 for subdir in $(SUBDIRS_CMAKE); do \
068160b1 175 ( \
e5b701c8 176 cd $$subdir && \
4c70c05c 177 $(MKDIR_P) build && \
068160b1 178 cd build && \
8aeb3cae 179 AR="$(AR)" \
54435b75
SM
180 CC="$(CC)" \
181 CXX="$(CXX)" \
182 cmake \
183 -DCMAKE_INCLUDE_PATH="$(abs_top_srcdir)/include;$(abs_top_builddir)/include" \
184 -DCMAKE_LIBRARY_PATH="$(abs_top_builddir)/liblttng-ust/.libs" \
fb54defd
MJ
185 -DCMAKE_C_FLAGS="$(AM_CFLAGS) $(CPPFLAGS) $(CFLAGS)" \
186 -DCMAKE_CXX_FLAGS="$(AM_CXXFLAGS) $(CXXFLAGS) $(CPPFLAGS)" \
54435b75
SM
187 -DCMAKE_EXE_LINKER_FLAGS="$(AM_LDFLAGS) $(LDFLAGS)" \
188 .. && \
189 $(MAKE) \
068160b1 190 ) || exit 1; \
5f836e39
SB
191 done; \
192 fi;
193
92414a62
MD
194
195clean-local:
dc5af9e3 196 $(AM_V_at)for subdir in $(SUBDIRS_PROXY); do \
0faf99b8 197 if [ -d $$subdir ]; then \
849202d4 198 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) clean && cd ..) || exit 1; \
0faf99b8
MD
199 fi; \
200 done; \
201 if [ x"$(SUBDIRS_JUL)" != x"" ]; then \
202 for subdir in $(SUBDIRS_JUL); do \
203 if [ -d $$subdir ]; then \
204 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) clean && cd ..) || exit 1; \
205 fi; \
849202d4 206 done; \
0faf99b8 207 fi; \
be347eb9
MJ
208 if [ x"$(SUBDIRS_LOG4J)" != x"" ]; then \
209 for subdir in $(SUBDIRS_LOG4J); do \
210 if [ -d $$subdir ]; then \
211 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) clean && cd ..) || exit 1; \
212 fi; \
213 done; \
214 fi; \
5f836e39
SB
215 if [ x"$(SUBDIRS_CMAKE)" != x"" ]; then \
216 for subdir in $(SUBDIRS_CMAKE); do \
217 if [ -d $$subdir ]; then \
218 (cd $$subdir && rm -rf build && cd ..) || exit 1; \
219 fi; \
220 done; \
221 fi; \
0faf99b8 222 if [ x"$(srcdir)" != x"$(builddir)" ]; then \
5f836e39 223 for subdir in $(SUBDIRS_PROXY) $(SUBDIRS_JUL) $(SUBDIRS_LOG4J) $(SUBDIRS_CMAKE); do \
92414a62
MD
224 rm -rf $(builddir)/$$subdir; \
225 done; \
0faf99b8 226 fi;
This page took 0.037502 seconds and 4 git commands to generate.