* StrBufExtract_token wouldn't reset its target buffer in all conditions.
[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 else
17         CFLAGS += -O2
18 endif
19
20 ifneq (,$(findstring profiling,$(DEB_BUILD_OPTIONS)))
21         CFLAGS += -pg
22         LDFLAGS += -pg
23 endif
24
25 build: build-stamp
26 build-stamp:
27         dh_testdir
28
29 # ./configure
30         CFLAGS="$(CFLAGS)"; LDFLAGS="$(LDFLAGS)";  ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
31                 --prefix=/usr
32
33 # Build libcitadel
34         $(MAKE)
35
36         touch build-stamp
37
38 clean:
39         dh_testdir
40         dh_testroot
41         rm -f build-stamp install*-stamp
42
43         -$(MAKE) distclean
44
45         dh_clean
46
47 install: install-stamp
48 install-stamp: build-stamp
49         dh_testdir
50         dh_testroot
51         dh_clean -k
52         dh_installdirs
53
54         $(MAKE) DESTDIR=`pwd`/debian/tmp install
55
56         touch install-stamp
57
58 # Build architecture-independent files here.
59 binary-indep: build install
60 #       dh_testdir -i
61         dh_testroot -i
62 #       dh_installdocs -i -A README
63 #       dh_installchangelogs -i debian/no-upstream-changelog
64 #       dh_install -i --sourcedir=debian/tmp
65 #       dh_link -i
66 #       dh_strip -i
67 #       dh_compress -i
68 #       dh_fixperms -i
69 #       dh_installdeb -i
70 #       dh_shlibdeps -i
71 #       dh_gencontrol -i
72 #       dh_md5sums -i
73 #       dh_builddeb -i
74
75 # Build architecture-dependent files here.
76 binary-arch: build install
77         dh_testdir -a
78         dh_testroot -a
79 #       dh_installdocs -plibcitadel1
80         dh_installchangelogs -plibcitadel
81         dh_install -a --sourcedir=debian/tmp
82         dh_link -a
83         dh_strip -a --dbg-package=libcitadel1-dbg
84         dh_compress -a
85         dh_fixperms -a
86         dh_makeshlibs -a -V 'libcitadel1'
87         dh_installdeb -a
88         dh_shlibdeps -a
89         dh_gencontrol -a
90         dh_md5sums -a
91         dh_builddeb -a
92
93 source diff:                                                                  
94         @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
95
96 binary: binary-indep binary-arch
97 .PHONY: build clean binary-indep binary-arch binary install