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

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

install_file    = /usr/bin/install -p -o root -g root -m 644
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

CONFIGURE_FLAGS = --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
	--prefix=/usr --mandir=\$${prefix}/share/man \
	--infodir=\$${prefix}/share/info \
	--with-libctl=/usr/share/libctl \
	--with-gcc-arch=no \
	--enable-shared --with-pic --enable-cxx

%:
	dh $@ --with autoreconf

override_dh_auto_configure:
	F77=gfortran dh_auto_configure -- $(CONFIGURE_FLAGS)

override_dh_auto_install:
	dh_installchangelogs NEWS
	dh_auto_install

override_dh_clean:
	# we do not need this anymore
	rm -f tests/latest_output
	dh_clean
