31698d2c46aa2b1d3ea7d82ea2abfca6dbd68635
[maemo-efl] / trunk / epeg / 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_BUILD_ARCH?=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
8
9 ifeq ($(DEB_BUILD_ARCH),armel)
10         COMMON_CFLAGS=-DNDEBUG=1 -fomit-frame-pointer -O2 -ffast-math -funsafe-math-optimizations -fno-math-errno -fsingle-precision-constant
11         N770_CFLAGS=-mcpu=arm926ej-s
12         N8x0_CFLAGS=-mfpu=vfp -mfloat-abi=softfp -mcpu=arm1136jf-s
13         ifneq ($(DEB_BUILD_OPTIONS),)
14                 ifneq (,$(findstring n8x0,$(DEB_BUILD_OPTIONS)))
15                         SPECIFIC_CFLAGS=$(N8x0_CFLAGS)
16                 else
17                         ifneq (,$(findstring n770,$(DEB_BUILD_OPTIONS)))
18                                 SPECIFIC_CFLAGS=$(N770_CFLAGS)
19                         endif
20                 endif
21         endif
22     ifeq ($(SPECIFIC_CFLAGS),)
23         ifeq (0,$(shell test -e /etc/osso_software_version; echo $$?))
24             SW_VERSION?=$(shell cat /etc/osso_software_version|cut -d_ -f2)
25                         ifneq (,$(findstring $(SW_VERSION),OSSO1.1 2008SE DIABLO))
26                                 SPECIFIC_CFLAGS=$(N8x0_CFLAGS)
27             endif
28                 endif
29         ifeq ($(SPECIFIC_CFLAGS),)
30             # Our last hope is to look at the value returned by `sb-conf current`
31             SB_CURRENT?=$(shell sb-conf current|cut -d_ -f1)
32                         ifneq (,$(findstring $(SB_CURRENT),GREGALE BORA CHINOOK DIABLO))
33                                 ifeq ($(SB_CURRENT),GREGALE)
34                                         SPECIFIC_CFLAGS=$(N770_CFLAGS)
35                                 else
36                                         SPECIFIC_CFLAGS=$(N8x0_CFLAGS)
37                                 endif
38                         else
39                                 COMMON_CFLAGS=
40                         endif
41         endif
42     endif
43 endif
44
45 CFLAGS+=$(COMMON_CFLAGS) $(SPECIFIC_CFLAGS)
46