build: add cruft alert for common/shave*
[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 common/m4 -I .
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         common
14
15 # These are all the possible subdirs
16 DIST_SUBDIRS = pkgconfig \
17         gst libs plugins tools tests \
18         docs \
19         po \
20         common
21
22 # include before EXTRA_DIST for win32 assignment
23 include $(top_srcdir)/common/win32.mak
24
25 EXTRA_DIST = \
26         gstreamer.spec gstreamer.spec.in \
27         check-checks.m4 \
28         gst-element-check.m4.in \
29         configure.ac autogen.sh depcomp \
30         MAINTAINERS ABOUT-NLS RELEASE gstreamer.doap \
31         scripts/gst-uninstalled \
32         $(win32)
33
34 CLEANFILES = gst-element-check-@GST_MAJORMINOR@.m4
35
36 DISTCLEANFILES = _stdint.h
37
38 include $(top_srcdir)/common/release.mak
39 include $(top_srcdir)/common/po.mak
40
41 if GST_GCOV_ENABLED
42 clean-gcov:
43         find -name "*.da" -o -name "*.gcov" | xargs rm || true
44
45 clean-bbg:
46         find -name "*.bbg" -o -name "*.bb" | xargs rm || true
47
48 GCOV_DIRS=gst libs
49
50 ## .PHONY so it always rebuilds it
51 .PHONY: coverage-report.txt
52
53 coverage-report.txt:
54         BBG_FILES=`find $(GCOV_DIRS) -name "*.bbg"` ;                     \
55         C_FILES= ;                                                        \
56         for F in $$BBG_FILES ; do                                         \
57                 F_nolibs=`echo $$F | sed -e 's/.libs\///g'` ;             \
58                 C=`echo $$F_nolibs | sed -e 's/.bbg/.c/g'` ;              \
59                 B=`basename $$F .bbg` ;                                   \
60                 D=`dirname $$F` ;                                         \
61                 DA=`echo $$F | sed -e 's/.bbg/.da/g'` ;                   \
62                 DA_libs=`echo $$D/.libs/$$B/.da` ;                        \
63                 if test -e $$DA || test -e $$DA_libs; then                \
64                         C_FILES="$$C_FILES $$C" ;                         \
65                 fi ;                                                      \
66         done ;                                                            \
67         echo $$C_FILES ;                                                  \
68         $(top_builddir)/testsuite/decode-gcov --report $$C_FILES > coverage-report.txt
69
70 check-coverage: clean-gcov all check coverage-report.txt
71         cat coverage-report.txt
72
73 else
74 coverage-report.txt:
75         echo "Need to reconfigure with --enable-gcov"
76
77 check-coverage:
78         echo "Need to reconfigure with --enable-gcov"
79 endif
80
81 if HAVE_CHECK
82 check-valgrind:
83         cd tests/check && make check-valgrind
84
85 check-torture:
86         cd tests/check && make torture
87 else
88 check-valgrind:
89         echo "'check' library not installed, skipping"
90
91 check-torture:
92         echo "'check' library not installed, skipping"
93 endif
94
95 # FIXME: this target should be run every time we do "make release"
96 # find a way of automating that
97 win32-update:
98         for f in gstversion.h gstenumtypes.c gstenumtypes.h; do \
99                 cp $(top_builddir)/gst/$$f win32/common; done
100         $(top_srcdir)/tools/gst-indent win32/common/gstenumtypes.c
101         $(top_srcdir)/tools/gst-indent win32/common/gstenumtypes.c
102         cp $(top_builddir)/win32/common/config.h-new \
103                 $(top_srcdir)/win32/common/config.h
104
105 check-enum-gettypes: $(top_builddir)/gst/gstenumtypes.h
106         @echo 'Checking if all enum and flag _get_type() funcs are inited in gst_init()';                        \
107         FUNCS=`grep '_get_type (' gst/gstenumtypes.h | sed -e 's/^.*gst_/gst_/' -e 's/_get_type.*$$/_get_type/'`;\
108         MISSING_FUNCS='';                                                                                        \
109         for f in $$FUNCS; do                                                                                     \
110           INIT_LINE=`grep $$f $(top_srcdir)/gst/*.c | grep g_type_class_ref`;                                    \
111           if test "x$$INIT_LINE" = "x"; then                                                                     \
112             MISSING_FUNCS="$$MISSING_FUNCS $$f";                                                                 \
113           fi;                                                                                                    \
114         done;                                                                                                    \
115         if test "x$$MISSING_FUNCS" != "x"; then                                                                  \
116           echo "FIXME: please add to the following to gst/gst.c init_post():";                                   \
117           for f in $$MISSING_FUNCS; do                                                                           \
118             echo "  g_type_class_ref ($$f ());";                                                                 \
119           done;                                                                                                  \
120           exit 1;                                                                                                \
121         fi;                                                                                                      \
122         echo 'Checking if all enum and flag _get_type() funcs are deinited in gst_deinit()';                     \
123         MISSING_FUNCS='';                                                                                        \
124         for f in $$FUNCS; do                                                                                     \
125           INIT_LINE=`grep $$f $(top_srcdir)/gst/*.c | grep g_type_class_unref`;                                  \
126           if test "x$$INIT_LINE" = "x"; then                                                                     \
127             MISSING_FUNCS="$$MISSING_FUNCS $$f";                                                                 \
128           fi;                                                                                                    \
129         done;                                                                                                    \
130         if test "x$$MISSING_FUNCS" != "x"; then                                                                  \
131           echo "FIXME: please add to the following to gst/gst.c gst_deinit():";                                  \
132           for f in $$MISSING_FUNCS; do                                                                           \
133             echo "  g_type_class_unref (g_type_class_peek ($$f ()));";                                           \
134           done;                                                                                                  \
135           exit 1;                                                                                                \
136         fi
137
138 include $(top_srcdir)/common/coverage/lcov.mak
139
140 # Do not run the check-exports test in case any option which causes the API to
141 # change has been used
142 if !GST_DISABLE_GST_DEBUG
143 if !GST_DISABLE_LOADSAVE
144 if !GST_DISABLE_REGISTRY
145 if !GST_DISABLE_TRACE
146 CHECK_EXPORTS = check-exports
147 endif
148 endif
149 endif
150 endif
151
152 check: $(CHECK_EXPORTS) check-enum-gettypes
153
154 gst-element-check-@GST_MAJORMINOR@.m4: gst-element-check.m4
155         $(AM_V_GEN)cp gst-element-check.m4 gst-element-check-@GST_MAJORMINOR@.m4
156
157 # cruft: plugins that have been merged or moved or renamed
158
159 CRUFT_FILES = \
160         $(top_builddir)/common/shave \
161         $(top_builddir)/common/shave-libtool
162
163 include $(top_srcdir)/common/cruft.mak
164
165 all-local: gst-element-check-@GST_MAJORMINOR@.m4 check-cruft