#!/usr/bin/make -f

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

DEB_AUTO_UPDATE_LIBTOOL:=pre
DEB_AUTO_UPDATE_ACLOCAL:=,
DEB_AUTO_UPDATE_AUTOHEADER:=,
DEB_AUTO_UPDATE_AUTOMAKE:=,
DEB_AUTO_UPDATE_AUTOCONF:=yes
DEB_AUTOMAKE_ARGS:=--foreign --add-missing

include /usr/share/cdbs/1/rules/buildcore.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk

DEB_MAKE_INSTALL_TARGET:=

ifeq (linux, $(DEB_HOST_ARCH_OS))
DEB_CONFIGURE_EXTRA_FLAGS:=--with-alsa
endif

ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
DEB_CONFIGURE_EXTRA_FLAGS += --enable-profiling --enable-debugging
endif

clean::
	# Remove auto generated / updated files so they don't show in the
	# the diff.
	-rm m4/Makefile.in Makefile.in msvc++/Makefile.in
	-rm aclocal.m4 configure ltmain.sh config.h.in
	-rm -r autom4te.cache
	-rm m4/libtool.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 
	-rm m4/lt~obsolete.m4
	-rm depcomp compile missing 

post-patches::
	# touch aclocal.m4 so we have that file and cdbs regenerates it.
	touch aclocal.m4

