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

%:
	dh $@ 

override_dh_auto_clean:
	dh_auto_clean
	rm -f examples/bin
	rm -rf examples/tmp
	find examples -name "results" | xargs rm -rf
	find examples/tests -name "*.out" | xargs rm -rf
	rm -f install/make_wannier90.sys
	rm -f extlibs/install/make_lapack.inc
	rm -f extlibs/install/make_blas.inc
	rm -f include/fft_defs.h

override_dh_auto_build:
	$(MAKE) all
	(cd Doc; $(MAKE))

override_dh_auto_test:
	(cd examples; ln -s -f ../bin)
	-(cd examples/tests; sh ./check-pw.x.j)
	-(cd examples/examples; for i in example?? \
		do cd $i; sh ./run_example; cd ..; done \
	 )
