11c6b1964251afd77ef123fda1cba7615f086588
[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 #include /usr/share/quilt/quilt.make
13
14 # These are used for cross-compiling and for saving the configure script
15 # from having to guess our platform (since we know it already)
16 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
17 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
18
19 # Determine Maemo version
20 MAEMO_VERSION := $(shell cut -d"." -f1 /etc/maemo_version)
21
22 CFLAGS = -Wall -g -DMAEMO -DMAEMO_VERSION=$(MAEMO_VERSION)
23 LDFLAGS = -Wl,-z,defs
24 CONFOPTS = 
25
26 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
27         CFLAGS += -O0
28 else ifneq (,$(findstring arm,$(DEB_BUILD_GNU_TYPE)))
29         CFLAGS += -Os
30         ifneq (,$(findstring vfp,$(DEB_BUILD_OPTIONS)))
31                 CFLAGS += -march=armv6j -mtune=arm1136jf-s -mfpu=vfp -mfloat-abi=softfp
32         endif
33         CFLAGS += -static-libgcc
34 else # x86
35         echo "This package does not build in x86"
36         exit 1
37 endif
38
39 configure: configure-stamp
40 configure-stamp:
41         dh_testdir
42         # Add here commands to configure the package.
43
44         touch configure-stamp
45
46
47 build: build-stamp
48
49 build-stamp: configure-stamp 
50         dh_testdir
51
52         $(MAKE) CFLAGS="$(CFLAGS)" CXXFLAGS="$(CFLAGS)"
53
54         touch $@
55
56 clean:
57         dh_testdir
58         dh_testroot
59         rm -f build-stamp configure-stamp
60
61         # Add here commands to clean up after the build process.
62         -$(MAKE) clean
63
64         dh_clean 
65
66 install: build
67         dh_testdir
68         dh_testroot
69         dh_clean -k 
70         dh_installdirs
71
72         # Add here commands to install the package into debian/drnoksnes.
73         $(MAKE) DESTDIR=$(CURDIR)/debian/drnoksnes install
74
75
76 # Build architecture-independent files here.
77 binary-indep: build install
78 # We have nothing to do by default.
79
80 # Build architecture-dependent files here.
81 binary-arch: build install
82         dh_testdir
83         dh_testroot
84         dh_installchangelogs 
85         dh_installdocs
86         dh_installexamples
87         dh_installman
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