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