#!/usr/bin/make -f

LDFLAGS+=-Wl,--as-needed
WAF = ./waf

ifeq ($(shell dpkg-query -s doxygen graphviz 1>/dev/null 2>&1 && echo yes),yes)
CONFIGURE_EXTRA_FLAGS += --docs
endif

%:
	dh $@

override_dh_auto_configure:
	$(WAF) configure \
		--prefix=/usr \
		--mandir=/usr/share/man \
		--strict \
		--debug \
		$(CONFIGURE_EXTRA_FLAGS)

override_dh_auto_build:
	$(WAF)

override_dh_auto_clean:
	$(WAF) clean || true
	find -name "*.pyc" -delete
	rm -rf build .waf*
	dh_auto_clean

override_dh_auto_install:
	$(WAF) install --destdir=$(CURDIR)/debian/tmp

override_dh_strip:
	dh_strip --dbg-package=serd-dbg
