Fix: build log4j example when enabled
[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
a106a9f8 7
5c0f2ea7 8if BUILD_JAVA_AGENT_WITH_JUL
849202d4
DG
9doc_examples_java_juldir = ${docdir}/examples/java-jul
10dist_doc_examples_java_jul_DATA = java-jul/Makefile \
501f6777
CB
11 java-jul/Hello.java \
12 java-jul/run
849202d4 13SUBDIRS_JUL = java-jul
849202d4
DG
14endif
15
5c0f2ea7
MJ
16if BUILD_JAVA_AGENT_WITH_LOG4J
17doc_examples_java_log4jdir = ${docdir}/examples/java-log4j
18dist_doc_examples_java_log4j_DATA = java-log4j/Makefile \
19 java-log4j/Hello.java \
20 java-log4j/run
21SUBDIRS_LOG4J = java-log4j
22endif
23
a106a9f8 24dist_doc_examples_DATA = README
7ccf75d3
MD
25
26dist_doc_examples_easy_ust_DATA = easy-ust/Makefile \
27 easy-ust/sample.c \
28 easy-ust/sample_component_provider.h easy-ust/tp.c
29
30dist_doc_examples_gen_tp_DATA = gen-tp/Makefile \
31 gen-tp/sample.c gen-tp/sample_tracepoint.tp
60302adc
JG
32
33dist_doc_examples_demo_DATA = demo/demo.c \
34 demo/demo-trace \
35 demo/Makefile \
36 demo/README \
37 demo/tp2.c \
38 demo/tp3.c \
39 demo/tp.c \
40 demo/ust_tests_demo2.h \
41 demo/ust_tests_demo3.h \
42 demo/ust_tests_demo.h
a106a9f8
JG
43
44dist_doc_examples_hello_static_lib_DATA = hello-static-lib/Makefile \
45 hello-static-lib/hello.c \
46 hello-static-lib/README \
47 hello-static-lib/ust_tests_hello.h \
48 hello-static-lib/tp.c
49
af9f5e3c
MD
50dist_doc_examples_demo_tracef_DATA = demo-tracef/Makefile \
51 demo-tracef/demo-tracef.c \
52 demo-tracef/README
53
92414a62
MD
54if NO_SHARED
55# Don't build examples if shared libraries support was explicitly
56# disabled.
57else
58# Copies are for VPATH build support
641c659a 59SUBDIRS_PROXY = easy-ust demo hello-static-lib demo-tracef
2b90f1d3
JG
60
61if BUILD_GEN_TP_EXAMPLES
62SUBDIRS_PROXY += gen-tp
63endif
92414a62
MD
64
65all-local:
66 @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
5c0f2ea7 67 for subdir in $(SUBDIRS_PROXY) $(SUBDIRS_JUL) $(SUBDIRS_LOG4J); do \
a41cceb9 68 cp -pfR $(srcdir)/$$subdir $(builddir); \
92414a62 69 done; \
0faf99b8
MD
70 fi; \
71 if [ x"$(shell echo "$(top_srcdir)" | grep "^/" | wc -l)" = x"1" ]; then \
72 echo "Examples: absolute top_srcdir path $(top_srcdir)"; \
73 rel_src_subdir=""; \
74 else \
75 echo "Examples: relative top_srcdir path $(top_srcdir)"; \
76 rel_src_subdir="../"; \
77 fi; \
78 if [ x"$(shell echo "$(top_builddir)" | grep "^/" | wc -l)" = x"1" ]; then \
79 echo "Examples: absolute top_builddir path $(top_builddir)"; \
80 rel_build_subdir=""; \
81 else \
82 echo "Examples: relative top_builddir path $(top_builddir)"; \
83 rel_build_subdir="../"; \
84 fi; \
92414a62 85 for subdir in $(SUBDIRS_PROXY); do \
4de5e077 86 (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
87 done; \
88 if [ x"$(SUBDIRS_JUL)" != x"" ]; then \
849202d4 89 for subdir in $(SUBDIRS_JUL); do \
501f6777 90 (cd $(SUBDIRS_JUL) && $(MAKE) JAVA_CLASSPATH_OVERRIDE="../../../liblttng-ust-java-agent/java" JAVA_JARFILE_OVERRIDE="liblttng-ust-agent.jar" $(AM_MAKEFLAGS) all && cd ..) || exit 1; \
849202d4 91 done; \
5c0f2ea7
MJ
92 fi; \
93 if [ x"$(SUBDIRS_LOG4J)" != x"" ]; then \
94 for subdir in $(SUBDIRS_LOG4J); do \
95 (cd $(SUBDIRS_LOG4J) && $(MAKE) JAVA_CLASSPATH_OVERRIDE="../../../liblttng-ust-java-agent/java" JAVA_JARFILE_OVERRIDE="liblttng-ust-agent.jar" $(AM_MAKEFLAGS) all && cd ..) || exit 1; \
96 done; \
0faf99b8 97 fi;
92414a62
MD
98
99clean-local:
0faf99b8
MD
100 @for subdir in $(SUBDIRS_PROXY); do \
101 if [ -d $$subdir ]; then \
849202d4 102 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) clean && cd ..) || exit 1; \
0faf99b8
MD
103 fi; \
104 done; \
105 if [ x"$(SUBDIRS_JUL)" != x"" ]; then \
106 for subdir in $(SUBDIRS_JUL); do \
107 if [ -d $$subdir ]; then \
108 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) clean && cd ..) || exit 1; \
109 fi; \
849202d4 110 done; \
0faf99b8 111 fi; \
5c0f2ea7
MJ
112 if [ x"$(SUBDIRS_LOG4J)" != x"" ]; then \
113 for subdir in $(SUBDIRS_LOG4J); do \
114 if [ -d $$subdir ]; then \
115 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) clean && cd ..) || exit 1; \
116 fi; \
117 done; \
118 fi; \
0faf99b8 119 if [ x"$(srcdir)" != x"$(builddir)" ]; then \
5c0f2ea7 120 for subdir in $(SUBDIRS_PROXY) $(SUBDIRS_JUL) $(SUBDIRS_LOG4J); do \
92414a62
MD
121 rm -rf $(builddir)/$$subdir; \
122 done; \
0faf99b8 123 fi;
92414a62 124endif
This page took 0.029881 seconds and 4 git commands to generate.