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.
9 # Uncomment this to turn on verbose mode.
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)
17 # Determine Maemo version
18 MAEMO_VERSION := $(shell cut -d"." -f1 /etc/maemo_version)
20 # Determine app version from debian changelog
21 GAME_VERSION := $(shell head -n 1 debian/changelog | sed 's/[^0-9.-]//g')
23 CFLAGS = -Wall -g -DMAEMO -DMAEMO_VERSION=$(MAEMO_VERSION)
24 GUI_CFLAGS := $(CFLAGS)
28 M4DEFS=-DMAEMO_MAJOR=$(MAEMO_VERSION)
30 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
32 else ifneq (,$(findstring arm,$(DEB_BUILD_GNU_TYPE)))
35 ifneq (,$(findstring vfp,$(DEB_BUILD_OPTIONS)))
36 CFLAGS += -march=armv6j -mtune=arm1136jf-s -mfpu=vfp -mfloat-abi=softfp
38 # Fixes hang while exiting on Diablo.
39 CFLAGS += -static-libgcc
41 crash ## Cannot build in x86
44 debian/control: debian/control.m4
45 $(M4) $(M4DEFS) debian/control.m4 > debian/control
47 configure: configure-stamp
50 $(M4) $(M4DEFS) debian/control.m4 > debian/control
51 $(M4) $(M4DEFS) debian/drnoksnes.postinst.m4 > debian/drnoksnes.postinst
55 build-stamp: configure-stamp
57 $(MAKE) CFLAGS="$(CFLAGS)" CXXFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" GUI_CFLAGS="$(GUI_CFLAGS)" GAME_VERSION="$(GAME_VERSION)"
63 rm -f build-stamp configure-stamp
72 $(MAKE) DESTDIR=$(CURDIR)/debian/drnoksnes install
74 # Build architecture-independent files here.
75 binary-indep: build install
76 # We have nothing to do by default.
78 # Build architecture-dependent files here.
79 binary-arch: build install
82 # dh_installchangelogs
87 dh_strip --dbg-package=drnoksnes-dbg
96 binary: binary-indep binary-arch
97 .PHONY: build clean binary-indep binary-arch binary install configure