9cbc89627ca8af041828cac9776e4f471e6d1aa9
[maemo-efl] / trunk / python-e_dbus / debian / rules
1 #!/usr/bin/make -f
2
3 DEB_DESTDIR=$(CURDIR)/debian/tmp
4
5 PYVER=2.5
6 PYTHON=python$(PYVER)
7
8 DEB_BUILD_ARCH?=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
9
10 ifeq ($(DEB_BUILD_ARCH),armel)
11         COMMON_CFLAGS=-DNDEBUG=1 -fomit-frame-pointer -O2 -ffast-math -funsafe-math-optimizations -fno-math-errno -fsingle-precision-constant
12         N770_CFLAGS=-mcpu=arm926ej-s
13         N8x0_CFLAGS=-mfpu=vfp -mfloat-abi=softfp -mcpu=arm1136jf-s
14         ifneq ($(DEB_BUILD_OPTIONS),)
15                 ifneq (,$(findstring n8x0,$(DEB_BUILD_OPTIONS)))
16                         SPECIFIC_CFLAGS=$(N8x0_CFLAGS)
17                 else
18                         ifneq (,$(findstring n770,$(DEB_BUILD_OPTIONS)))
19                                 SPECIFIC_CFLAGS=$(N770_CFLAGS)
20                         endif
21                 endif
22         endif
23     ifeq ($(SPECIFIC_CFLAGS),)
24         ifeq (0,$(shell test -e /etc/osso_software_version; echo $$?))
25             SW_VERSION?=$(shell cat /etc/osso_software_version|cut -d_ -f2)
26                         ifneq (,$(findstring $(SW_VERSION),OSSO1.1 2008SE DIABLO))
27                                 SPECIFIC_CFLAGS=$(N8x0_CFLAGS)
28             endif
29                 endif
30         ifeq ($(SPECIFIC_CFLAGS),)
31             # Our last hope is to look at the value returned by `sb-conf current`
32             SB_CURRENT?=$(shell sb-conf current|cut -d_ -f1)
33                         ifneq (,$(findstring $(SB_CURRENT),GREGALE BORA CHINOOK DIABLO))
34                                 ifeq ($(SB_CURRENT),GREGALE)
35                                         SPECIFIC_CFLAGS=$(N770_CFLAGS)
36                                 else
37                                         SPECIFIC_CFLAGS=$(N8x0_CFLAGS)
38                                 endif
39                         else
40                                 COMMON_CFLAGS=
41                         endif
42         endif
43     endif
44 endif
45
46 CFLAGS+=$(COMMON_CFLAGS) $(SPECIFIC_CFLAGS)
47
48 build: build-stamp
49 build-stamp:
50         dh_testdir
51         CFLAGS="$(CFLAGS)" $(PYTHON) setup.py build_ext build
52         touch build-stamp
53 clean:
54         dh_testdir
55         dh_testroot
56         CFLAGS="$(CFLAGS)" $(PYTHON) setup.py clean
57         -rm -f build-stamp
58         -rm -rf build dist python_e_dbus.egg-info
59         -rm -f *.py[co]
60         dh_clean
61
62 install: build
63         dh_testdir
64         dh_testroot
65         dh_installdirs
66         CFLAGS="$(CFLAGS)" $(PYTHON) setup.py install --root=$(DEB_DESTDIR)
67         dh_install --sourcedir=$(DEB_DESTDIR) --fail-missing
68
69 binary: binary-arch
70 binary-arch: build install
71         dh_testdir
72         dh_testroot
73         dh_installdocs
74         dh_installdebconf
75         dh_installchangelogs
76         dh_strip
77         dh_compress
78         dh_fixperms
79         dh_makeshlibs
80         dh_installdeb
81         dh_shlibdeps
82         dh_gencontrol
83         dh_md5sums
84         dh_builddeb
85
86 .PHONY: build install clean binary binary-arch