* src/widgets/modest-window.c:
[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 endif
38
39
40 config.status: configure
41         dh_testdir
42         # commands to configure the package.
43         if [ ! -x configure ]; then ./autogen.sh; fi
44         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
45
46 configure: configure-stamp
47 configure-stamp:
48         dh_testdir
49         ./autogen.sh
50         touch configure-stamp
51
52 build: build-stamp
53
54 build-stamp:  config.status
55         dh_testdir
56
57         # commands to compile the package.
58         $(MAKE) \
59          MAEMO_LAUNCHER_CFLAGS="$(LAUNCHER_CFLAGS)" \
60          MAEMO_LAUNCHER_LDFLAGS="$(LAUNCHER_LDFLAGS)"
61         touch build-stamp
62
63 clean:
64         dh_testdir
65         dh_testroot
66         rm -f build-stamp 
67
68 # commands to clean up after the build process.
69         -$(MAKE) distclean
70 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
71         cp -f /usr/share/misc/config.sub config.sub
72 endif
73 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
74         cp -f /usr/share/misc/config.guess config.guess
75 endif
76         dh_clean 
77
78 install: build
79         dh_testdir
80         dh_testroot
81         dh_clean -k 
82         dh_installdirs
83
84 # install the package into debian/tmp/
85         $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
86
87 ifeq "$(strip $(LAUNCHER))" "yes"
88         mv $(CURDIR)/debian/tmp/usr/bin/modest \
89         $(CURDIR)/debian/modest/usr/bin/modest.launch
90         ln -s /usr/bin/maemo-invoker \
91         $(CURDIR)/debian/modest/usr/bin/modest
92 endif
93
94 # Build architecture-independent files here.
95 binary-indep: build install
96 # We have nothing to do by default.
97
98 # Build architecture-dependent files here.
99 binary-arch: build install
100         dh_testdir
101         dh_testroot
102         dh_installchangelogs 
103         dh_installdocs
104         dh_installexamples
105         dh_install --sourcedir=debian/tmp -v
106         dh_installmenu
107 #       dh_installdebconf       
108 #       dh_installlogrotate
109 #       dh_installemacsen
110 #       dh_installpam
111 #       dh_installmime
112 #       dh_installinit
113 #       dh_installcron
114 #       dh_installinfo
115         dh_installman
116         dh_link
117         dh_strip --keep-debug --dbg-package=modest --dbg-package=libmodest-dbus-client
118         dh_compress
119         dh_fixperms
120 #       dh_perl
121 #       dh_python
122         dh_makeshlibs
123         dh_installdeb
124         dh_shlibdeps
125         dh_gencontrol -- $(LAUNCHER_DEPENDS)
126         dh_md5sums
127         dh_builddeb
128
129 binary: binary-indep binary-arch
130 .PHONY: build clean binary-indep binary-arch binary install