define DBUS_BUILD_TESTS only if the option is enabled (cherry picked from commit...
[platform/upstream/dbus.git] / Makefile.am
1 SUBDIRS=dbus bus doc tools test
2 DIST_SUBDIRS=dbus bus doc tools test
3
4 pkgconfigdir = $(libdir)/pkgconfig
5 pkgconfig_DATA = dbus-1.pc 
6
7 DISTCLEANFILES =                \
8         dbus-1.pc
9
10 EXTRA_DIST =                    \
11         HACKING                 \
12         dbus-1.pc.in            \
13         cleanup-man-pages.sh    \
14         ChangeLog.pre-1-0       \
15         NEWS.pre-1-0            \
16         ChangeLog.pre-1-2       \
17         NEWS.pre-1-2
18
19 all-local: Doxyfile
20
21 if DBUS_GCOV_ENABLED
22 clean-gcov:
23         find -name "*.da" -o -name "*.gcov" | xargs rm || true
24
25 clean-bbg:
26         find -name "*.bbg" -o -name "*.bb" | xargs rm || true
27
28 GCOV_DIRS=dbus bus
29
30 ## .PHONY so it always rebuilds it
31 .PHONY: coverage-report.txt
32 coverage-report.txt:
33         BBG_FILES=`find $(GCOV_DIRS) -name "*.bbg" -o -name "*.gcno"` ;                 \
34         C_FILES= ;                                                                      \
35         for F in $$BBG_FILES ; do                                                       \
36                 F_nolibs=`echo $$F | sed -e 's/.libs\///g'` ;                           \
37                 C=`echo $$F_nolibs | sed -e 's/.bbg/.c/g' | sed -e 's/.gcno/.c/g'`  ;   \
38                 B=`basename $$F .bbg` ;                                                 \
39                 D=`dirname $$F` ;                                                       \
40                 DA=`echo $$F | sed -e 's/.bbg/.da/g'` ;                                 \
41                 DA_libs=`echo $$D/.libs/$$B/.da` ;                                      \
42                 if test -e $$DA || test -e $$DA_libs; then                              \
43                         C_FILES="$$C_FILES $$C" ;                                       \
44                 fi ;                                                                    \
45         done ;                                                                          \
46         echo $$C_FILES ;                                                                \
47         $(top_builddir)/test/decode-gcov --report $$C_FILES > coverage-report.txt
48
49 check-coverage: clean-gcov all check coverage-report.txt
50         cat coverage-report.txt
51
52 else
53 coverage-report.txt:
54         echo "Need to reconfigure with --enable-gcov"
55
56 check-coverage:
57         echo "Need to reconfigure with --enable-gcov"
58
59 endif