#!/usr/bin/make -f

# DH_VERBOSE := 1
export LC_ALL=C.UTF-8
export DEB_BUILD_MAINT_OPTIONS=hardening=+all

include /usr/share/dpkg/architecture.mk
ifeq ($(DEB_HOST_ARCH_BITS),32)
   DEB_CPPFLAGS_MAINT_APPEND = -DARCH_32
endif
export DEB_CPPFLAGS_MAINT_APPEND

%:
	dh $@

override_dh_auto_clean:
	dh_auto_clean
	rm -rf $(CURDIR)/debian/sphinxdoc $(CURDIR)/debian/man

override_dh_auto_configure:
	dh_auto_configure --  --with-capnp=/usr --with-gsl=/usr --prefix=$(CURDIR)/debian/tmp/usr

execute_after_dh_auto_build-indep:
	sphinx-build doc/sphinx $(CURDIR)/debian/sphinxdoc

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
ifeq ($(DEB_HOST_ARCH_BITS),32)
	echo "Do not test for 32 bit archs since test results were calculated for 64 bit."
else
	dh_auto_test --no-parallel
endif
endif