a002b96cce0d3d9d3fc8c052f263d24ff1fa2a99
[platform/upstream/gstreamer.git] / Makefile.am
1 DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc --enable-docbook
2
3 # note: keep in sync with configure.ac
4 ACLOCAL_AMFLAGS = -I m4 -I common/m4
5
6 aclocaldir = $(datadir)/aclocal
7 aclocal_DATA = gst-element-check-@GST_API_VERSION@.m4
8
9 SUBDIRS = pkgconfig \
10         gst libs plugins tests \
11         docs \
12         po \
13         m4 \
14         common \
15         data
16
17 if BUILD_TOOLS
18 SUBDIRS += tools
19 endif
20
21 # These are all the possible subdirs
22 DIST_SUBDIRS = pkgconfig \
23         gst libs plugins tools tests \
24         docs \
25         po \
26         m4 \
27         common
28
29 # include before EXTRA_DIST for win32 assignment
30 include $(top_srcdir)/common/win32.mak
31
32 EXTRA_DIST = \
33         gstreamer.spec gstreamer.spec.in \
34         gst-element-check.m4 \
35         configure.ac autogen.sh depcomp \
36         MAINTAINERS ABOUT-NLS RELEASE gstreamer.doap \
37         scripts/gst-uninstalled \
38         $(win32)
39
40 CLEANFILES = gst-element-check-@GST_API_VERSION@.m4
41
42 DISTCLEANFILES = _stdint.h
43
44 include $(top_srcdir)/common/release.mak
45 include $(top_srcdir)/common/po.mak
46
47 if GST_GCOV_ENABLED
48 clean-gcov:
49         find -name "*.da" -o -name "*.gcov" | xargs rm || true
50
51 clean-bbg:
52         find -name "*.bbg" -o -name "*.bb" | xargs rm || true
53
54 GCOV_DIRS=gst libs
55
56 ## .PHONY so it always rebuilds it
57 .PHONY: coverage-report.txt
58
59 coverage-report.txt:
60         BBG_FILES=`find $(GCOV_DIRS) -name "*.bbg"` ;                     \
61         C_FILES= ;                                                        \
62         for F in $$BBG_FILES ; do                                         \
63                 F_nolibs=`echo $$F | sed -e 's/.libs\///g'` ;             \
64                 C=`echo $$F_nolibs | sed -e 's/.bbg/.c/g'` ;              \
65                 B=`basename $$F .bbg` ;                                   \
66                 D=`dirname $$F` ;                                         \
67                 DA=`echo $$F | sed -e 's/.bbg/.da/g'` ;                   \
68                 DA_libs=`echo $$D/.libs/$$B/.da` ;                        \
69                 if test -e $$DA || test -e $$DA_libs; then                \
70                         C_FILES="$$C_FILES $$C" ;                         \
71                 fi ;                                                      \
72         done ;                                                            \
73         echo $$C_FILES ;                                                  \
74         $(top_builddir)/testsuite/decode-gcov --report $$C_FILES > coverage-report.txt
75
76 check-coverage: clean-gcov all check coverage-report.txt
77         cat coverage-report.txt
78
79 else
80 coverage-report.txt:
81         echo "Need to reconfigure with --enable-gcov"
82
83 check-coverage:
84         echo "Need to reconfigure with --enable-gcov"
85 endif
86
87 if HAVE_CHECK
88 check-valgrind:
89         $(MAKE) -C tests/check check-valgrind
90
91 check-torture:
92         $(MAKE) -C tests/check torture
93
94 build-checks:
95         $(MAKE) -C tests/check build-checks
96 else
97 check-valgrind:
98         echo "'check' library not installed, skipping"
99
100 check-torture:
101         echo "'check' library not installed, skipping"
102
103 build-checks:
104         echo "'check' library not installed, skipping"
105 endif
106
107 # FIXME: this target should be run every time we do "make release"
108 # find a way of automating that
109 win32-update:
110         for f in gstversion.h gstenumtypes.c gstenumtypes.h; do \
111                 cp $(top_builddir)/gst/$$f win32/common; done
112         $(top_srcdir)/tools/gst-indent win32/common/gstenumtypes.c
113         $(top_srcdir)/tools/gst-indent win32/common/gstenumtypes.c
114         cp $(top_builddir)/win32/common/config.h-new \
115                 $(top_srcdir)/win32/common/config.h
116
117 check-enum-gettypes: $(top_builddir)/gst/gstenumtypes.h
118         @echo 'Checking if all enum and flag _get_type() funcs are inited in gst_init()';                        \
119         FUNCS=`grep '_get_type (' gst/gstenumtypes.h | sed -e 's/^.*gst_/gst_/' -e 's/_get_type.*$$/_get_type/'`;\
120         MISSING_FUNCS='';                                                                                        \
121         for f in $$FUNCS; do                                                                                     \
122           INIT_LINE=`grep $$f $(top_srcdir)/gst/*.c | grep g_type_class_ref`;                                    \
123           if test "x$$INIT_LINE" = "x"; then                                                                     \
124             MISSING_FUNCS="$$MISSING_FUNCS $$f";                                                                 \
125           fi;                                                                                                    \
126         done;                                                                                                    \
127         if test "x$$MISSING_FUNCS" != "x"; then                                                                  \
128           echo "FIXME: please add to the following to gst/gst.c init_post():";                                   \
129           for f in $$MISSING_FUNCS; do                                                                           \
130             echo "  g_type_class_ref ($$f ());";                                                                 \
131           done;                                                                                                  \
132           exit 1;                                                                                                \
133         fi;                                                                                                      \
134         echo 'Checking if all enum and flag _get_type() funcs are deinited in gst_deinit()';                     \
135         MISSING_FUNCS='';                                                                                        \
136         for f in $$FUNCS; do                                                                                     \
137           INIT_LINE=`grep $$f $(top_srcdir)/gst/*.c | grep g_type_class_unref`;                                  \
138           if test "x$$INIT_LINE" = "x"; then                                                                     \
139             MISSING_FUNCS="$$MISSING_FUNCS $$f";                                                                 \
140           fi;                                                                                                    \
141         done;                                                                                                    \
142         if test "x$$MISSING_FUNCS" != "x"; then                                                                  \
143           echo "FIXME: please add to the following to gst/gst.c gst_deinit():";                                  \
144           for f in $$MISSING_FUNCS; do                                                                           \
145             echo "  g_type_class_unref (g_type_class_peek ($$f ()));";                                           \
146           done;                                                                                                  \
147           exit 1;                                                                                                \
148         fi
149
150 include $(top_srcdir)/common/coverage/lcov.mak
151
152 # Do not run the check-exports test in case any option which causes the API to
153 # change has been used
154 if !GST_DISABLE_REGISTRY
155 if !GST_DISABLE_TRACE
156 CHECK_EXPORTS = check-exports
157 endif
158 endif
159
160 check: $(CHECK_EXPORTS) check-enum-gettypes
161
162 gst-element-check-@GST_API_VERSION@.m4: gst-element-check.m4
163         $(AM_V_GEN)cp $(srcdir)/gst-element-check.m4 gst-element-check-@GST_API_VERSION@.m4
164
165 # cruft: plugins that have been merged or moved or renamed
166
167 CRUFT_FILES = \
168         $(top_builddir)/common/shave \
169         $(top_builddir)/common/shave-libtool \
170         $(top_builddir)/common/m4/codeset.m4 \
171         $(top_builddir)/common/m4/gettext.m4 \
172         $(top_builddir)/common/m4/glibc2.m4 \
173         $(top_builddir)/common/m4/glibc21.m4 \
174         $(top_builddir)/common/m4/iconv.m4 \
175         $(top_builddir)/common/m4/intdiv0.m4 \
176         $(top_builddir)/common/m4/intl.m4 \
177         $(top_builddir)/common/m4/intldir.m4 \
178         $(top_builddir)/common/m4/intlmacosx.m4 \
179         $(top_builddir)/common/m4/intmax.m4 \
180         $(top_builddir)/common/m4/inttypes-pri.m4 \
181         $(top_builddir)/common/m4/inttypes_h.m4 \
182         $(top_builddir)/common/m4/lcmessage.m4 \
183         $(top_builddir)/common/m4/lib-ld.m4 \
184         $(top_builddir)/common/m4/lib-link.m4 \
185         $(top_builddir)/common/m4/lib-prefix.m4 \
186         $(top_builddir)/common/m4/libtool.m4 \
187         $(top_builddir)/common/m4/lock.m4 \
188         $(top_builddir)/common/m4/longlong.m4 \
189         $(top_builddir)/common/m4/ltoptions.m4 \
190         $(top_builddir)/common/m4/ltsugar.m4 \
191         $(top_builddir)/common/m4/ltversion.m4 \
192         $(top_builddir)/common/m4/lt~obsolete.m4 \
193         $(top_builddir)/common/m4/nls.m4 \
194         $(top_builddir)/common/m4/po.m4 \
195         $(top_builddir)/common/m4/printf-posix.m4 \
196         $(top_builddir)/common/m4/progtest.m4 \
197         $(top_builddir)/common/m4/size_max.m4 \
198         $(top_builddir)/common/m4/stdint_h.m4 \
199         $(top_builddir)/common/m4/uintmax_t.m4 \
200         $(top_builddir)/common/m4/visibility.m4 \
201         $(top_builddir)/common/m4/wchar_t.m4 \
202         $(top_builddir)/common/m4/wint_t.m4 \
203         $(top_builddir)/common/m4/xsize.m4
204
205 CRUFT_DIRS = \
206         $(top_builddir)/tests/examples/xml \
207         $(top_builddir)/gst/tmp-introspect* \
208         $(top_builddir)/libs/gst/*/tmp-introspect*
209
210 include $(top_srcdir)/common/cruft.mak
211
212 all-local: gst-element-check-@GST_API_VERSION@.m4 check-cruft