docs/: add a chapter on running GStreamer.
[platform/upstream/gstreamer.git] / Makefile.am
1 DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc --enable-docbook
2
3 if BUILD_TESTS
4 ## SUBDIRS_TESTS = tests testsuite
5 ## FIXME: write tests from scratch
6 SUBDIRS_TESTS =
7 if HAVE_CHECK
8 SUBDIRS_CHECK = check
9 else
10 SUBDIRS_CHECK =
11 endif
12 else
13 SUBDIRS_TESTS =
14 SUBDIRS_CHECK =
15 endif
16
17 if BUILD_EXAMPLES
18 ## FIXME: write examples from scratch
19 # SUBDIRS_EXAMPLES = examples
20 SUBDIRS_EXAMPLES =
21 else
22 SUBDIRS_EXAMPLES =
23 endif
24
25 all-local: gst-element-check-@GST_MAJORMINOR@.m4
26
27 gst-element-check-@GST_MAJORMINOR@.m4: gst-element-check.m4
28         cp $(srcdir)/gst-element-check.m4 gst-element-check-@GST_MAJORMINOR@.m4
29
30 ACLOCAL_AMFLAGS = -I common/m4
31
32 aclocaldir = $(datadir)/aclocal
33 aclocal_DATA = gst-element-check-@GST_MAJORMINOR@.m4
34
35 SUBDIRS = \
36         gst libs tools \
37         $(SUBDIRS_CHECK) \
38         $(SUBDIRS_TESTS) \
39         $(SUBDIRS_EXAMPLES) \
40         docs \
41         pkgconfig po \
42         common
43
44 # These are all the possible subdirs
45 DIST_SUBDIRS = \
46         gst libs tools \
47         check \
48         tests testsuite \
49         examples \
50         docs \
51         pkgconfig po \
52         common
53
54 win32 = $(shell cat $(top_srcdir)/win32/MANIFEST)
55
56 debug:
57         echo $(win32)
58 EXTRA_DIST = \
59         gstreamer.spec gstreamer.spec.in gst-element-check.m4 \
60         configure.ac autogen.sh depcomp \
61         REQUIREMENTS ABOUT-NLS DOCBUILDING DEVEL RELEASE \
62         $(win32)
63
64 CLEANFILES = gst-element-check-@GST_MAJORMINOR@.m4
65
66 include $(top_srcdir)/common/release.mak
67 include $(top_srcdir)/common/po.mak
68
69
70 if GST_GCOV_ENABLED
71 clean-gcov:
72         find -name "*.da" -o -name "*.gcov" | xargs rm || true
73
74 clean-bbg:
75         find -name "*.bbg" -o -name "*.bb" | xargs rm || true
76
77 GCOV_DIRS=gst libs
78
79 ## .PHONY so it always rebuilds it
80 .PHONY: coverage-report.txt test-coverage-report.html
81
82 coverage-report.txt:
83         BBG_FILES=`find $(GCOV_DIRS) -name "*.bbg"` ;                     \
84         C_FILES= ;                                                        \
85         for F in $$BBG_FILES ; do                                         \
86                 F_nolibs=`echo $$F | sed -e 's/.libs\///g'` ;             \
87                 C=`echo $$F_nolibs | sed -e 's/.bbg/.c/g'` ;              \
88                 B=`basename $$F .bbg` ;                                   \
89                 D=`dirname $$F` ;                                         \
90                 DA=`echo $$F | sed -e 's/.bbg/.da/g'` ;                   \
91                 DA_libs=`echo $$D/.libs/$$B/.da` ;                        \
92                 if test -e $$DA || test -e $$DA_libs; then                \
93                         C_FILES="$$C_FILES $$C" ;                         \
94                 fi ;                                                      \
95         done ;                                                            \
96         echo $$C_FILES ;                                                  \
97         $(top_builddir)/testsuite/decode-gcov --report $$C_FILES > coverage-report.txt
98
99 test-coverage-report.html:
100         mkdir -p ./coverage
101         lcov --directory . --zerocounters
102         -$(MAKE) check
103         lcov --directory . --capture --output-file ./coverage/$(PACKAGE).info
104         genhtml -o ./coverage --num-spaces 2 ./coverage/$(PACKAGE).info
105         
106 check-coverage: clean-gcov all check coverage-report.txt
107         cat coverage-report.txt
108
109 else
110 coverage-report.txt:
111         echo "Need to reconfigure with --enable-gcov"
112         
113 test-coverage-report.html:
114         echo "Need to reconfigure with --enable-gcov"
115
116 check-coverage:
117         echo "Need to reconfigure with --enable-gcov"
118 endif
119
120 check-valgrind:
121         cd check && make check-valgrind