#!/usr/bin/make -f
# debhelper rules file for donkey, the One-Time-Password calculator

# Aim for the top, adapt if anything should break on the buildds.
DEB_BUILD_MAINT_OPTIONS=	hardening=+all
DEB_CPPFLAGS_MAINT_APPEND=	-D_FILE_OFFSET_BITS=64
DEB_CFLAGS_MAINT_APPEND=	-Wall -W -Wextra

CFLAGS_ADD=
ifneq (,$(filter werror,$(DEB_BUILD_OPTIONS)))
CFLAGS_ADD+=	-Werror
endif

export DEB_BUILD_MAINT_OPTIONS DEB_CPPFLAGS_MAINT_APPEND DEB_CFLAGS_MAINT_APPEND

pkgname=donkey
instdir=$(CURDIR)/debian/$(pkgname)

override_dh_auto_configure:
	dh_auto_configure -D src

override_dh_auto_build:
	dh_auto_build -D src -- CFLAGS="$(CFLAGS) $(CFLAGS_ADD)"

override_dh_auto_clean:
	dh_auto_clean -D src

override_dh_auto_install:
	dh_auto_install -D src -- BINDIR="$(instdir)/usr/bin"

override_dh_installchangelogs:
	dh_installchangelogs 00changes

%:
	dh $@ --parallel --with autoreconf
