Fix: out of tree examples build
[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
JG
5doc_examples_hello_static_libdir = ${docdir}/examples/hello-static-lib
6
849202d4
DG
7if BUILD_JNI_INTERFACE
8doc_examples_java_juldir = ${docdir}/examples/java-jul
9dist_doc_examples_java_jul_DATA = java-jul/Makefile \
10 java-jul/Hello.java \
11 java-jul/run
12SUBDIRS_JUL = java-jul
13bin_SCRIPTS = java-jul/Makefile
14endif
15
a106a9f8 16dist_doc_examples_DATA = README
7ccf75d3
MD
17
18dist_doc_examples_easy_ust_DATA = easy-ust/Makefile \
19 easy-ust/sample.c \
20 easy-ust/sample_component_provider.h easy-ust/tp.c
21
22dist_doc_examples_gen_tp_DATA = gen-tp/Makefile \
23 gen-tp/sample.c gen-tp/sample_tracepoint.tp
60302adc
JG
24
25dist_doc_examples_demo_DATA = demo/demo.c \
26 demo/demo-trace \
27 demo/Makefile \
28 demo/README \
29 demo/tp2.c \
30 demo/tp3.c \
31 demo/tp.c \
32 demo/ust_tests_demo2.h \
33 demo/ust_tests_demo3.h \
34 demo/ust_tests_demo.h
a106a9f8
JG
35
36dist_doc_examples_hello_static_lib_DATA = hello-static-lib/Makefile \
37 hello-static-lib/hello.c \
38 hello-static-lib/README \
39 hello-static-lib/ust_tests_hello.h \
40 hello-static-lib/tp.c
41
92414a62
MD
42if NO_SHARED
43# Don't build examples if shared libraries support was explicitly
44# disabled.
45else
46# Copies are for VPATH build support
47SUBDIRS_PROXY = easy-ust demo gen-tp hello-static-lib
48
49all-local:
50 @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
849202d4 51 for subdir in $(SUBDIRS_PROXY) $(SUBDIRS_JUL); do \
92414a62
MD
52 cp -fR $(srcdir)/$$subdir $(builddir); \
53 done; \
0faf99b8
MD
54 fi; \
55 if [ x"$(shell echo "$(top_srcdir)" | grep "^/" | wc -l)" = x"1" ]; then \
56 echo "Examples: absolute top_srcdir path $(top_srcdir)"; \
57 rel_src_subdir=""; \
58 else \
59 echo "Examples: relative top_srcdir path $(top_srcdir)"; \
60 rel_src_subdir="../"; \
61 fi; \
62 if [ x"$(shell echo "$(top_builddir)" | grep "^/" | wc -l)" = x"1" ]; then \
63 echo "Examples: absolute top_builddir path $(top_builddir)"; \
64 rel_build_subdir=""; \
65 else \
66 echo "Examples: relative top_builddir path $(top_builddir)"; \
67 rel_build_subdir="../"; \
68 fi; \
92414a62 69 for subdir in $(SUBDIRS_PROXY); do \
0faf99b8
MD
70 (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/"' LTTNG_GEN_TP_PATH="../../../tools/" $(AM_MAKEFLAGS) all && cd ..) || exit 1; \
71 done; \
72 if [ x"$(SUBDIRS_JUL)" != x"" ]; then \
849202d4
DG
73 for subdir in $(SUBDIRS_JUL); do \
74 (cd $(SUBDIRS_JUL) && $(MAKE) JAVA_CLASSPATH_OVERRIDE="../../../liblttng-ust-jul" JAVA_JARFILE_OVERRIDE="liblttng-ust-jul.jar" $(AM_MAKEFLAGS) all && cd ..) || exit 1; \
75 done; \
0faf99b8 76 fi;
92414a62
MD
77
78clean-local:
0faf99b8
MD
79 @for subdir in $(SUBDIRS_PROXY); do \
80 if [ -d $$subdir ]; then \
849202d4 81 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) clean && cd ..) || exit 1; \
0faf99b8
MD
82 fi; \
83 done; \
84 if [ x"$(SUBDIRS_JUL)" != x"" ]; then \
85 for subdir in $(SUBDIRS_JUL); do \
86 if [ -d $$subdir ]; then \
87 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) clean && cd ..) || exit 1; \
88 fi; \
849202d4 89 done; \
0faf99b8
MD
90 fi; \
91 if [ x"$(srcdir)" != x"$(builddir)" ]; then \
849202d4 92 for subdir in $(SUBDIRS_PROXY) $(SUBDIRS_JUL); do \
92414a62
MD
93 rm -rf $(builddir)/$$subdir; \
94 done; \
0faf99b8 95 fi;
92414a62 96endif
This page took 0.028452 seconds and 4 git commands to generate.