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