de20ecbcf9cf8a3b80c48ad1b2c29642f8d98acf
[tunertool] / debian / rules
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # Sample debian/rules that uses debhelper.
4 # GNU copyright 1997 to 1999 by Joey Hess.
5
6 # Uncomment this to turn on verbose mode.
7 export DH_VERBOSE=1
8
9 # These are used for cross-compiling and for saving the configure script
10 # from having to guess our platform (since we know it already)
11 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
12 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
13 DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
14
15 CFLAGS = -Wall -g
16
17 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
18         CFLAGS += -O0
19 else
20         CFLAGS += -O2
21         ifneq (,$(findstring $(DEB_HOST_ARCH),arm armel))
22                 CFLAGS += -mcpu=arm926ej-s 
23         endif
24 endif
25 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
26         INSTALL_PROGRAM += -s
27 endif
28
29 config.status:
30         dh_testdir
31         ./autogen.sh
32         # Add here commands to configure the package.
33         CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) \
34      --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man \
35      --infodir=\$${prefix}/share/info --with-maemo
36
37 build: build-stamp
38
39 build-stamp: config.status
40         dh_testdir
41
42         # Add here commands to compile the package.
43         $(MAKE) 
44         touch build-stamp
45
46 clean:
47         dh_testdir
48         dh_testroot
49         rm -f build-stamp 
50
51         # Add here commands to clean up after the build process.
52         -$(MAKE) distclean
53
54         dh_clean 
55
56 install: build
57         dh_testdir
58         dh_testroot
59         dh_clean -k 
60         dh_installdirs
61         dh_link
62
63         # Add here commands to install the package
64         mkdir -p $(CURDIR)/debian/tmp/usr
65         mkdir -p $(CURDIR)/debian/tmp/usr/share/applications/hildon
66         mkdir -p $(CURDIR)/debian/tmp/usr/share/icons/hicolor/26x26/hildon
67         mkdir -p $(CURDIR)/debian/tmp/usr/share/icons/hicolor/40x40/hildon
68         mkdir -p $(CURDIR)/debian/tmp/usr/share/icons/hicolor/scalable/hildon
69         cp $(CURDIR)/src/tuner26.png $(CURDIR)/debian/tmp/usr/share/icons/hicolor/26x26/hildon/pkg_tuner.png
70         cp $(CURDIR)/src/tuner40.png $(CURDIR)/debian/tmp/usr/share/icons/hicolor/40x40/hildon/pkg_tuner.png
71         cp $(CURDIR)/src/tuner64.png $(CURDIR)/debian/tmp/usr/share/icons/hicolor/scalable/hildon/pkg_tuner.png
72         cp $(CURDIR)/tuner.desktop $(CURDIR)/debian/tmp/usr/share/applications/hildon/tuner.desktop
73         mkdir -p $(CURDIR)/debian/tmp/usr/bin
74         cp $(CURDIR)/src/tuner $(CURDIR)/debian/tmp/usr/bin
75         strip $(CURDIR)/debian/tmp/usr/bin/tuner
76
77 # Build architecture-independent files here.
78 binary-indep: build install
79 # We have nothing to do by default.
80
81 # Build architecture-dependent files here.
82 binary-arch: build install
83         dh_testdir
84         dh_testroot
85         dh_link
86         dh_strip
87         dh_compress
88         dh_fixperms
89         dh_installdeb
90         dh_shlibdeps
91         dh_gencontrol
92         dh_md5sums
93         dh_builddeb
94
95 binary: binary-indep binary-arch
96 .PHONY: build clean binary-indep binary-arch binary install configure