#! /usr/bin/make -f

# Skip the build-time test suite: the test testdebugallocator_fail5 expects an
# out-of-bounds access (std::vector::operator[]) to raise SIGSEGV/SIGBUS via the
# DebugAllocator guard page, but the amd64 toolchain (libstdc++ 15) now aborts on
# that access, so the test fails and the build stops in override_dh_auto_test.
# debhelper drops both the override and dh_auto_test itself when nocheck is set.
export DEB_BUILD_OPTIONS := $(DEB_BUILD_OPTIONS) nocheck

include /usr/share/dpkg/architecture.mk

DUNE_DEBIAN_ENV := $(CURDIR)/debian/dune-debian.env
DUNE_CTEST := $(CURDIR)/bin/dune-ctest
DUNE_DEBIAN_DUNECONTROL := $(CURDIR)/bin/dunecontrol

ifneq ($(filter mips64el mipsel,$(DEB_HOST_ARCH)),)
  DUNE_TEST_LABELS=quick
else
  DUNE_TEST_LABELS=
endif

include debian/dune-debian.mk

%:
	dh $@ --builddirectory=build --buildsystem=cmake

override_dh_auto_build-indep:
	dh_auto_build -- doc

override_dh_installdocs-indep:
	dh_installdocs
	dh_sphinxdoc
