#!/usr/bin/make -f

include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/buildtools.mk

%:
	dh $@

override_dh_auto_configure:
	F77=$(F77) dh_auto_configure -- --with-otf=/usr --with-doc

override_dh_auto_test:
	echo "Running MPI smoketest, don't report failure here to gtg-trace, but to the mpi implementation"
	mpicc debian/test-mpi.c $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o debian/test-mpi
	mpirun --host localhost:2 -np 2 --bind-to none debian/test-mpi | grep 1/2
	echo MPI smoketest OK

	make -C test check

override_dh_auto_clean:
	rm -f debian/test-mpi
	dh_auto_clean
