| 1 | # SPDX-License-Identifier: LGPL-2.1-only |
| 2 | |
| 3 | doc_examplesdir = ${docdir}/examples |
| 4 | doc_examples_easy_ustdir = ${docdir}/examples/easy-ust |
| 5 | doc_examples_gen_tpdir = ${docdir}/examples/gen-tp |
| 6 | doc_examples_demodir = ${docdir}/examples/demo |
| 7 | doc_examples_hello_static_libdir = ${docdir}/examples/hello-static-lib |
| 8 | doc_examples_demo_tracefdir = ${docdir}/examples/demo-tracef |
| 9 | doc_examples_demo_tracelogdir = ${docdir}/examples/demo-tracelog |
| 10 | doc_examples_clock_overridedir = ${docdir}/examples/clock-override |
| 11 | doc_examples_getcpu_overridedir = ${docdir}/examples/getcpu-override |
| 12 | doc_examples_cmakedir = ${docdir}/examples/cmake-multiple-shared-libraries |
| 13 | |
| 14 | if ENABLE_JAVA_AGENT_WITH_JUL |
| 15 | doc_examples_java_juldir = ${docdir}/examples/java-jul |
| 16 | dist_doc_examples_java_jul_DATA = java-jul/Makefile \ |
| 17 | java-jul/Hello.java \ |
| 18 | java-jul/run \ |
| 19 | java-jul/ApplicationContextExample.java \ |
| 20 | java-jul/FilterChangeListenerExample.java \ |
| 21 | java-jul/README |
| 22 | SUBDIRS_JUL = java-jul |
| 23 | endif |
| 24 | |
| 25 | if ENABLE_JAVA_AGENT_WITH_LOG4J |
| 26 | doc_examples_java_log4jdir = ${docdir}/examples/java-log4j |
| 27 | dist_doc_examples_java_log4j_DATA = java-log4j/Makefile \ |
| 28 | java-log4j/Hello.java \ |
| 29 | java-log4j/run |
| 30 | SUBDIRS_LOG4J = java-log4j |
| 31 | endif |
| 32 | |
| 33 | if ENABLE_PYTHON_AGENT |
| 34 | doc_examples_pythondir = ${docdir}/examples/python |
| 35 | dist_doc_examples_python_DATA = python/hello.py |
| 36 | endif |
| 37 | |
| 38 | if HAVE_CMAKE |
| 39 | if HAVE_CXX |
| 40 | SUBDIRS_CMAKE = cmake-multiple-shared-libraries |
| 41 | endif |
| 42 | endif |
| 43 | |
| 44 | dist_doc_examples_DATA = README |
| 45 | |
| 46 | dist_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 | |
| 50 | dist_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 | |
| 64 | dist_doc_examples_gen_tp_DATA = gen-tp/Makefile \ |
| 65 | gen-tp/sample.c gen-tp/sample_tracepoint.tp |
| 66 | |
| 67 | dist_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 |
| 77 | |
| 78 | dist_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 | |
| 84 | dist_doc_examples_demo_tracef_DATA = demo-tracef/Makefile \ |
| 85 | demo-tracef/demo-tracef.c \ |
| 86 | demo-tracef/demo-vtracef.c \ |
| 87 | demo-tracef/README |
| 88 | |
| 89 | dist_doc_examples_demo_tracelog_DATA = demo-tracelog/Makefile \ |
| 90 | demo-tracelog/demo-tracelog.c \ |
| 91 | demo-tracelog/demo-vtracelog.c \ |
| 92 | demo-tracelog/README |
| 93 | |
| 94 | dist_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 | |
| 99 | dist_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 | |
| 104 | # Copies are for VPATH build support |
| 105 | SUBDIRS_PROXY = easy-ust demo hello-static-lib demo-tracef clock-override \ |
| 106 | getcpu-override demo-tracelog |
| 107 | |
| 108 | if ENABLE_GEN_TP_EXAMPLES |
| 109 | SUBDIRS_PROXY += gen-tp |
| 110 | endif |
| 111 | |
| 112 | all-local: |
| 113 | $(AM_V_at)if [ x"$(srcdir)" != x"$(builddir)" ]; then \ |
| 114 | for subdir in $(SUBDIRS_PROXY) $(SUBDIRS_JUL) $(SUBDIRS_LOG4J) $(SUBDIRS_CMAKE); do \ |
| 115 | cp -pfR $(srcdir)/$$subdir $(builddir); \ |
| 116 | chmod -R u+w $(builddir)/$$subdir; \ |
| 117 | done; \ |
| 118 | fi; \ |
| 119 | if [ x"$(shell echo "$(top_srcdir)" | grep "^/" | wc -l)" = x"1" ]; then \ |
| 120 | rel_src_subdir=""; \ |
| 121 | else \ |
| 122 | rel_src_subdir="../"; \ |
| 123 | fi; \ |
| 124 | if [ x"$(shell echo "$(top_builddir)" | grep "^/" | wc -l)" = x"1" ]; then \ |
| 125 | rel_build_subdir=""; \ |
| 126 | else \ |
| 127 | rel_build_subdir="../"; \ |
| 128 | fi; \ |
| 129 | for subdir in $(SUBDIRS_PROXY); do \ |
| 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; \ |
| 148 | done; \ |
| 149 | if [ x"$(SUBDIRS_JUL)" != x"" ]; then \ |
| 150 | for subdir in $(SUBDIRS_JUL); do \ |
| 151 | ( \ |
| 152 | cd $$subdir && \ |
| 153 | $(MAKE) all \ |
| 154 | CLASSPATH="$(CLASSPATH)" \ |
| 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" \ |
| 157 | $(AM_MAKEFLAGS) \ |
| 158 | ) || exit 1; \ |
| 159 | done; \ |
| 160 | fi; \ |
| 161 | if [ x"$(SUBDIRS_LOG4J)" != x"" ]; then \ |
| 162 | for subdir in $(SUBDIRS_LOG4J); do \ |
| 163 | ( \ |
| 164 | cd $$subdir && \ |
| 165 | $(MAKE) all \ |
| 166 | CLASSPATH="$(CLASSPATH)" \ |
| 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; \ |
| 171 | done; \ |
| 172 | fi; \ |
| 173 | if [ x"$(SUBDIRS_CMAKE)" != x"" ]; then \ |
| 174 | for subdir in $(SUBDIRS_CMAKE); do \ |
| 175 | ( \ |
| 176 | cd $$subdir && \ |
| 177 | $(MKDIR_P) build && \ |
| 178 | cd build && \ |
| 179 | AR="$(AR)" \ |
| 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" \ |
| 185 | -DCMAKE_C_FLAGS="$(AM_CFLAGS) $(CPPFLAGS) $(CFLAGS)" \ |
| 186 | -DCMAKE_CXX_FLAGS="$(AM_CXXFLAGS) $(CXXFLAGS) $(CPPFLAGS)" \ |
| 187 | -DCMAKE_EXE_LINKER_FLAGS="$(AM_LDFLAGS) $(LDFLAGS)" \ |
| 188 | .. && \ |
| 189 | $(MAKE) \ |
| 190 | ) || exit 1; \ |
| 191 | done; \ |
| 192 | fi; |
| 193 | |
| 194 | |
| 195 | clean-local: |
| 196 | $(AM_V_at)for subdir in $(SUBDIRS_PROXY); do \ |
| 197 | if [ -d $$subdir ]; then \ |
| 198 | (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) clean && cd ..) || exit 1; \ |
| 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; \ |
| 206 | done; \ |
| 207 | fi; \ |
| 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; \ |
| 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; \ |
| 222 | if [ x"$(srcdir)" != x"$(builddir)" ]; then \ |
| 223 | for subdir in $(SUBDIRS_PROXY) $(SUBDIRS_JUL) $(SUBDIRS_LOG4J) $(SUBDIRS_CMAKE); do \ |
| 224 | rm -rf $(builddir)/$$subdir; \ |
| 225 | done; \ |
| 226 | fi; |