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

export CPPFLAGS=-I/usr/include/eigen3

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- 					\
		--with-build-id=''				\
		--enable-shared					\
		--enable-eri=1					\
		--enable-eri2=1					\
		--enable-eri3=1					\
		--with-opt-am=3					\
		--enable-generic-code				\
		--disable-unrolling  				\
		--with-cmakedir=/usr/share/cmake/libint2

override_dh_autoreconf:
	dh_autoreconf ./autogen.sh

override_dh_auto_build:
	dh_auto_build
	(cd export/fortran;  make libint_f.o ENABLE_FORTRAN=yes)

override_dh_auto_install:
	dh_auto_install
	cp ./export/fortran/libint_f.mod debian/tmp/usr/include

override_dh_auto_clean:
	#dh_auto_clean
	rm -fr tests/eri/.libs
	rm -f include/libint2/basis.h

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
override_dh_auto_test:
	-$(MAKE) check LD_LIBRARY_PATH=$(CURDIR)/lib/.libs
endif
