2fcc2099990c128dae5ac108450e2ce97e5c24e6
[maemo-efl] / trunk / e_dbus / debian / rules
1 #!/usr/bin/make -f
2
3 include /usr/share/cdbs/1/rules/debhelper.mk
4 include /usr/share/cdbs/1/class/autotools.mk
5 include /usr/share/cdbs/1/rules/simple-patchsys.mk
6
7 DEB_CONFIGURE_EXTRA_FLAGS:=--disable-build-test-gui
8 CFLAGS+=-lpthread
9
10 DEB_BUILD_ARCH?=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
11
12 ifeq ($(DEB_BUILD_ARCH),armel)
13         COMMON_CFLAGS=-DNDEBUG=1 -fomit-frame-pointer -O2 -ffast-math -funsafe-math-optimizations -fno-math-errno -fsingle-precision-constant
14         N770_CFLAGS=-mcpu=arm926ej-s
15         N8x0_CFLAGS=-mfpu=vfp -mfloat-abi=softfp -mcpu=arm1136jf-s
16         ifneq ($(DEB_BUILD_OPTIONS),)
17                 ifneq (,$(findstring n8x0,$(DEB_BUILD_OPTIONS)))
18                         SPECIFIC_CFLAGS=$(N8x0_CFLAGS)
19                 else
20                         ifneq (,$(findstring n770,$(DEB_BUILD_OPTIONS)))
21                                 SPECIFIC_CFLAGS=$(N770_CFLAGS)
22                         endif
23                 endif
24         endif
25     ifeq ($(SPECIFIC_CFLAGS),)
26         ifeq (0,$(shell test -e /etc/osso_software_version; echo $$?))
27             SW_VERSION?=$(shell cat /etc/osso_software_version|cut -d_ -f2)
28                         ifneq (,$(findstring $(SW_VERSION),OSSO1.1 2008SE DIABLO))
29                                 SPECIFIC_CFLAGS=$(N8x0_CFLAGS)
30             endif
31                 endif
32         ifeq ($(SPECIFIC_CFLAGS),)
33             # Our last hope is to look at the value returned by `sb-conf current`
34             SB_CURRENT?=$(shell sb-conf current|cut -d_ -f1)
35                         ifneq (,$(findstring $(SB_CURRENT),GREGALE BORA CHINOOK DIABLO))
36                                 ifeq ($(SB_CURRENT),GREGALE)
37                                         SPECIFIC_CFLAGS=$(N770_CFLAGS)
38                                 else
39                                         SPECIFIC_CFLAGS=$(N8x0_CFLAGS)
40                                 endif
41                         else
42                                 COMMON_CFLAGS=
43                         endif
44         endif
45     endif
46 endif
47
48 CFLAGS+=$(COMMON_CFLAGS) $(SPECIFIC_CFLAGS)
49