#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk
# include /usr/share/cdbs/1/rules/simple-patchsys.mk

DEB_DH_INSTALL_SOURCEDIR := debian/tmp

# Use hardware floating point
ifneq (,$(findstring vfp,$(DEB_BUILD_OPTIONS)))
    CFLAGS += -mfpu=vfp -mfloat-abi=softfp
    CXXFLAGS += -mfpu=vfp -mfloat-abi=softfp
endif

DEB_TAR_SRCDIR=libdmtx-0.7.4
DEB_CONFIGURE_EXTRA_FLAGS := --disable-dmtxquery --disable-dmtxread --disable-dmtxwrite 

IS_FREMANTLE=$(shell if grep Fremantle /etc/maemo_version &> /dev/null; then echo y; else echo n; fi)
IS_DIABLO=$(shell if grep Diablo /etc/maemo_version &> /dev/null; then echo y; else echo n; fi)

DEB_DESTDIR=$(CURDIR)/debian/tmp

DEB_OPT_FLAG_armel:=-O2 -fomit-frame-pointer -pipe

ifeq ($(IS_FREMANTLE),y)
DEB_OPT_FLAG_armel:=-O2 -fomit-frame-pointer -pipe -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp
endif

ifeq ($(IS_DIABLO),y)
DEB_OPT_FLAG_armel:=-O2 -fomit-frame-pointer -pipe -mcpu=arm1136jf-s -mfpu=vfp -mfloat-abi=softfp
endif

DEB_OPT_FLAG_i386:=-O2 -fomit-frame-pointer -pipe
DEB_OPT_FLAG:=$(DEB_OPT_FLAG_$(DEB_HOST_ARCH))

include /usr/share/cdbs/1/rules/tarball.mk
