#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

FC = gfortran
export FC

yorick/Makefile.orig:
	cp yorick/Makefile yorick/Makefile.orig

configure-stamp: yorick/Makefile.orig
	cd yorick; yorick -batch make.i
	touch configure-stamp

override_dh_auto_configure: configure-stamp

override_dh_auto_build:
	dh_auto_build
	make -C yorick

override_dh_auto_test:
	cd yorick; yorick -batch ../debian/check.i

override_dh_auto_install:
	dh_installyorick --no-make-install

override_dh_clean:
	dh_clean --exclude=yorick/OptimPack1-test.out.orig

override_dh_auto_clean: configure-stamp
	make -C yorick clean
	-mv yorick/Makefile.orig yorick/Makefile
	rm -f yorick/OptimPack1-test.out configure-stamp
	dh_auto_clean

overrides_dh_installdocs:
	dh_installdocs --exclude=README

%:
	dh  $@
