* have a friendly buildpackage script here to.
[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 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
8 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
9
10 CFLAGS = -Wall -g
11
12 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
13   CFLAGS += -O0
14 else
15   CFLAGS += -O2 -fno-strict-aliasing
16 endif
17
18 build: build-stamp
19 build-stamp:
20         dh_testdir
21
22 # ./configure
23         CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
24                 --prefix=/usr
25
26 # Build libcitadel
27         $(MAKE)
28
29         touch build-stamp
30
31 clean:
32         dh_testdir
33         dh_testroot
34         rm -f build-stamp install*-stamp
35         [ ! -f Makefile ] || $(MAKE) distclean
36         dh_clean
37
38 install: install-stamp
39 install-stamp: build-stamp
40         dh_testdir
41         dh_testroot
42         dh_clean -k
43         dh_installdirs
44
45         $(MAKE) DESTDIR=`pwd`/debian/tmp install
46
47         touch install-stamp
48
49 # Build architecture-independent files here.
50 binary-indep: build install
51         dh_testdir -i
52         dh_testroot -i
53         dh_installdocs -i -A README
54         dh_installchangelogs -i debian/no-upstream-changelog
55         dh_install -i --sourcedir=debian/tmp
56         dh_link -i
57         dh_strip -i
58         dh_compress -i
59         dh_fixperms -i
60         dh_installdeb -i
61         dh_shlibdeps -i
62         dh_gencontrol -i
63         dh_md5sums -i
64         dh_builddeb -i
65
66 # Build architecture-dependent files here.
67 binary-arch: build install
68         dh_testdir -a
69         dh_testroot -a
70 #       dh_installdocs -plibcitadel1
71         dh_installchangelogs -plibcitadel
72         dh_install -a --sourcedir=debian/tmp
73         dh_link -a
74         dh_strip -a --dbg-package=libcitadel1-dbg
75         dh_compress -a
76         dh_fixperms -a
77         dh_makeshlibs -a -V 'libcitadel1'
78         dh_installdeb -a
79         dh_shlibdeps -a
80         dh_gencontrol -a
81         dh_md5sums -a
82         dh_builddeb -a
83
84 source diff:                                                                  
85         @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
86
87 binary: binary-indep binary-arch
88 .PHONY: build clean binary-indep binary-arch binary install