#!/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.2
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)

DEB_DESTDIR=$(CURDIR)/debian/tmp

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

# Make sure we get properly optimized
DEB_OPT_FLAG_i386:=-O2 -fomit-frame-pointer -pipe -march=i686 -mtune=pentium2
DEB_OPT_FLAG:=$(DEB_OPT_FLAG_$(DEB_HOST_ARCH))

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