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)
16 ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
18 # Determine Maemo version
19 MAEMO_VERSION := $(shell cut -d"." -f1 /etc/maemo_version)
21 # Determine app version from debian changelog
22 GAME_VERSION := $(shell head -n 1 debian/changelog | sed 's/[^0-9.-]//g')
25 CFLAGS = -Wall -g -DMAEMO -DMAEMO_VERSION=$(MAEMO_VERSION)
26 GUI_CFLAGS := -std=c99 -fPIC -shared $(CFLAGS)
28 GUI_LDFLAGS := -export-dynamic -avoid-version -module -shared $(LDFLAGS)
32 M4DEFS=-DMAEMO_MAJOR=$(MAEMO_VERSION)
34 # Architecture specific CFLAGS
35 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
37 else ifneq (,$(findstring armel,$(ARCH)))
40 ifneq (,$(findstring vfp,$(DEB_BUILD_OPTIONS)))
41 CFLAGS += -march=armv6j -mtune=arm1136jf-s -mfpu=vfp -mfloat-abi=softfp
42 ASFLAGS += -march=armv6j -mfpu=vfp -mfloat-abi=softfp
44 # Fixes hang while exiting in Diablo.
45 CFLAGS += -static-libgcc
46 else ifneq (,$(findstring i386,$(ARCH)))
50 # Don't support anything else yet
54 debian/control: debian/control.m4
55 $(M4) $(M4DEFS) debian/control.m4 > debian/control
57 configure: configure-stamp
60 $(M4) $(M4DEFS) debian/control.m4 > debian/control
61 $(M4) $(M4DEFS) debian/drnoksnes.postinst.m4 > debian/drnoksnes.postinst
63 echo ARCH="$(ARCH)" > config.mk
64 echo CONF_GUI=1 >> config.mk
65 echo CONF_HGW=1 >> config.mk
66 ifeq ($(shell expr "$(MAEMO_VERSION)" ">" 4), 1)
67 # Maemo 5 devices do not support Xsp
68 echo CONF_XSP=0 >> config.mk
70 echo ASFLAGS="$(ASFLAGS)" >> config.mk
71 echo CFLAGS="$(CFLAGS)" >> config.mk
72 echo CXXFLAGS="$(CFLAGS)" >> config.mk
73 echo LDFLAGS="$(LDFLAGS)" >> config.mk
75 echo CFLAGS="$(GUI_CFLAGS)" > gui/config.mk
76 echo LDFLAGS="$(GUI_LDFLAGS)" >> gui/config.mk
77 echo MAEMO_VERSION="$(MAEMO_VERSION)" >> gui/config.mk
78 echo GAME_VERSION="$(GAME_VERSION)" >> gui/config.mk
83 build-stamp: configure-stamp
91 rm -f build-stamp configure-stamp
93 rm -f config.mk gui/config.mk
101 $(MAKE) DESTDIR=$(CURDIR)/debian/drnoksnes GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 install
103 # Build architecture-independent files here.
104 binary-indep: build install
105 # We have nothing to do by default.
107 # Build architecture-dependent files here.
108 binary-arch: build install
111 # dh_installchangelogs
116 # Fixes a nasty bug with dh_gconf & busybox
117 rm -f $(CURDIR)/debian/drnoksnes.postrm.debhelper
119 dh_strip --dbg-package=drnoksnes-dbg
125 ifeq ($(shell expr "$(MAEMO_VERSION)" ">" 4), 1)
126 # Optify only in Maemo 5
132 binary: binary-indep binary-arch
133 .PHONY: build clean binary-indep binary-arch binary install configure