#! /usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=-all

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

%:
	dh $@ --builddirectory=debian/build

override_dh_auto_build:
	$(MAKE) CONFIGURATION=debug

override_dh_auto_clean:
	$(MAKE) CONFIGURATION=debug clean

execute_before_dh_auto_configure: copyright-scan

copyright-scan:
	scan-copyrights >debian/$@.new.tmp 2>debian/$@.new.todo.tmp
	(sed -e 's/^/# /' debian/$@.new.todo.tmp; echo; cat debian/$@.new.tmp) \
	  | grep -v "Note: loading debian/fill.copyright.blanks.yml" >debian/$@.new
	diff -u debian/$@ debian/$@.new
	rm debian/$@.new*

copyright-update: copyright-scan
	cme update -q dpkg-copyright

.PHONY: copyright-scan copyright-update
