2004-12-24 Havoc Pennington <hp@redhat.com>
[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_CSC
16    MONO_SUBDIR=mono
17    MONO_PC=dbus-sharp.pc
18 endif
19
20 if HAVE_PYTHON
21    PYTHON_SUBDIR=python
22 endif
23
24 ## really we should require gcj/mcs/python also but since they are 
25 ## annoying to install, we don't for now
26 dist-local:
27         if test -z "$(QT_SUBDIR)" || test -z "$(GLIB_SUBDIR)" ; then            \
28                 echo "You have to build with Qt and GLib to make dist" ;        \
29         fi 
30
31 SUBDIRS=dbus bus doc $(GLIB_SUBDIR) $(GCJ_SUBDIR) $(MONO_SUBDIR) $(QT_SUBDIR) $(PYTHON_SUBDIR) test tools
32 DIST_SUBDIRS=dbus bus doc glib qt gcj mono python test tools
33
34 pkgconfigdir = $(libdir)/pkgconfig
35 pkgconfig_DATA = dbus-1.pc $(GLIB_PC) $(MONO_PC)
36
37 DISTCLEANFILES =                \
38         dbus-1.pc               \
39         $(GLIB_PC)              \
40         $(MONO_PC)
41
42 EXTRA_DIST =                    \
43         HACKING                 \
44         dbus-1.pc.in            \
45         dbus-glib-1.pc.in       \
46         dbus-sharp.pc.in
47
48 all-local: Doxyfile
49
50 if DBUS_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=dbus bus $(GLIB_SUBDIR) $(QT_SUBDIR)
58
59 ## .PHONY so it always rebuilds it
60 .PHONY: coverage-report.txt
61 coverage-report.txt:
62         BBG_FILES=`find $(GCOV_DIRS) -name "*.bbg" -o -name "*.gcno"` ;                 \
63         C_FILES= ;                                                                      \
64         for F in $$BBG_FILES ; do                                                       \
65                 F_nolibs=`echo $$F | sed -e 's/.libs\///g'` ;                           \
66                 C=`echo $$F_nolibs | sed -e 's/.bbg/.c/g' | sed -e 's/.gcno/.c/g'`  ;   \
67                 B=`basename $$F .bbg` ;                                                 \
68                 D=`dirname $$F` ;                                                       \
69                 DA=`echo $$F | sed -e 's/.bbg/.da/g'` ;                                 \
70                 DA_libs=`echo $$D/.libs/$$B/.da` ;                                      \
71                 if test -e $$DA || test -e $$DA_libs; then                              \
72                         C_FILES="$$C_FILES $$C" ;                                       \
73                 fi ;                                                                    \
74         done ;                                                                          \
75         echo $$C_FILES ;                                                                \
76         $(top_builddir)/test/decode-gcov --report $$C_FILES > coverage-report.txt
77
78 check-coverage: clean-gcov all check coverage-report.txt
79         cat coverage-report.txt
80
81 else
82 coverage-report.txt:
83         echo "Need to reconfigure with --enable-gcov"
84
85 check-coverage:
86         echo "Need to reconfigure with --enable-gcov"
87
88 endif