2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-22 01:46:15 +01:00
waf/demos/fortran/wscript

83 lines
1.5 KiB
Plaintext
Raw Permalink Normal View History

2011-09-10 11:13:51 +02:00
#! /usr/bin/env python
# encoding: utf-8
# DC 2008
# Thomas Nagy 2010 (ita)
top = '.'
out = 'build'
def options(opt):
opt.load('compiler_fc')
2012-01-14 15:26:40 +01:00
opt.load('compiler_c')
2011-09-10 11:13:51 +02:00
opt.recurse('typemap')
def configure(conf):
2012-01-14 15:26:40 +01:00
conf.load('compiler_c')
2016-01-17 02:30:41 +01:00
conf.load('compiler_fc')
2011-09-10 11:13:51 +02:00
if conf.env.FC_NAME == 'IFORT':
2016-01-17 02:30:41 +01:00
conf.env.append_unique('FCFLAGS', '-warn')
2011-09-10 11:13:51 +02:00
elif conf.env.FC_NAME == 'GFORTRAN':
2016-01-17 02:30:41 +01:00
conf.env.append_unique('FCFLAGS', ['-Wall', '-W'])
2011-09-10 11:13:51 +02:00
conf.check_fortran()
conf.recurse('typemap')
def build(bld):
bld(
features = 'fc',
source = 'hello.f')
bld(
features = 'fc fcprogram',
source = 'hello.f',
target = 'hello',
use = 'DEBUG')
bld(
features = 'fc fcshlib',
source = 'foo.f',
target = 'shlib1',
2016-01-20 00:12:42 +01:00
defs = 'foo.def',
2011-09-10 11:13:51 +02:00
vnum = '2.3.9')
bld(
features = 'fc fcstlib',
source = 'foo.f',
target = 'foo')
bld(
features = 'fc fcprogram',
source = 'foo_pp.F',
target = 'foo',
defines = ['USEFOO', 'blah=1'],
use = 'shlib1')
bld.add_group()
bld(
features = 'fc fcprogram',
includes = 'src/include',
source = 'src/hello_inc.f',
target = 'hello_inc')
bld(
features = 'fc',
source = 'src/calculator_main.f src/calculator.f',
target = 'calc_objs')
bld(
features = 'fc fcprogram',
use = 'calc_objs',
target = 'calculator')
bld(
features = 'fc fcstlib',
source = 'mod/two_mods.f90 mod/uses_two_mods.f90',
target = 'mod/two_mods')
bld.recurse('typemap')
if bld.env.FC_NAME == 'GFORTRAN' and int(bld.env.FC_VERSION[0]) >= 6:
bld.recurse('submodules')