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

%:
	dh $@ --builddirectory=$(BUILDDIR)

# Unittests are disabled on mips due to build failures
# It looks like the crash is happening in libunwind,
# needs to be investigated
#
# https://sources.debian.net/src/libunwind/1.1-4.1/debian/rules/#L34
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
ifneq (mips, $(DEB_BUILD_ARCH))
override_dh_auto_install:
	dh_auto_install
	cd $(BUILDDIR) ; $(MAKE) test ARGS=-VV
endif # amd64
endif # nocheck

override_dh_auto_test:
