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