changes to fix compilation under maemo5 - provided by Darren Long
[monky] / 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 DEB_HOST_ARCH_OS    ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
12 DEB_HOST_ARCH_CPU   ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
13
14 CFLAGS = -Wall -g
15 LDFLAGS = -Wl,--as-needed
16
17 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
18         CFLAGS += -O0
19 else
20         CFLAGS += -O2
21 endif
22
23 ifeq ($(DEB_HOST_ARCH_OS),linux)
24        LINUX_CONF_ARGS_STD=--enable-wlan
25        LINUX_CONF_ARGS_ALL=--enable-wlan --enable-ibm
26 endif
27
28 ifeq ($(DEB_HOST_ARCH_CPU),i386)
29        ENABLE_NVIDIA=--enable-nvidia
30 endif
31
32 ifeq ($(DEB_HOST_ARCH_CPU),amd64)
33        ENABLE_NVIDIA=--enable-nvidia
34 endif
35
36 COMMON_CONFIGURE_FLAGS = --host=$(DEB_HOST_GNU_TYPE) \
37                          --build=$(DEB_BUILD_GNU_TYPE) \
38                          --prefix=/usr --sysconfdir=/etc \
39                          --mandir=\$${prefix}/share/man \
40                          --infodir=\$${prefix}/share/info \
41                          --srcdir=..
42
43 configure: config-stamp
44
45 config-stamp:
46         dh_testdir
47
48         chmod +x ./autogen.sh
49         AUTOMAKE=automake ./autogen.sh
50
51         ln -sf /usr/share/misc/config.sub .
52         ln -sf /usr/share/misc/config.guess .
53
54         mkdir build-std build-cli build-all
55
56 #DML#           cd build-std && CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
57 #DML#           ../configure $(COMMON_CONFIGURE_FLAGS) $(LINUX_CONF_ARGS_STD)
58
59 #DML#   cd build-cli && CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
60 #DML#   ../configure $(COMMON_CONFIGURE_FLAGS) \
61 #DML#   --disable-lua --disable-double-buffer --disable-x11 \
62 #DML#   --disable-xdamage --disable-own-window --disable-xft \
63 #DML#   --disable-hddtemp --disable-alsa --disable-portmon \
64 #DML#   --enable-ncurses
65
66         cd build-all && CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
67         ../configure $(COMMON_CONFIGURE_FLAGS) \
68         --enable-imlib2=no --enable-rss --enable-weather-xoap \
69         --enable-eve --enable-lua=no --enable-lua-cairo=no --enable-lua-imlib2=no \
70         --disable-static --enable-argb \
71         $(LINUX_CONF_ARGS_ALL) $(ENABLE_NVIDIA)
72
73         touch $@
74
75 build: build-stamp
76
77 build-stamp: config-stamp
78         dh_testdir
79
80 #DML#   cd build-std && $(MAKE)
81 #DML#   cd build-cli && $(MAKE)
82         cd build-all && $(MAKE)
83
84         touch $@
85
86 clean:
87         dh_testdir
88         dh_testroot
89
90         rm -f  build-stamp config-stamp
91
92         rm  -f configure.ac configure config.h.in src/config.h.in \
93                src/defconfig.h compile install-sh missing ltmain.sh depcomp \
94                Makefile.in doc/Makefile.in src/Makefile.in \
95                data/Makefile.in lua/Makefile.in \
96                aclocal.m4 m4/libtool.m4 m4/ltversion.m4 \
97                m4/lt~obsolete.m4 m4/ltoptions.m4 m4/ltsugar.m4
98
99         rm -rf build-std build-cli build-all
100         rm -f config.guess config.sub
101
102         dh_clean 
103
104 install: build
105         dh_testdir
106         dh_testroot
107         dh_clean -k 
108
109 #DML#   cd build-std && $(MAKE) install DESTDIR=$(CURDIR)/debian/conky-std
110 #DML#   cd build-cli && $(MAKE) install DESTDIR=$(CURDIR)/debian/conky-cli
111         cd build-all && $(MAKE) install DESTDIR=$(CURDIR)/debian/conky-all
112         mkdir -p debian/conky-all/usr/share/icons/hicolor/scalable/apps/
113         cp -p debian/conkylogo64.png debian/conky-all/usr/share/icons/hicolor/scalable/apps/conky.png
114         mkdir -p debian/conky-all/usr/share/icons/hicolor/48x48/apps/
115         cp -p debian/conkylogo48.png debian/conky-all/usr/share/icons/hicolor/48x48/apps/conky.png
116         mkdir -p debian/conky-all/usr/share/applications/hildon/
117         cp -p debian/conky.desktop debian/conky-all/usr/share/applications/hildon/conky.desktop
118         mkdir -p debian/conky-all/usr/bin/
119         cp -p debian/conky.sh debian/conky-all/usr/bin/
120
121         # Clean up cruft left upstream
122         rm -rf debian/conky-std/usr/lib debian/conky-cli/usr/lib \
123                debian/conky-all/usr/lib/conky/*.la \
124                debian/conky-all/usr/lib/conky/*.so.?
125
126 binary-indep: build install
127
128 binary-arch: build install
129         dh_testdir
130         dh_testroot
131         dh_installchangelogs ChangeLog
132         dh_installdocs
133         dh_installmenu
134         dh_installman -a doc/conky.1
135         dh_install
136         dh_link
137         dh_strip
138         dh_compress
139         dh_fixperms
140         dh_installdeb
141         dh_shlibdeps
142         dh_gencontrol
143         maemo-optify
144         dh_md5sums
145         dh_builddeb
146
147 binary: binary-arch binary-indep
148
149 .PHONY: configure build clean install binary binary-indep binary-arch