#! /usr/bin/make -f
BUILDDIR = $(CURDIR)/debian/build

%:
	dh $@ --buildsystem=cmake --builddirectory=$(BUILDDIR) --parallel

export DEB_BUILD_MAINT_OPTIONS := hardening=+all
export NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))

disable_auto_test_archs = mips mipsel armel armhf

override_dh_auto_configure:
	dh_auto_configure -- -DDART_TESTING_TIMEOUT=300

override_dh_installchangelogs:
	dh_installchangelogs debian/Changelog_upstream

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	cd $(BUILDDIR); $(MAKE) -j$(NUMJOBS) buildtests
	dh_auto_test -- -j$(NUMJOBS) ARGS=-VV
endif

override_dh_auto_build-indep:
	cd $(BUILDDIR); $(MAKE) -j$(NUMJOBS) doc
	rm -f $(BUILDDIR)/doc/html/unsupported/installdox
