#!/usr/bin/make -f

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- --with-otf=/usr --with-doc

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	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
endif

override_dh_auto_clean:
	rm -f debian/test-mpi
	dh_auto_clean
