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