0050a0dac2b6b878d568386b99ad404280983a70
[maemo-efl] / trunk / python-edje / 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         touch edje/edje.*.pyx
52         CFLAGS="$(CFLAGS)" $(PYTHON) setup.py build_ext build
53         touch build-stamp
54         cd $(CURDIR)/examples/evas-demo/01-app_launcher && \
55                 edje_cc 01-app_launcher.edc
56         cd $(CURDIR)/examples/evas-demo/02-vkbd && \
57                 edje_cc 02-vkbd.edc
58
59 clean:
60         dh_testdir
61         dh_testroot
62         CFLAGS="$(CFLAGS)" $(PYTHON) setup.py clean
63         -rm -f build-stamp
64         -rm -rf build dist python_edje.egg-info
65         -rm -f edje/*.py[co]
66         -rm -f *.py[co]
67         -rm -f debian/*.edj
68         dh_clean
69
70 install: build
71         dh_testdir
72         dh_testroot
73         dh_installdirs
74         install -D -m 755 $(CURDIR)/examples/evas-demo/01-app_launcher/01-app_launcher.py $(DEB_DESTDIR)/usr/bin/01-app_launcher.py
75         install -D -m 644 $(CURDIR)/examples/evas-demo/01-app_launcher/01-app_launcher.edj $(DEB_DESTDIR)/usr/bin/01-app_launcher.edj
76         install -D -m 644 $(CURDIR)/debian/01-app_launcher.desktop $(DEB_DESTDIR)/usr/share/applications/hildon/01-app_launcher.desktop
77         install -D -m 755 $(CURDIR)/examples/evas-demo/02-vkbd/02-vkbd.py $(DEB_DESTDIR)/usr/bin/02-vkbd.py
78         install -D -m 644 $(CURDIR)/examples/evas-demo/02-vkbd/02-vkbd.edj $(DEB_DESTDIR)/usr/bin/02-vkbd.edj
79         install -D -m 644 $(CURDIR)/debian/02-vkbd.desktop $(DEB_DESTDIR)/usr/share/applications/hildon/02-vkbd.desktop
80         CFLAGS="$(CFLAGS)" $(PYTHON) setup.py install --root=$(DEB_DESTDIR) install_headers -d $(DEB_DESTDIR)/usr/include/$(PYTHON)
81         if [ "x$(DEB_BUILD_ARCH)" = "xarmel" ]; then \
82                 rm -rf $(DEB_DESTDIR)/usr/lib/$(PYTHON)/site-packages/edje/*.py; \
83                 rm -rf $(DEB_DESTDIR)/usr/lib/$(PYTHON)/site-packages/edje/*.pyc; \
84         fi
85         dh_install --sourcedir=$(DEB_DESTDIR) --fail-missing
86
87 binary: binary-arch
88 binary-arch: build install
89         dh_testdir
90         dh_testroot
91         dh_installdocs
92         dh_installdebconf
93         dh_installchangelogs
94         dh_strip
95         dh_compress
96         dh_fixperms
97         dh_makeshlibs
98         dh_installdeb
99         dh_shlibdeps
100         dh_gencontrol
101         dh_md5sums
102         dh_builddeb
103
104 .PHONY: build install clean binary binary-arch