fce48628f3a51ea07e388321a28729ffcd77056d
[platform/upstream/dbus.git] / Makefile.am
1
2 if HAVE_GLIB
3     GLIB_SUBDIR=glib
4     GLIB_PC=dbus-glib-1.pc
5 endif
6
7 if HAVE_QT
8    QT_SUBDIR=qt
9 endif
10
11 if DBUS_USE_GCJ
12    GCJ_SUBDIR=gcj
13 endif
14
15 if DBUS_USE_MCS
16    MONO_SUBDIR=mono
17 endif
18
19 if HAVE_PYTHON
20    PYTHON_SUBDIR=python
21 endif
22
23 ## really we should require gcj/mcs/python also but since they are 
24 ## annoying to install, we don't for now
25 dist-local:
26         if test -z "$(QT_SUBDIR)" || test -z "$(GLIB_SUBDIR)" ; then            \
27                 echo "You have to build with Qt and GLib to make dist" ;        \
28         fi 
29
30 SUBDIRS=dbus bus doc $(GLIB_SUBDIR) $(GCJ_SUBDIR) $(MONO_SUBDIR) $(QT_SUBDIR) $(PYTHON_SUBDIR) test tools
31
32 pkgconfigdir = $(libdir)/pkgconfig
33 pkgconfig_DATA = dbus-1.pc $(GLIB_PC)
34
35 DISTCLEANFILES =                \
36         dbus-1.pc               \
37         $(GLIB_PC)
38
39 EXTRA_DIST =                    \
40         HACKING                 \
41         dbus-1.pc.in            \
42         dbus-glib-1.pc.in
43
44 all-local: Doxyfile
45
46 if DBUS_GCOV_ENABLED
47 clean-gcov:
48         find -name "*.da" -o -name "*.gcov" | xargs rm || true
49
50 clean-bbg:
51         find -name "*.bbg" -o -name "*.bb" | xargs rm || true
52
53 GCOV_DIRS=dbus bus test $(GLIB_SUBDIR) $(QT_SUBDIR)
54
55 ## .PHONY so it always rebuilds it
56 .PHONY: coverage-report.txt
57 coverage-report.txt:
58         BBG_FILES=`find $(GCOV_DIRS) -name "*.bbg"` ;                                   \
59         for F in $$BBG_FILES ; do                                                       \
60                 F_nolibs=`echo $$F | sed -e 's/.libs\///g'` ;                           \
61                 if test $$F != $$F_nolibs ; then                                        \
62                         echo "Moving $$F to $$F_nolibs" ;                               \
63                         mv -f $$F $$F_nolibs ;                                          \
64                 fi ;                                                                    \
65         done    ;                                                                       \
66         DA_FILES=`find $(GCOV_DIRS) -name "*.da"` ;                                     \
67         for F in $$DA_FILES ; do                                                        \
68                 F_nolibs=`echo $$F | sed -e 's/.libs\///g'` ;                           \
69                 if test $$F != $$F_nolibs ; then                                        \
70                         echo "Moving $$F to $$F_nolibs" ;                               \
71                         mv -f $$F $$F_nolibs ;                                          \
72                 fi ;                                                                    \
73         done    ;                                                                       \
74         BBG_FILES=`find $(GCOV_DIRS) -name "*.bbg"` ;                                   \
75         C_FILES= ;                                                                      \
76         for F in $$BBG_FILES ; do                                                       \
77                 C=`echo $$F | sed -e 's/.bbg/.c/g'` ;                                   \
78                 DA=`echo $$F | sed -e 's/.bbg/.da/g'` ;                                 \
79                 if test -e $$DA ; then                                                  \
80                         C_FILES="$$C_FILES $$C" ;                                       \
81                 fi ;                                                                    \
82         done ;                                                                          \
83         echo $$C_FILES ;                                                                \
84         $(top_builddir)/test/decode-gcov --report $$C_FILES > coverage-report.txt
85
86 check-coverage: clean-gcov all check coverage-report.txt
87         cat coverage-report.txt
88
89 else
90 coverage-report.txt:
91         echo "Need to reconfigure with --enable-gcov"
92
93 check-coverage:
94         echo "Need to reconfigure with --enable-gcov"
95
96 endif