Initial version 1.8.0 with no maemo fixes
[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-1.11 ./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         cd build-std && CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
57         ../configure $(COMMON_CONFIGURE_FLAGS) $(LINUX_CONF_ARGS_STD)
58
59         cd build-cli && CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
60         ../configure $(COMMON_CONFIGURE_FLAGS) \
61         --disable-lua --disable-double-buffer --disable-x11 \
62         --disable-xdamage --disable-own-window --disable-xft \
63         --disable-hddtemp --disable-alsa --disable-portmon \
64         --enable-ncurses
65
66         cd build-all && CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
67         ../configure $(COMMON_CONFIGURE_FLAGS) \
68         --enable-imlib2 --enable-rss --enable-weather-xoap \
69         --enable-eve --enable-lua-cairo --enable-lua-imlib2 \
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         cd build-std && $(MAKE)
81         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         cd build-std && $(MAKE) install DESTDIR=$(CURDIR)/debian/conky-std
110         cd build-cli && $(MAKE) install DESTDIR=$(CURDIR)/debian/conky-cli
111         cd build-all && $(MAKE) install DESTDIR=$(CURDIR)/debian/conky-all
112
113         # Clean up cruft left upstream
114         rm -rf debian/conky-std/usr/lib debian/conky-cli/usr/lib \
115                debian/conky-all/usr/lib/conky/*.la \
116                debian/conky-all/usr/lib/conky/*.so.?
117
118 binary-indep: build install
119
120 binary-arch: build install
121         dh_testdir
122         dh_testroot
123         dh_installchangelogs ChangeLog
124         dh_installdocs
125         dh_installmenu -a
126         dh_installman -a doc/conky.1
127         dh_install -a
128         dh_link -a
129         dh_strip -a
130         dh_compress
131         dh_fixperms
132         dh_installdeb -a
133         dh_shlibdeps -a
134         dh_gencontrol
135         dh_md5sums
136         dh_builddeb
137
138 binary: binary-arch binary-indep
139
140 .PHONY: configure build clean install binary binary-indep binary-arch