* shrink default buffer size from 4K to 64 bytes. Applications that know they need...
[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 LDFALGS = 
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
31 build: build-stamp
32 build-stamp:
33         dh_testdir
34
35         CFLAGS="$(CFLAGS)"; LDFLAGS="$(LDFLAGS)";  ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
36                 $(EXTRA_ARGS) \
37                 --prefix=/usr
38
39 # Build libcitadel
40         $(MAKE)
41
42         touch build-stamp
43
44 clean:
45         dh_testdir
46         dh_testroot
47         rm -f build-stamp install*-stamp
48
49         [ ! -f Makefile ] || $(MAKE) distclean
50
51         dh_clean
52
53 install: install-stamp
54 install-stamp: build-stamp
55         dh_testdir
56         dh_testroot
57         dh_clean -k
58         dh_installdirs
59
60         $(MAKE) DESTDIR=`pwd`/debian/tmp install
61
62         touch install-stamp
63
64 # Build architecture-independent files here.
65 binary-indep: build install
66 #       dh_testdir -i
67         dh_testroot -i
68 #       dh_installdocs -i -A README
69 #       dh_installchangelogs -i debian/no-upstream-changelog
70 #       dh_install -i --sourcedir=debian/tmp
71 #       dh_link -i
72 #       dh_strip -i
73 #       dh_compress -i
74 #       dh_fixperms -i
75 #       dh_installdeb -i
76 #       dh_shlibdeps -i
77 #       dh_gencontrol -i
78 #       dh_md5sums -i
79 #       dh_builddeb -i
80
81 # Build architecture-dependent files here.
82 binary-arch: build install
83         dh_testdir -a
84         dh_testroot -a
85         dh_installchangelogs -a -plibcitadel2
86         dh_installdocs -a
87         dh_install -a --sourcedir=debian/tmp
88         dh_link -a
89         dh_strip -a --dbg-package=libcitadel2-dbg
90         dh_compress -a
91         dh_fixperms -a
92         dh_makeshlibs -a -V
93         dh_installdeb -a
94         dh_shlibdeps -a
95         dh_gencontrol -a
96         dh_md5sums -a
97         dh_builddeb -a
98
99 source diff:                                                                  
100         @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
101
102 binary: binary-indep binary-arch
103 .PHONY: build clean binary-indep binary-arch binary install