#!/usr/bin/make -f

include /usr/share/dpkg/default.mk

ifneq ($(wildcard /usr/lib/$(DEB_HOST_MULTIARCH)/hdf5/serial/libhdf5.so),)
  WITH_HDF5:=--with-hdf5=/usr/lib/$(DEB_HOST_MULTIARCH)/hdf5/serial
else
  WITH_HDF5:=--with-hdf5
endif

%:
	dh $@ --parallel --with autoreconf

override_dh_auto_configure:
	dh_auto_configure -- $(WITH_HDF5)

override_dh_auto_build:
	dh_auto_build
	make -C documentation pdf

override_dh_auto_clean:
	dh_auto_clean
	rm -f documentation/matio_user_guide.pdf test/atconfig test/package.m4 test/testsuite

override_dh_compress:
	dh_compress -X.pdf

override_dh_strip:
	dh_strip --dbgsym-migration='libmatio2-dbg (<< 1.5.3-1~)'
