#!/usr/bin/env modbuild

# :FIXME: this build-script is incomplete!!!

#pbuild::supported_os 'Linux'

case $OS in 
	Linux )
		target='LINUX-X86_64-PMODULE'
		;;
	Darwin )
		target='MACOSX-GFORTRAN-INTEL-MPI'
		;;
esac

pbuild::configure() {
	cp -v "${BUILDBLOCK_DIR}/${target}" "${BUILD_DIR}/configure"
	./configure.sh "${target}" || exit 1
}

pbuild::compile() {
	make
}

pbuild::install() {
	mkdir -p "${PREFIX}/bin"
	cp "${SRC_DIR}/bin/cpmd.x" "${PREFIX}/bin"
}

pbuild::add_to_group 'MPI'
pbuild::compile_in_sourcetree

