#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all,-branch optimize=+lto

BUILDDIR = $(CURDIR)/debian/build

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

override_dh_auto_configure:
	dh_auto_configure -- -DHEAPTRACK_BUILD_PRINT=ON -DHEAPTRACK_BUILD_GUI=ON

# 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 (armhf, $(DEB_HOST_ARCH))
override_dh_auto_install:
	dh_auto_install
	cd $(BUILDDIR) ; $(MAKE) test ARGS=-VV
endif # amd64
endif # nocheck

override_dh_auto_test:
