2003-10-16 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_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 $(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         C_FILES= ;                                                                \
60         for F in $$BBG_FILES ; do                                                 \
61                 F_nolibs=`echo $$F | sed -e 's/.libs\///g'` ;                     \
62                 C=`echo $$F_nolibs | sed -e 's/.bbg/.c/g'` ;                      \
63                 B=`basename $$F .bbg` ;                                           \
64                 D=`dirname $$F` ;                                                 \
65                 DA=`echo $$F | sed -e 's/.bbg/.da/g'` ;                           \
66                 DA_libs=`echo $$D/.libs/$$B/.da` ;                                \
67                 if test -e $$DA || test -e $$DA_libs; then                        \
68                         C_FILES="$$C_FILES $$C" ;                                 \
69                 fi ;                                                              \
70         done ;                                                                    \
71         echo $$C_FILES ;                                                          \
72         $(top_builddir)/test/decode-gcov --report $$C_FILES > coverage-report.txt
73
74 check-coverage: clean-gcov all check coverage-report.txt
75         cat coverage-report.txt
76
77 else
78 coverage-report.txt:
79         echo "Need to reconfigure with --enable-gcov"
80
81 check-coverage:
82         echo "Need to reconfigure with --enable-gcov"
83
84 endif