#!/usr/bin/make -f
# -*- makefile -*-
# export DH_VERBOSE=1

export DEB_LDFLAGS_MAINT_APPEND=-Wl,--as-needed

CONFIGURE_FLAGS  = -DBUILD_TOOLS=ON
CONFIGURE_FLAGS += -DBUILD_SHARED_LIBS=ON
CONFIGURE_FLAGS += -DLIB_SUFFIX="/$(DEB_HOST_MULTIARCH)"

# FIXME the tests currently can't run with a out-of-source build
# TODO: patch the build system to build libgtest and fix the out-of-source
# problem.
#ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
#CONFIGURE_FLAGS += -DBUILD_TESTS=ON
#endif

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- $(CONFIGURE_FLAGS)

override_dh_installman:
	rst2man debian/fpcalc.rst > debian/fpcalc.1
	dh_installman

override_dh_installchangelogs:
	dh_installchangelogs NEWS.txt
