enable docs build for distcheck
[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         include 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         include libs gst \
47         tools \
48         check \
49         tests testsuite \
50         examples \
51         docs \
52         pkgconfig \
53         po \
54         common
55
56 win32 = $(shell cat $(top_srcdir)/win32/MANIFEST)
57
58 debug:
59         echo $(win32)
60 EXTRA_DIST = \
61         gstreamer.spec gstreamer.spec.in gst-element-check.m4 \
62         configure.ac autogen.sh depcomp \
63         REQUIREMENTS ABOUT-NLS DOCBUILDING DEVEL RELEASE \
64         $(win32) \
65         idiottest.mak
66
67 CLEANFILES = gst-element-check-@GST_MAJORMINOR@.m4
68
69 include $(top_srcdir)/idiottest.mak
70 include $(top_srcdir)/common/release.mak
71 include $(top_srcdir)/common/po.mak
72
73
74 if GST_GCOV_ENABLED
75 clean-gcov:
76         find -name "*.da" -o -name "*.gcov" | xargs rm || true
77
78 clean-bbg:
79         find -name "*.bbg" -o -name "*.bb" | xargs rm || true
80
81 GCOV_DIRS=gst libs
82
83 ## .PHONY so it always rebuilds it
84 .PHONY: coverage-report.txt test-coverage-report.html
85
86 coverage-report.txt:
87         BBG_FILES=`find $(GCOV_DIRS) -name "*.bbg"` ;                     \
88         C_FILES= ;                                                        \
89         for F in $$BBG_FILES ; do                                         \
90                 F_nolibs=`echo $$F | sed -e 's/.libs\///g'` ;             \
91                 C=`echo $$F_nolibs | sed -e 's/.bbg/.c/g'` ;              \
92                 B=`basename $$F .bbg` ;                                   \
93                 D=`dirname $$F` ;                                         \
94                 DA=`echo $$F | sed -e 's/.bbg/.da/g'` ;                   \
95                 DA_libs=`echo $$D/.libs/$$B/.da` ;                        \
96                 if test -e $$DA || test -e $$DA_libs; then                \
97                         C_FILES="$$C_FILES $$C" ;                         \
98                 fi ;                                                      \
99         done ;                                                            \
100         echo $$C_FILES ;                                                  \
101         $(top_builddir)/testsuite/decode-gcov --report $$C_FILES > coverage-report.txt
102
103 test-coverage-report.html:
104         mkdir -p ./coverage
105         lcov --directory . --zerocounters
106         -$(MAKE) check
107         lcov --directory . --capture --output-file ./coverage/$(PACKAGE).info
108         genhtml -o ./coverage --num-spaces 2 ./coverage/$(PACKAGE).info
109         
110 check-coverage: clean-gcov all check coverage-report.txt
111         cat coverage-report.txt
112
113 else
114 coverage-report.txt:
115         echo "Need to reconfigure with --enable-gcov"
116         
117 test-coverage-report.html:
118         echo "Need to reconfigure with --enable-gcov"
119
120 check-coverage:
121         echo "Need to reconfigure with --enable-gcov"
122 endif