#! /usr/bin/env python
# encoding: utf-8

srcdir = '.'
blddir = 'build'

def configure(conf):
	conf.check_tool('gfortran', tooldir='.')
	conf.env['FCFLAGS'] = ['-Wall', '-W']

	if not conf.check_fortran():
		conf.fatal('cannot compile a simple fortran program!')

def build(bld):
	"try using:       waf --zones=task_gen"

	bld.new_task_gen(
		features = 'fortran fprogram',
		source = 'hello.f',
		target = 'hello')

	bld.new_task_gen(
		features = 'fortran fshlib',
		source = 'hello.f',
		target = 'hello')

	bld.new_task_gen(
		features = 'fortran fstaticlib',
		source = 'hello.f',
		target = 'hello')

	bld.new_task_gen(
		features = 'fortran',
		source = 'hello.f')


	# See the bottom of gfortran.py for explanations
	# * add a particular uselib flag
	# * change the link system, neutralizing the default
	bld.new_task_gen(
		features = 'fortran fprogram flink_with_c++',
		source = 'hello.f',
		target = 'hello')

