fremantle gui fixes (not complete)
[drnoksnes] / debian / rules
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # Sample debian/rules that uses debhelper.
4 # This file was originally written by Joey Hess and Craig Small.
5 # As a special exception, when this file is copied by dh-make into a
6 # dh-make output file, you may use that output file without restriction.
7 # This special exception was added by Craig Small in version 0.37 of dh-make.
8
9 # Uncomment this to turn on verbose mode.
10 #export DH_VERBOSE=1
11
12 # These are used for cross-compiling and for saving the configure script
13 # from having to guess our platform (since we know it already)
14 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
15 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
16
17 # Determine Maemo version
18 MAEMO_VERSION := $(shell cut -d"." -f1 /etc/maemo_version)
19
20 # Determine app version from debian changelog
21 GAME_VERSION := $(shell head -n 1 debian/changelog | sed 's/[^0-9.-]//g')
22
23 CFLAGS = -Wall -g -DMAEMO -DMAEMO_VERSION=$(MAEMO_VERSION)
24 GUI_CFLAGS := $(CFLAGS)
25 LDFLAGS = -Wl,-z,defs
26
27 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
28         CFLAGS += -O0
29 else ifneq (,$(findstring arm,$(DEB_BUILD_GNU_TYPE)))
30         CFLAGS += -O2
31         GUI_CFLAGS += -Os
32         ifneq (,$(findstring vfp,$(DEB_BUILD_OPTIONS)))
33                 CFLAGS += -march=armv6j -mtune=arm1136jf-s -mfpu=vfp -mfloat-abi=softfp
34         endif
35         # Fixes hang while exiting on Diablo.
36         CFLAGS += -static-libgcc
37 else # x86
38         crash ## Cannot build in x86
39 endif
40
41 configure: configure-stamp
42 configure-stamp:
43         dh_testdir
44         # Add here commands to configure the package.
45
46         touch configure-stamp
47
48
49 build: build-stamp
50
51 build-stamp: configure-stamp 
52         dh_testdir
53
54         $(MAKE) CFLAGS="$(CFLAGS)" CXXFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" GUI_CFLAGS="$(GUI_CFLAGS)" GAME_VERSION="$(GAME_VERSION)"
55
56         touch $@
57
58 clean:
59         dh_testdir
60         dh_testroot
61         rm -f build-stamp configure-stamp
62
63         # Add here commands to clean up after the build process.
64         -$(MAKE) clean
65
66         dh_clean 
67
68 install: build
69         dh_testdir
70         dh_testroot
71         dh_clean -k 
72         dh_installdirs
73
74         # Add here commands to install the package into debian/drnoksnes.
75         $(MAKE) DESTDIR=$(CURDIR)/debian/drnoksnes install
76
77
78 # Build architecture-independent files here.
79 binary-indep: build install
80 # We have nothing to do by default.
81
82 # Build architecture-dependent files here.
83 binary-arch: build install
84         dh_testdir
85         dh_testroot
86 #       dh_installchangelogs 
87 #       dh_installdocs
88 #       dh_installexamples
89 #       dh_installman
90         dh_link
91         dh_strip --dbg-package=drnoksnes-dbg
92         dh_compress
93         dh_fixperms
94         dh_installdeb
95         dh_shlibdeps
96         dh_gencontrol
97         dh_md5sums
98         dh_builddeb
99
100 binary: binary-indep binary-arch
101 .PHONY: build clean binary-indep binary-arch binary install configure