* add VALGRIND flag to debian debug flag to make valgrind produce less noise in the...
[citadel.git] / libcitadel / debian / rules
1 #!/usr/bin/make -f
2 # -*- mode: makefile; coding: utf-8 -*-
3
4 # Uncomment this to turn on verbose mode.
5 #export DH_VERBOSE=1
6
7 export DH_COMPAT = 5
8
9 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
10 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
11
12 CFLAGS = -Wall -g
13
14 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
15         CFLAGS += -O0 -ggdb -rdynamic -MD -MP -D DEBUG -D VALGRIND
16 else
17         CFLAGS += -O2
18 endif
19
20 build: build-stamp
21 build-stamp:
22         dh_testdir
23
24 # ./configure
25         CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
26                 --prefix=/usr
27
28 # Build libcitadel
29         $(MAKE)
30
31         touch build-stamp
32
33 clean:
34         dh_testdir
35         dh_testroot
36         rm -f build-stamp install*-stamp
37
38         -$(MAKE) distclean
39
40         dh_clean
41
42 install: install-stamp
43 install-stamp: build-stamp
44         dh_testdir
45         dh_testroot
46         dh_clean -k
47         dh_installdirs
48
49         $(MAKE) DESTDIR=`pwd`/debian/tmp install
50
51         touch install-stamp
52
53 # Build architecture-independent files here.
54 binary-indep: build install
55 #       dh_testdir -i
56         dh_testroot -i
57 #       dh_installdocs -i -A README
58 #       dh_installchangelogs -i debian/no-upstream-changelog
59 #       dh_install -i --sourcedir=debian/tmp
60 #       dh_link -i
61 #       dh_strip -i
62 #       dh_compress -i
63 #       dh_fixperms -i
64 #       dh_installdeb -i
65 #       dh_shlibdeps -i
66 #       dh_gencontrol -i
67 #       dh_md5sums -i
68 #       dh_builddeb -i
69
70 # Build architecture-dependent files here.
71 binary-arch: build install
72         dh_testdir -a
73         dh_testroot -a
74 #       dh_installdocs -plibcitadel1
75         dh_installchangelogs -plibcitadel
76         dh_install -a --sourcedir=debian/tmp
77         dh_link -a
78         dh_strip -a --dbg-package=libcitadel1-dbg
79         dh_compress -a
80         dh_fixperms -a
81         dh_makeshlibs -a -V 'libcitadel1'
82         dh_installdeb -a
83         dh_shlibdeps -a
84         dh_gencontrol -a
85         dh_md5sums -a
86         dh_builddeb -a
87
88 source diff:                                                                  
89         @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
90
91 binary: binary-indep binary-arch
92 .PHONY: build clean binary-indep binary-arch binary install