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