wscript 1.4 KB

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