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