#!/usr/bin/make -f

export DH_VERBOSE=1

export FC_DEFAULT=gfortran
export FC_OPTIONAL=flang lfortran
export DH_NO_ORIG_LIBS=1

export DEB_BUILD_PROFILES=stage1

# Need a bootstrap version for fpm full build
ifneq ($(filter stage1,$(DEB_BUILD_PROFILES)),)
execute_before_dh_auto_clean:
	- mv fpm.toml.orig fpm.toml

execute_before_dh_auto_configure:
	cp fpm.toml fpm.toml.orig
	cp debian/fpm.toml.bootstrap fpm.toml
endif

# The magic debhelper  rule
%:
	dh $@  --with fortran --buildsystem=fortran

