#!/usr/bin/make -f

DH_VERBOSE = 1

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

override_dh_auto_configure:
	sh ./bootstrap.sh
	dh_auto_configure --builddirectory=nfft -- \
		--disable-static \
		--enable-all \
		--enable-openmp \
		--disable-applications \
		--disable-examples
	dh_auto_configure --builddirectory=nfftf -- \
		--disable-static \
		--enable-all \
		--enable-openmp \
		--disable-applications \
		--disable-examples \
		--enable-single \
		--program-suffix=f \
		--disable-doxygen-doc
	dh_auto_configure --builddirectory=nfftl -- \
		--disable-static \
		--enable-all \
		--enable-openmp \
		--disable-applications \
		--disable-examples \
		--enable-long-double \
		--program-suffix=l \
		--disable-doxygen-doc

override_dh_auto_build:
	dh_auto_build --builddirectory=nfft
	dh_auto_build --builddirectory=nfftf
	dh_auto_build --builddirectory=nfftl
	# make documentation in nfft build tree
	cd $(CURDIR)/nfft && make doc

override_dh_auto_clean:
	dh_auto_clean --builddirectory=nfft
	dh_auto_clean --builddirectory=nfftf
	dh_auto_clean --builddirectory=nfftl
	# clean main tree
	#dh_auto_clean --builddirectory=$(CURDIR)

override_dh_auto_install-arch:
	dh_auto_install --builddirectory=nfft --package=libnfft3-double2
	dh_auto_install --builddirectory=nfftf --package=libnfft3-single2
	dh_auto_install --builddirectory=nfftl --package=libnfft3-long2

override_dh_auto_test:
	dh_auto_test --builddirectory=nfft
	# only test double, otherwise too long
	#dh_auto_test --builddirectory=nfftf
	#dh_auto_test --builddirectory=nfftl

override_dh_strip:
	dh_strip --dbg-package=libnfft3-dbg
