* optimization of modest_text_utils_get_display_date,
[modest] / debian / rules
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3
4 # Uncomment this to turn on verbose mode.
5 #export DH_VERBOSE=1
6
7 # These are used for cross-compiling and for saving the configure script
8 # from having to guess our platform (since we know it already)
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 PACKAGENAME = modest
14
15 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
16         CFLAGS += -O0
17 else
18         CFLAGS += -O2
19 endif
20 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
21         INSTALL_PROGRAM += -s
22 endif
23
24 ifneq (,$(findstring thumb,$(DEB_BUILD_OPTIONS)))
25         CFLAGS += -mthumb
26 endif
27
28 LAUNCHER = no
29 #ifneq (,$(findstring maemo-launcher,$(DEB_BUILD_OPTIONS)))
30 #       LAUNCHER = yes
31 #endif
32
33 ifeq "$(strip $(LAUNCHER))" "yes"
34         LAUNCHER_DEPENDS = -Vlauncher:Depends="maemo-launcher"
35         LAUNCHER_CFLAGS = -shared
36         LAUNCHER_LDFLAGS = -pie -shared -export-dynamic
37         CFLAGS += -fPIC
38 endif
39
40
41 config.status: configure
42         dh_testdir
43         # commands to configure the package.
44         if [ ! -x configure ]; then ./autogen.sh; fi
45         CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --sysconfdir=/etc --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info
46
47 configure: configure-stamp
48 configure-stamp:
49         dh_testdir
50         ./autogen.sh
51         touch configure-stamp
52
53 build: build-stamp
54
55 build-stamp:  config.status
56         dh_testdir
57
58         # commands to compile the package.
59         $(MAKE) \
60          MAEMO_LAUNCHER_CFLAGS="$(LAUNCHER_CFLAGS)" \
61          MAEMO_LAUNCHER_LDFLAGS="$(LAUNCHER_LDFLAGS)"
62         touch build-stamp
63
64 clean:
65         dh_testdir
66         dh_testroot
67         rm -f build-stamp 
68
69 # commands to clean up after the build process.
70         -$(MAKE) distclean
71 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
72         cp -f /usr/share/misc/config.sub config.sub
73 endif
74 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
75         cp -f /usr/share/misc/config.guess config.guess
76 endif
77         dh_clean 
78
79 install: build
80         dh_testdir
81         dh_testroot
82         dh_clean -k 
83         dh_installdirs
84
85 # install the package into debian/tmp/
86         $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
87
88 ifeq "$(strip $(LAUNCHER))" "yes"
89         mv $(CURDIR)/debian/tmp/usr/bin/modest \
90         $(CURDIR)/debian/modest/usr/bin/modest.launch
91         ln -s /usr/bin/maemo-invoker \
92         $(CURDIR)/debian/modest/usr/bin/modest
93 endif
94
95 # Build architecture-independent files here.
96 binary-indep: build install
97 # We have nothing to do by default.
98
99 # Build architecture-dependent files here.
100 binary-arch: build install
101         dh_testdir
102         dh_testroot
103         dh_installchangelogs 
104         dh_installdocs
105         dh_installexamples
106         dh_install --sourcedir=debian/tmp -v
107         dh_installmenu
108 #       dh_installdebconf       
109 #       dh_installlogrotate
110 #       dh_installemacsen
111 #       dh_installpam
112 #       dh_installmime
113 #       dh_installinit
114 #       dh_installcron
115 #       dh_installinfo
116         dh_installman
117         dh_link
118         dh_strip --keep-debug --dbg-package=modest --dbg-package=libmodest-dbus-client
119         dh_compress
120         dh_fixperms
121 #       dh_perl
122 #       dh_python
123         dh_makeshlibs
124         dh_installdeb
125         dh_shlibdeps
126         dh_gencontrol -- $(LAUNCHER_DEPENDS)
127         dh_md5sums
128         dh_builddeb
129
130 binary: binary-indep binary-arch
131 .PHONY: build clean binary-indep binary-arch binary install