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