waf

FORK: waf with some random patches
git clone https://git.neptards.moe/neptards/waf.git
Log | Files | Refs | README

wscript (1569B)


      1 #! /usr/bin/env python
      2 # encoding: utf-8
      3 # DC 2008
      4 # Thomas Nagy 2010 (ita)
      5 
      6 top = '.'
      7 out = 'build'
      8 
      9 def options(opt):
     10 	opt.load('compiler_fc')
     11 	opt.load('compiler_c')
     12 	opt.recurse('typemap')
     13 
     14 def configure(conf):
     15 	conf.load('compiler_c')
     16 	conf.load('compiler_fc')
     17 
     18 	if conf.env.FC_NAME == 'IFORT':
     19 		conf.env.append_unique('FCFLAGS', '-warn')
     20 	elif conf.env.FC_NAME == 'GFORTRAN':
     21 		conf.env.append_unique('FCFLAGS', ['-Wall', '-W'])
     22 
     23 	conf.check_fortran()
     24 	conf.recurse('typemap')
     25 
     26 def build(bld):
     27 
     28 	bld(
     29 		features = 'fc',
     30 		source   = 'hello.f')
     31 
     32 	bld(
     33 		features = 'fc fcprogram',
     34 		source   = 'hello.f',
     35 		target   = 'hello',
     36 		use      = 'DEBUG')
     37 
     38 	bld(
     39 		features = 'fc fcshlib',
     40 		source   = 'foo.f',
     41 		target   = 'shlib1',
     42 		defs     = 'foo.def',
     43 		vnum     = '2.3.9')
     44 
     45 	bld(
     46 		features = 'fc fcstlib',
     47 		source   = 'foo.f',
     48 		target   = 'foo')
     49 
     50 	bld(
     51 		features = 'fc fcprogram',
     52 		source   = 'foo_pp.F',
     53 		target   = 'foo',
     54 		defines  = ['USEFOO', 'blah=1'],
     55 		use      = 'shlib1')
     56 
     57 	bld.add_group()
     58 
     59 	bld(
     60 		features = 'fc fcprogram',
     61 		includes = 'src/include',
     62 		source   = 'src/hello_inc.f',
     63 		target   = 'hello_inc')
     64 
     65 	bld(
     66 		features = 'fc',
     67 		source   = 'src/calculator_main.f src/calculator.f',
     68 		target   = 'calc_objs')
     69 
     70 	bld(
     71 		features = 'fc fcprogram',
     72 		use      = 'calc_objs',
     73 		target   = 'calculator')
     74 
     75 	bld(
     76 		features = 'fc fcstlib',
     77 		source = 'mod/two_mods.f90 mod/uses_two_mods.f90',
     78 		target = 'mod/two_mods')
     79 
     80 	bld.recurse('typemap')
     81 	if bld.env.FC_NAME == 'GFORTRAN' and int(bld.env.FC_VERSION[0]) >= 6:
     82 		bld.recurse('submodules')