#!/usr/bin/make -f
# Copyright  2006-2009 Nokia Corporation. All rights reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License 
# version 2 as published by the Free Software Foundation. 
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/patchsys-quilt.mk
include /usr/share/cdbs/1/rules/utils.mk

DEB_TAR_SRCDIR := dosfstools-3.0.1
include /usr/share/cdbs/1/rules/tarball.mk

DEB_DH_STRIP_ARGS := --dbg-package=dosfstools

# Use soft-float and thumb mode if it is enabled.
ifneq (,$(findstring thumb,$(DEB_BUILD_OPTIONS)))
        CFLAGS += -mthumb
endif

configure/dosfstools::
	cd $(DEB_BUILDDIR); sed -ri "s#REPLACE_WITH_PREFIX#$(DEB_DESTDIR)#" Makefile

build/dosfstools::
	cd $(DEB_BUILDDIR); $(MAKE) DESTDIR=$(CURDIR)/debian/dosfstools \
	                            PREFIX=/usr SBINDIR=/sbin install

clean::
	rm -f *.cdbs-config_list
