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