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

export LIBS=-lblas -llapack -lpthread -lmpi

export CXXFLAGS=-g -O2 -DNDEBUG -DZDOT_RETURN

%:
	dh $@ --with autoreconf

override_dh_auto_clean:
	dh_auto_clean
	rm -rf $(CURDIR)/src/testsuite

override_dh_auto_configure:
	dh_auto_configure -- 			\
		--datadir=/usr/share/bagel	\
		--libdir=/usr/lib/bagel		\
		--enable-static			\
		--disable-shared		\
		--with-boost			\
		--with-libxc=yes		\
		--with-mpi=openmpi		\
		--disable-scalapack		\
		--enable-smith

override_dh_auto_install:
	dh_auto_install --destdir=$(CURDIR)/debian/tmp

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
override_dh_auto_test:
	dh_auto_test
	mkdir -p $(CURDIR)/src/testsuite
	-(cd $(CURDIR)/src/testsuite; ../TestSuite --log_level=all)
endif

override_dh_installchangelogs:
	dh_installchangelogs -XChangeLog
