#!/usr/bin/make -f

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

LDFLAGS_DEF += `dpkg-buildflags --get LDFLAGS` -Wl,--as-needed
export DEB_BUILD_MAINT_OPTIONS = hardening=+pie,+bindnow

%:
	dh $@ --with autotools-dev

override_dh_auto_configure:
	autoreconf -f -i
	dh_auto_configure -- --without-documentation --disable-samples --enable-debug LDFLAGS="$(LDFLAGS_DEF)"

override_dh_auto_build:
	dh_auto_build
	doxygen Doxyfile 2>/dev/null

override_dh_auto_clean:
	$(RM) -r docs/doxygen
	dh_auto_clean
	find -name "Makefile.in" -print0 | xargs -0r $(RM)
	$(RM) tags	# just in case
	$(RM) aclocal.m4 configure autoconfig.h.in

override_dh_install:
	dh_install -plibupnp6-doc --sourcedir=.
	dh_install --remaining-packages -X.la --list-missing

override_dh_strip:
	dh_strip --dbg-package=libupnp6-dbg

override_dh_compress:
	dh_compress -Xhtml -X.pdf

