#!/usr/bin/make -f

generated_files = aclocal.m4 config.guess config.sub configure config.h.in depcomp INSTALL install-sh missing Makefile.in src/Makefile.in

override_dh_auto_configure: autoreconf-stamp
	dh_auto_configure

autoreconf: autoreconf-stamp
autoreconf-stamp:
	# save autofoo stuff
	for file in $(generated_files) ; \
	do \
		if ! test -e $${file}.deb-orig ; then mv -f $${file} $${file}.deb-orig ; fi ; \
	done

	autoreconf -f -i -s -I .
	touch $@

override_dh_clean:
	dh_clean

	rm -f autoreconf-stamp

	# restore saved autofoo stuff from above
	for file in $(generated_files) ; \
	do \
		if test -e $${file}.deb-orig ; then mv -f $${file}.deb-orig $${file} ; fi ; \
	done

%:
	dh $@
