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

#export DH_VERBOSE=1

export BOOST_TOP_DIR=/usr/
export OPENBLAS_TOP_DIR=/usr/lib/openblas-base/
export OPENBLAS_LIB_DIR=/usr/lib/openblas-base
export CC=g++
export LIBS=-lpthread -lgomp -L/usr/lib/lapack/ -llapacke

COMPILER_FLAGS = -g -Wall -fopenmp
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
COMPILER_FLAGS += -O0
else
COMPILER_FLAGS += -O2
endif
export CFLAGS=$(COMPILER_FLAGS)

%:
	dh $@ 

override_dh_auto_clean:
	(cd src; make -f Makefile_GNU clean)

override_dh_auto_build:
	(cd src; make -f Makefile_GNU depend)
	(cd src; make -f Makefile_GNU)

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
override_dh_auto_test:
	(cd test; ruby Test_Of_MolDS.rb)
endif
