#!/usr/bin/make -f

%:
	dh $@

# regenerate auto* stuff
override_dh_auto_configure:
	libtoolize -fc
	aclocal
	autoconf
	automake --add-missing --copy
	# Enable hardened build flags through dpkg-buildflags
	dh_auto_configure -- $(shell dpkg-buildflags --export=configure)

# remove prebuilt config.{sub,guess}
override_dh_clean:
	dh_clean
	rm -f config.sub config.guess
	rm -rf doc/api/

# clean out dependency_libs in the la-file
override_dh_install:
	sed -i 's/^dependency_libs/#dependency_libs/g' \
		debian/tmp/usr/lib/libid3.la
	dh_install

# only build the docs for binary and binary-indep builds, not for binary-arch
# in order not to waste buildd resources

docs:
	cd doc && doxygen
	rm -f doc/api/jquery.js

binary-indep: docs
	dh binary-indep

binary: docs
	dh binary

