Fix: examples make distcheck failure
[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
8 if BUILD_JAVA_AGENT_WITH_JUL
9 doc_examples_java_juldir = ${docdir}/examples/java-jul
10 dist_doc_examples_java_jul_DATA = java-jul/Makefile \
11 java-jul/Hello.java \
12 java-jul/run
13 SUBDIRS_JUL = java-jul
14 endif
15
16 if BUILD_JAVA_AGENT_WITH_LOG4J
17 doc_examples_java_log4jdir = ${docdir}/examples/java-log4j
18 dist_doc_examples_java_log4j_DATA = java-log4j/Makefile \
19 java-log4j/Hello.java \
20 java-log4j/run
21 SUBDIRS_LOG4J = java-log4j
22 endif
23
24 dist_doc_examples_DATA = README
25
26 dist_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
30 dist_doc_examples_gen_tp_DATA = gen-tp/Makefile \
31 gen-tp/sample.c gen-tp/sample_tracepoint.tp
32
33 dist_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
43
44 dist_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
50 dist_doc_examples_demo_tracef_DATA = demo-tracef/Makefile \
51 demo-tracef/demo-tracef.c \
52 demo-tracef/README
53
54 if NO_SHARED
55 # Don't build examples if shared libraries support was explicitly
56 # disabled.
57 else
58 # Copies are for VPATH build support
59 SUBDIRS_PROXY = easy-ust demo hello-static-lib demo-tracef
60
61 if BUILD_GEN_TP_EXAMPLES
62 SUBDIRS_PROXY += gen-tp
63 endif
64
65 all-local:
66 @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
67 for subdir in $(SUBDIRS_PROXY) $(SUBDIRS_JUL) $(SUBDIRS_LOG4J); do \
68 cp -pfR $(srcdir)/$$subdir $(builddir); \
69 chmod -R u+w $(builddir)/$$subdir; \
70 done; \
71 fi; \
72 if [ x"$(shell echo "$(top_srcdir)" | grep "^/" | wc -l)" = x"1" ]; then \
73 echo "Examples: absolute top_srcdir path $(top_srcdir)"; \
74 rel_src_subdir=""; \
75 else \
76 echo "Examples: relative top_srcdir path $(top_srcdir)"; \
77 rel_src_subdir="../"; \
78 fi; \
79 if [ x"$(shell echo "$(top_builddir)" | grep "^/" | wc -l)" = x"1" ]; then \
80 echo "Examples: absolute top_builddir path $(top_builddir)"; \
81 rel_build_subdir=""; \
82 else \
83 echo "Examples: relative top_builddir path $(top_builddir)"; \
84 rel_build_subdir="../"; \
85 fi; \
86 for subdir in $(SUBDIRS_PROXY); do \
87 (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; \
88 done; \
89 if [ x"$(SUBDIRS_JUL)" != x"" ]; then \
90 for subdir in $(SUBDIRS_JUL); do \
91 (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; \
92 done; \
93 fi; \
94 if [ x"$(SUBDIRS_LOG4J)" != x"" ]; then \
95 for subdir in $(SUBDIRS_LOG4J); do \
96 (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; \
97 done; \
98 fi;
99
100 clean-local:
101 @for subdir in $(SUBDIRS_PROXY); do \
102 if [ -d $$subdir ]; then \
103 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) clean && cd ..) || exit 1; \
104 fi; \
105 done; \
106 if [ x"$(SUBDIRS_JUL)" != x"" ]; then \
107 for subdir in $(SUBDIRS_JUL); do \
108 if [ -d $$subdir ]; then \
109 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) clean && cd ..) || exit 1; \
110 fi; \
111 done; \
112 fi; \
113 if [ x"$(SUBDIRS_LOG4J)" != x"" ]; then \
114 for subdir in $(SUBDIRS_LOG4J); do \
115 if [ -d $$subdir ]; then \
116 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) clean && cd ..) || exit 1; \
117 fi; \
118 done; \
119 fi; \
120 if [ x"$(srcdir)" != x"$(builddir)" ]; then \
121 for subdir in $(SUBDIRS_PROXY) $(SUBDIRS_JUL) $(SUBDIRS_LOG4J); do \
122 rm -rf $(builddir)/$$subdir; \
123 done; \
124 fi;
125 endif
This page took 0.032041 seconds and 4 git commands to generate.