define G_DISABLE_CAST_CHECKS for non-debug builds
[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 += -march=armv7-a -mtune=cortex-a8 -mfpu=neon -ftree-vectorize -mfloat-abi=softfp
23         endif
24 endif
25 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
26         INSTALL_PROGRAM += -s
27 endif
28 ifeq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
29         CFLAGS += -DG_DISABLE_CAST_CHECKS
30 endif
31
32 config.status:
33         dh_testdir
34         ./autogen.sh
35         # Add here commands to configure the package.
36         CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) \
37      --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man \
38      --infodir=\$${prefix}/share/info --with-maemo
39
40 build: build-stamp
41
42 build-stamp: config.status
43         dh_testdir
44
45         # Add here commands to compile the package.
46         $(MAKE) 
47         touch build-stamp
48
49 clean:
50         dh_testdir
51         dh_testroot
52         rm -f build-stamp 
53
54         # Add here commands to clean up after the build process.
55         -$(MAKE) distclean
56
57         dh_clean 
58
59 install: build
60         dh_testdir
61         dh_testroot
62         dh_clean -k 
63         dh_installdirs
64         dh_link
65
66         # Add here commands to install the package
67         mkdir -p $(CURDIR)/debian/tmp/usr
68         mkdir -p $(CURDIR)/debian/tmp/usr/share/applications/hildon
69         mkdir -p $(CURDIR)/debian/tmp/usr/share/icons/hicolor/26x26/hildon
70         mkdir -p $(CURDIR)/debian/tmp/usr/share/icons/hicolor/40x40/hildon
71         mkdir -p $(CURDIR)/debian/tmp/usr/share/icons/hicolor/scalable/hildon
72         cp $(CURDIR)/src/tuner26.png $(CURDIR)/debian/tmp/usr/share/icons/hicolor/26x26/hildon/pkg_tuner.png
73         cp $(CURDIR)/src/tuner40.png $(CURDIR)/debian/tmp/usr/share/icons/hicolor/40x40/hildon/pkg_tuner.png
74         cp $(CURDIR)/src/tuner64.png $(CURDIR)/debian/tmp/usr/share/icons/hicolor/scalable/hildon/pkg_tuner.png
75         cp $(CURDIR)/tuner.desktop $(CURDIR)/debian/tmp/usr/share/applications/hildon/tuner.desktop
76         mkdir -p $(CURDIR)/debian/tmp/usr/bin
77         cp $(CURDIR)/src/tuner $(CURDIR)/debian/tmp/usr/bin
78         strip $(CURDIR)/debian/tmp/usr/bin/tuner
79
80 # Build architecture-independent files here.
81 binary-indep: build install
82 # We have nothing to do by default.
83
84 # Build architecture-dependent files here.
85 binary-arch: build install
86         dh_testdir
87         dh_testroot
88         dh_link
89         dh_strip
90         dh_compress
91         dh_fixperms
92         dh_installdeb
93         dh_shlibdeps
94         dh_gencontrol
95         dh_md5sums
96         dh_builddeb
97
98 binary: binary-indep binary-arch
99 .PHONY: build clean binary-indep binary-arch binary install configure