* StrBufTCP_read_buffered_line_fast(): silence warning of narrow minded compilers
[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 -finline-functions
13 LDFALGS = -finline-functions
14 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
15         CFLAGS += -O0 -ggdb -rdynamic -MD -MP -D DEBUG -D VALGRIND
16         EXTRA_ARGS =  --with-backtrace
17 else
18         CFLAGS += -O2
19 endif
20
21 ifneq (,$(findstring profiling,$(DEB_BUILD_OPTIONS)))
22         CFLAGS += -pg
23         LDFLAGS += -pg
24 endif
25
26 ifneq (,$(findstring sprofiling,$(DEB_BUILD_OPTIONS)))
27         CFLAGS += -D SIZE_DEBUG
28 endif
29
30 ifneq (,$(findstring gcov,$(DEB_BUILD_OPTIONS)))
31         CFLAGS += -fprofile-arcs -ftest-coverage
32         LDFLAGS += -fprofile-arcs -ftest-coverage
33 endif
34
35
36 build: build-stamp
37 build-stamp:
38         dh_testdir
39
40         CFLAGS="$(CFLAGS)"; LDFLAGS="$(LDFLAGS)";  ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
41                 $(EXTRA_ARGS) \
42                 --prefix=/usr
43
44 # Build libcitadel
45         $(MAKE)
46
47         touch build-stamp
48
49 clean:
50         dh_testdir
51         dh_testroot
52         rm -f build-stamp install*-stamp
53
54         [ ! -f Makefile ] || $(MAKE) distclean
55
56         dh_clean
57
58 install: install-stamp
59 install-stamp: build-stamp
60         dh_testdir
61         dh_testroot
62         dh_clean -k
63         dh_installdirs
64
65         $(MAKE) DESTDIR=`pwd`/debian/tmp install
66
67         touch install-stamp
68
69 # Build architecture-independent files here.
70 binary-indep: build install
71 #       dh_testdir -i
72         dh_testroot -i
73 #       dh_installdocs -i -A README
74 #       dh_installchangelogs -i debian/no-upstream-changelog
75 #       dh_install -i --sourcedir=debian/tmp
76 #       dh_link -i
77 #       dh_strip -i
78 #       dh_compress -i
79 #       dh_fixperms -i
80 #       dh_installdeb -i
81 #       dh_shlibdeps -i
82 #       dh_gencontrol -i
83 #       dh_md5sums -i
84 #       dh_builddeb -i
85
86 # Build architecture-dependent files here.
87 binary-arch: build install
88         dh_testdir -a
89         dh_testroot -a
90         dh_installchangelogs -a -plibcitadel2
91         dh_installdocs -a
92         dh_install -a --sourcedir=debian/tmp
93         dh_link -a
94         dh_strip -a --dbg-package=libcitadel2-dbg
95         dh_compress -a
96         dh_fixperms -a
97         dh_makeshlibs -a -V
98         dh_installdeb -a
99         dh_shlibdeps -a
100         dh_gencontrol -a
101         dh_md5sums -a
102         dh_builddeb -a
103
104 source diff:                                                                  
105         @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
106
107 binary: binary-indep binary-arch
108 .PHONY: build clean binary-indep binary-arch binary install