424b8440dff2417aad6f42ac15f9cd26bd03c7bc
[lttng-ust.git] / doc / examples / Makefile.am
1 doc_examplesdir = ${docdir}/examples
2 doc_examples_easy_ustdir = ${docdir}/examples/easy-ust
3 doc_examples_gen_tpdir = ${docdir}/examples/gen-tp
4 doc_examples_demodir = ${docdir}/examples/demo
5 doc_examples_hello_static_libdir = ${docdir}/examples/hello-static-lib
6 doc_examples_demo_tracefdir = ${docdir}/examples/demo-tracef
7 doc_examples_demo_tracelogdir = ${docdir}/examples/demo-tracelog
8 doc_examples_clock_overridedir = ${docdir}/examples/clock-override
9 doc_examples_getcpu_overridedir = ${docdir}/examples/getcpu-override
10 doc_examples_cmakedir = ${docdir}/examples/cmake-multiple-shared-libraries
11
12 if BUILD_JAVA_AGENT_WITH_JUL
13 doc_examples_java_juldir = ${docdir}/examples/java-jul
14 dist_doc_examples_java_jul_DATA = java-jul/Makefile \
15 java-jul/Hello.java \
16 java-jul/run \
17 java-jul/ApplicationContextExample.java \
18 java-jul/FilterChangeListenerExample.java \
19 java-jul/README
20 SUBDIRS_JUL = java-jul
21 endif
22
23 if BUILD_JAVA_AGENT_WITH_LOG4J
24 doc_examples_java_log4jdir = ${docdir}/examples/java-log4j
25 dist_doc_examples_java_log4j_DATA = java-log4j/Makefile \
26 java-log4j/Hello.java \
27 java-log4j/run
28 SUBDIRS_LOG4J = java-log4j
29 endif
30
31 if BUILD_PYTHON_AGENT
32 doc_examples_pythondir = ${docdir}/examples/python
33 dist_doc_examples_python_DATA = python/hello.py
34 endif
35
36 if HAVE_CMAKE
37 if CXX_WORKS
38 SUBDIRS_CMAKE = cmake-multiple-shared-libraries
39 endif
40 endif
41
42 dist_doc_examples_DATA = README
43
44 dist_doc_examples_easy_ust_DATA = easy-ust/Makefile \
45 easy-ust/sample.c \
46 easy-ust/sample_component_provider.h easy-ust/tp.c
47
48 dist_doc_examples_cmake_DATA = \
49 cmake-multiple-shared-libraries/CMakeLists.txt \
50 cmake-multiple-shared-libraries/cmake/FindLTTngUST.cmake \
51 cmake-multiple-shared-libraries/aligner.cpp \
52 cmake-multiple-shared-libraries/aligner-lib.cpp \
53 cmake-multiple-shared-libraries/aligner-lib.h \
54 cmake-multiple-shared-libraries/README.md \
55 cmake-multiple-shared-libraries/tester.cpp \
56 cmake-multiple-shared-libraries/tester-lib.cpp \
57 cmake-multiple-shared-libraries/tester-lib.h \
58 cmake-multiple-shared-libraries/tracepoint-provider.cpp \
59 cmake-multiple-shared-libraries/tracepoint-provider.h \
60 cmake-multiple-shared-libraries/trace.sh
61
62 dist_doc_examples_gen_tp_DATA = gen-tp/Makefile \
63 gen-tp/sample.c gen-tp/sample_tracepoint.tp
64
65 dist_doc_examples_demo_DATA = demo/demo.c \
66 demo/demo-trace \
67 demo/Makefile \
68 demo/README \
69 demo/tp2.c \
70 demo/tp3.c \
71 demo/tp.c \
72 demo/ust_tests_demo2.h \
73 demo/ust_tests_demo3.h \
74 demo/ust_tests_demo.h
75
76 dist_doc_examples_hello_static_lib_DATA = hello-static-lib/Makefile \
77 hello-static-lib/hello.c \
78 hello-static-lib/README \
79 hello-static-lib/ust_tests_hello.h \
80 hello-static-lib/tp.c
81
82 dist_doc_examples_demo_tracef_DATA = demo-tracef/Makefile \
83 demo-tracef/demo-tracef.c \
84 demo-tracef/README
85
86 dist_doc_examples_demo_tracelog_DATA = demo-tracelog/Makefile \
87 demo-tracelog/demo-tracelog.c \
88 demo-tracelog/README
89
90 dist_doc_examples_clock_override_DATA = clock-override/Makefile \
91 clock-override/lttng-ust-clock-override-example.c \
92 clock-override/run-clock-override \
93 clock-override/README
94
95 dist_doc_examples_getcpu_override_DATA = getcpu-override/Makefile \
96 getcpu-override/lttng-ust-getcpu-override-example.c \
97 getcpu-override/run-getcpu-override \
98 getcpu-override/README
99
100 if NO_SHARED
101 # Don't build examples if shared libraries support was explicitly
102 # disabled.
103 else
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 BUILD_GEN_TP_EXAMPLES
109 SUBDIRS_PROXY += gen-tp
110 endif
111
112 all-local:
113 @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 echo "Examples: absolute top_srcdir path $(top_srcdir)"; \
121 rel_src_subdir=""; \
122 else \
123 echo "Examples: relative top_srcdir path $(top_srcdir)"; \
124 rel_src_subdir="../"; \
125 fi; \
126 if [ x"$(shell echo "$(top_builddir)" | grep "^/" | wc -l)" = x"1" ]; then \
127 echo "Examples: absolute top_builddir path $(top_builddir)"; \
128 rel_build_subdir=""; \
129 else \
130 echo "Examples: relative top_builddir path $(top_builddir)"; \
131 rel_build_subdir="../"; \
132 fi; \
133 for subdir in $(SUBDIRS_PROXY); do \
134 (cd $$subdir && $(MAKE) AM_CC="$(CC)" AM_CPPFLAGS="$(CPPFLAGS) -I$$rel_src_subdir$(top_srcdir)/include/ -I$$rel_build_subdir$(top_builddir)/include/" AM_CFLAGS='$(CFLAGS)' AM_LDFLAGS='$(LDFLAGS) -L../../../liblttng-ust/.libs -Wl,-rpath="$(PWD)/../../liblttng-ust/.libs/" -Wl,-rpath-link="$(PWD)/../../liblttng-ust/.libs/"' LTTNG_GEN_TP_PATH="../../../tools/" $(AM_MAKEFLAGS) all && cd ..) || exit 1; \
135 done; \
136 if [ x"$(SUBDIRS_JUL)" != x"" ]; then \
137 for subdir in $(SUBDIRS_JUL); do \
138 (cd $(SUBDIRS_JUL) && $(MAKE) JAVA_CLASSPATH_OVERRIDE_JUL="../../../liblttng-ust-java-agent/java/lttng-ust-agent-jul" JAVA_CLASSPATH_OVERRIDE_COMMON="../../../liblttng-ust-java-agent/java/lttng-ust-agent-common" $(AM_MAKEFLAGS) all && cd ..) || exit 1; \
139 done; \
140 fi; \
141 if [ x"$(SUBDIRS_LOG4J)" != x"" ]; then \
142 for subdir in $(SUBDIRS_LOG4J); do \
143 (cd $(SUBDIRS_LOG4J) && $(MAKE) JAVA_CLASSPATH_OVERRIDE_LOG4J="../../../liblttng-ust-java-agent/java/lttng-ust-agent-log4j" JAVA_CLASSPATH_OVERRIDE_COMMON="../../../liblttng-ust-java-agent/java/lttng-ust-agent-common" $(AM_MAKEFLAGS) all && cd ..) || exit 1; \
144 done; \
145 fi;
146 if [ x"$(SUBDIRS_CMAKE)" != x"" ]; then \
147 for subdir in $(SUBDIRS_CMAKE); do \
148 ( \
149 cd $(SUBDIRS_CMAKE) && \
150 $(MKDIR_P) build && \
151 cd build && \
152 cmake \
153 -DCMAKE_INCLUDE_PATH="$(abs_top_srcdir)/include;$(abs_top_builddir)/include" \
154 -DCMAKE_LIBRARY_PATH="$(abs_top_builddir)/liblttng-ust/.libs" \
155 -DCMAKE_C_FLAGS="$(CFLAGS) $(CPPFLAGS)" \
156 -DCMAKE_CXX_FLAGS="$(CXXFLAGS) $(CPPFLAGS)" \
157 -DCMAKE_EXE_LINKER_FLAGS="$(LDFLAGS)" \
158 .. && \
159 $(MAKE) && \
160 cd .. \
161 ) || exit 1; \
162 done; \
163 fi;
164
165
166 clean-local:
167 @for subdir in $(SUBDIRS_PROXY); do \
168 if [ -d $$subdir ]; then \
169 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) clean && cd ..) || exit 1; \
170 fi; \
171 done; \
172 if [ x"$(SUBDIRS_JUL)" != x"" ]; then \
173 for subdir in $(SUBDIRS_JUL); do \
174 if [ -d $$subdir ]; then \
175 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) clean && cd ..) || exit 1; \
176 fi; \
177 done; \
178 fi; \
179 if [ x"$(SUBDIRS_LOG4J)" != x"" ]; then \
180 for subdir in $(SUBDIRS_LOG4J); do \
181 if [ -d $$subdir ]; then \
182 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) clean && cd ..) || exit 1; \
183 fi; \
184 done; \
185 fi; \
186 if [ x"$(SUBDIRS_CMAKE)" != x"" ]; then \
187 for subdir in $(SUBDIRS_CMAKE); do \
188 if [ -d $$subdir ]; then \
189 (cd $$subdir && rm -rf build && cd ..) || exit 1; \
190 fi; \
191 done; \
192 fi; \
193 if [ x"$(srcdir)" != x"$(builddir)" ]; then \
194 for subdir in $(SUBDIRS_PROXY) $(SUBDIRS_JUL) $(SUBDIRS_LOG4J) $(SUBDIRS_CMAKE); do \
195 rm -rf $(builddir)/$$subdir; \
196 done; \
197 fi;
198 endif
This page took 0.032821 seconds and 3 git commands to generate.