#!/usr/bin/make -f

## inspired from gsl material
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else ifeq ($(DEB_HOST_ARCH), m68k)
	CFLAGS += -O2
else ifeq ($(DEB_HOST_ARCH), alpha)
	CFLAGS += -O2 -mieee
else
	CFLAGS += -O3
endif

export ACLOCAL_PATH=/usr/share/gnulib/m4

default:
	@uscan --no-conf --dehs --report || true

%:
	dh $@ --with autoreconf

override_dh_auto_build-indep:
	$(MAKE) -C docs doc

override_dh_auto_test-indep:

override_dh_auto_configure:
	dh_auto_configure -- --enable-maintainer-mode

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	$(MAKE) -C tests check || cat tests/test-suite.log
endif

override_dh_strip:
	dh_strip --dbg-package=libapophenia0-dbg

get-orig-source:
	uscan --no-conf --download-current-version --verbose
