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