#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

include /usr/share/dpkg/default.mk

%:
	dh $@ --with autoreconf

override_dh_auto_configure:
	dh_auto_configure -- \
		--enable-testing \
		--with-optimisation=-O2

override_dh_auto_test:
	$(MAKE) -C debian/unit-tests all \
		CFLAGS="$$(env DEB_CFLAGS_MAINT_STRIP=-O3 \
			dpkg-buildflags --get CFLAGS)"
	+LD_PRELOAD=$(CURDIR)/debian/unit-tests/preload.so $(MAKE) unit-test GMOCK_DIR=/usr/src/googletest

override_dh_auto_clean:
	dh_auto_clean
	$(MAKE) -C debian/unit-tests clean
