#!/usr/bin/make -f
# -*- makefile -*-

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

%:
	dh  $@

override_dh_clean:
	# Clean everything up, including everything auto-generated
	# at build time that needs not to be kept around in the Debian diff
	find -type d -name autom4te.cache -print0 | xargs -0 -r rm -rf \;
	find -type f \( -name missing -o -name install-sh -o -name mkinstalldirs \
	-o -name depcomp -o -name ltmain.sh -o -name configure \
	-o -name config.sub -o -name config.guess \
	-o -name Makefile.in \) -print0 | xargs -0 rm -f
	-rm -f platform.h auto-include.h
	find -type d -name build -print0 | xargs -0 -r rm -rf \;
	find \( -name config.sub -o -name config.guess \) -print0 | xargs -0 -r rm -f \;
	# Final static cleanups
	if [ -r debian/deletable.files ] ; then \
		xargs -t -r rm -f < debian/deletable.files ;\
	fi
	-rm debian/deletable.files
	#see also debian/clean
	dh_clean

override_dh_auto_configure:
	chmod +x debian/autogen.sh
	debian/autogen.sh
	dh_auto_configure
