Doc: add CMake example
[lttng-ust.git] / doc / examples / Makefile.am
CommitLineData
a106a9f8 1doc_examplesdir = ${docdir}/examples
7ccf75d3
MD
2doc_examples_easy_ustdir = ${docdir}/examples/easy-ust
3doc_examples_gen_tpdir = ${docdir}/examples/gen-tp
60302adc 4doc_examples_demodir = ${docdir}/examples/demo
a106a9f8 5doc_examples_hello_static_libdir = ${docdir}/examples/hello-static-lib
af9f5e3c 6doc_examples_demo_tracefdir = ${docdir}/examples/demo-tracef
eb8246a0 7doc_examples_demo_tracelogdir = ${docdir}/examples/demo-tracelog
f9364363 8doc_examples_clock_overridedir = ${docdir}/examples/clock-override
5e1b7b8b 9doc_examples_getcpu_overridedir = ${docdir}/examples/getcpu-override
a106a9f8 10
be347eb9 11if BUILD_JAVA_AGENT_WITH_JUL
849202d4
DG
12doc_examples_java_juldir = ${docdir}/examples/java-jul
13dist_doc_examples_java_jul_DATA = java-jul/Makefile \
501f6777 14 java-jul/Hello.java \
7b250cea 15 java-jul/run \
cf6634ba 16 java-jul/ApplicationContextExample.java \
7b250cea
MD
17 java-jul/FilterChangeListenerExample.java \
18 java-jul/README
849202d4 19SUBDIRS_JUL = java-jul
849202d4
DG
20endif
21
be347eb9
MJ
22if BUILD_JAVA_AGENT_WITH_LOG4J
23doc_examples_java_log4jdir = ${docdir}/examples/java-log4j
24dist_doc_examples_java_log4j_DATA = java-log4j/Makefile \
25 java-log4j/Hello.java \
26 java-log4j/run
27SUBDIRS_LOG4J = java-log4j
28endif
29
37258731
PP
30if BUILD_PYTHON_AGENT
31doc_examples_pythondir = ${docdir}/examples/python
32dist_doc_examples_python_DATA = python/hello.py
33endif
34
a106a9f8 35dist_doc_examples_DATA = README
7ccf75d3
MD
36
37dist_doc_examples_easy_ust_DATA = easy-ust/Makefile \
38 easy-ust/sample.c \
39 easy-ust/sample_component_provider.h easy-ust/tp.c
40
41dist_doc_examples_gen_tp_DATA = gen-tp/Makefile \
42 gen-tp/sample.c gen-tp/sample_tracepoint.tp
60302adc
JG
43
44dist_doc_examples_demo_DATA = demo/demo.c \
45 demo/demo-trace \
46 demo/Makefile \
47 demo/README \
48 demo/tp2.c \
49 demo/tp3.c \
50 demo/tp.c \
51 demo/ust_tests_demo2.h \
52 demo/ust_tests_demo3.h \
53 demo/ust_tests_demo.h
a106a9f8
JG
54
55dist_doc_examples_hello_static_lib_DATA = hello-static-lib/Makefile \
56 hello-static-lib/hello.c \
57 hello-static-lib/README \
58 hello-static-lib/ust_tests_hello.h \
59 hello-static-lib/tp.c
60
af9f5e3c
MD
61dist_doc_examples_demo_tracef_DATA = demo-tracef/Makefile \
62 demo-tracef/demo-tracef.c \
63 demo-tracef/README
64
eb8246a0
MD
65dist_doc_examples_demo_tracelog_DATA = demo-tracelog/Makefile \
66 demo-tracelog/demo-tracelog.c \
67 demo-tracelog/README
68
f9364363
MD
69dist_doc_examples_clock_override_DATA = clock-override/Makefile \
70 clock-override/lttng-ust-clock-override-example.c \
71 clock-override/run-clock-override \
72 clock-override/README
73
5e1b7b8b
MD
74dist_doc_examples_getcpu_override_DATA = getcpu-override/Makefile \
75 getcpu-override/lttng-ust-getcpu-override-example.c \
76 getcpu-override/run-getcpu-override \
77 getcpu-override/README
78
92414a62
MD
79if NO_SHARED
80# Don't build examples if shared libraries support was explicitly
81# disabled.
82else
83# Copies are for VPATH build support
5e1b7b8b 84SUBDIRS_PROXY = easy-ust demo hello-static-lib demo-tracef clock-override \
eb8246a0 85 getcpu-override demo-tracelog
2b90f1d3
JG
86
87if BUILD_GEN_TP_EXAMPLES
88SUBDIRS_PROXY += gen-tp
89endif
92414a62
MD
90
91all-local:
92 @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
be347eb9 93 for subdir in $(SUBDIRS_PROXY) $(SUBDIRS_JUL) $(SUBDIRS_LOG4J); do \
a41cceb9 94 cp -pfR $(srcdir)/$$subdir $(builddir); \
c8ab8d34 95 chmod -R u+w $(builddir)/$$subdir; \
92414a62 96 done; \
0faf99b8
MD
97 fi; \
98 if [ x"$(shell echo "$(top_srcdir)" | grep "^/" | wc -l)" = x"1" ]; then \
99 echo "Examples: absolute top_srcdir path $(top_srcdir)"; \
100 rel_src_subdir=""; \
101 else \
102 echo "Examples: relative top_srcdir path $(top_srcdir)"; \
103 rel_src_subdir="../"; \
104 fi; \
105 if [ x"$(shell echo "$(top_builddir)" | grep "^/" | wc -l)" = x"1" ]; then \
106 echo "Examples: absolute top_builddir path $(top_builddir)"; \
107 rel_build_subdir=""; \
108 else \
109 echo "Examples: relative top_builddir path $(top_builddir)"; \
110 rel_build_subdir="../"; \
111 fi; \
92414a62 112 for subdir in $(SUBDIRS_PROXY); do \
4de5e077 113 (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; \
0faf99b8
MD
114 done; \
115 if [ x"$(SUBDIRS_JUL)" != x"" ]; then \
849202d4 116 for subdir in $(SUBDIRS_JUL); do \
8e57e02f 117 (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; \
849202d4 118 done; \
be347eb9
MJ
119 fi; \
120 if [ x"$(SUBDIRS_LOG4J)" != x"" ]; then \
121 for subdir in $(SUBDIRS_LOG4J); do \
8e57e02f 122 (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; \
be347eb9 123 done; \
0faf99b8 124 fi;
92414a62
MD
125
126clean-local:
0faf99b8
MD
127 @for subdir in $(SUBDIRS_PROXY); do \
128 if [ -d $$subdir ]; then \
849202d4 129 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) clean && cd ..) || exit 1; \
0faf99b8
MD
130 fi; \
131 done; \
132 if [ x"$(SUBDIRS_JUL)" != x"" ]; then \
133 for subdir in $(SUBDIRS_JUL); do \
134 if [ -d $$subdir ]; then \
135 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) clean && cd ..) || exit 1; \
136 fi; \
849202d4 137 done; \
0faf99b8 138 fi; \
be347eb9
MJ
139 if [ x"$(SUBDIRS_LOG4J)" != x"" ]; then \
140 for subdir in $(SUBDIRS_LOG4J); do \
141 if [ -d $$subdir ]; then \
142 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) clean && cd ..) || exit 1; \
143 fi; \
144 done; \
145 fi; \
0faf99b8 146 if [ x"$(srcdir)" != x"$(builddir)" ]; then \
be347eb9 147 for subdir in $(SUBDIRS_PROXY) $(SUBDIRS_JUL) $(SUBDIRS_LOG4J); do \
92414a62
MD
148 rm -rf $(builddir)/$$subdir; \
149 done; \
0faf99b8 150 fi;
92414a62 151endif
This page took 0.032417 seconds and 4 git commands to generate.